Månedsarkiv: september 2005

C# write XML to stream with XmlDocument

Stream outputStream = new MemoryStream(); XmlDocument doc = new XmlDocument(); XmlElement root = doc.CreateElement(“packet”); XmlElement type = doc.CreateAttribute(“type”); if (this.request) type.Value = “request”; else type.Value = “response”; root.AppendChild(type); XmlElement callElement = doc.CreateElement(“call”); XmlAttribute funcAttr = doc.CreateAttribute(“func”); funcAttr.Value = this.func; callElement.AppendChild(funcAttr); … Læs resten

Udgivet i Knowledge Base, Old Base, Programmering | Skriv en kommentar

how to edit strings with mysql

Mysql replace is nice UPDATE `users` SET homedir = REPLACE(homedir, ‘/home/daemons’, ‘/home/vmail/’), maildir = REPLACE(maildir, ‘/home/daemons’, ‘/home/vmail/’);

Udgivet i Knowledge Base, Old Base | Skriv en kommentar

how to add a user to a group

This is a nice way to add a user to a new group, from any script or other non-interactive metod: usermod -G $(id -nG root | sed -e “s/ /,/g”),vmail root

Udgivet i Knowledge Base, Linux, Old Base | Skriv en kommentar