Kategoriarkiv: Knowledge Base

putty tunnels from system tray

This is how to connect some ssh forwarded ports without having any unused putty windows in the taskbar. First download and install putty and configure pageant to start with windows. (use the installer package, not the standalone putty.exe) Make som … Læs resten

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

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

proftpd bandwith limit

<Directory /> AllowOverwrite on TransferRate APPE,RETR,STOR,STOU 25:1024 user !black </Directory> limits to 25KB/s with a 1024KB fullspeed limit, excludes the user black  

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

PHP XML Parsing

<pre> <?php $file = “artikel.xml”; $depth = array(); function startElement($parser, $name, $attrs) { global $depth; for ($i = 0; $i < $depth[$parser]; $i++) { echo ” “; } echo “$name “; if (sizeof($attrs)) { while (list($k,$v) = each($attrs)) { // … Læs resten

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

How to use Squid to stop computer worms and vira

[My credit goes to this clever hacker: http://www.aub.dk/~misak/index.php/archives/2004/10/27/35/] I am a one of the administrators for a network with about 900 residential users. We have no control over what people are running on their computer and therefor we get our … Læs resten

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

Mike keder sig og Riis tåger

#include <stdio.h> int findlastword(char *string,char *buffer) { int i,c; c=0; for (i=0; i<=strlen(string); i++) { buffer[c]=string[i]; c++; if (string[i]==’ ‘) {c=0;} } } int main(void) { char buffer[255],input[255]; int inputsize; inputsize=0; while ((input[inputsize] = getchar() ) != EOF) { if … Læs resten

Udgivet i Knowledge Base, Old Base | Skriv en kommentar

Windows LIVE CD’s

http://www.nu2.nu/pebuilder/ What is BartPE and PE Builder? Bart’s PE Builder helps you build a “BartPE” (Bart Preinstalled Environment) bootable Windows CD-Rom or DVD from the original Windows XP or Windows Server 2003 installation/setup CD, very suitable for PC maintenance tasks. … Læs resten

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

Sladrekort Manual

http://www.soyogroup.com/dl/manuals/peripherals/techaid_manual_v10.pdf

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