Månedsarkiv: februar 2011

MySQL udtræk med automatiske linienumre

mysql> select lecture,title,@i:=@i+1 as iterator from opgaver,(select @i:=0) foo where lecture=11 order by `order`; +———+———————+———-+ | lecture | title | iterator | +———+———————+———-+ | 11 | Gruppens opst?en | 1 | | 11 | Favoritemne | 2 | | 11 … Læs resten

Udgivet i Knowledge Base, Old Base | Skriv en kommentar

check if all wordpress installations is updated

This will probably not work, if a non-wordpress webdir contains a directory named ‘wp-includes’. Those webdevelopers were probably smoking pot anyway 🙂 web01:~# find /var/www/virtual -type d -name wp-includes | xargs -n1 -I{} -i bash -c ‘echo {} | cut … Læs resten

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

ispcp disable mail for a domain

nano /etc/postfix/ispcp/domains comment domain cp /etc/postfix/ispcp/domains /etc/ispcp/postfix/working cd /etc/postfix/ispcp postmap domains !!!!! New and improved version *** It works with the gui: – switch to the user (dom.tld) – delete all mail accounts – switch back to the corresponding reseller … Læs resten

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

OpenVZ recipies

#tcpsockets (must set both upper mem limit and numsockets) VZID=199 SOCKET_MB=5 NUM_SOCKETS=360 \ SOCKET_BAR=$((1024**2*$SOCKET_MB)) \ SOCKET_LIM=$(($SOCKET_BAR+($NUM_SOCKETS*2560))) ; \ vzctl set $VZID \ –numtcpsock $NUM_SOCKETS \ –tcpsndbuf $SOCKET_BAR:$SOCKET_LIM \ –tcprcvbuf $SOCKET_BAR:$SOCKET_LIM \ –save #othersockets, ie mysql etc. (must set both upper … Læs resten

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

Decrypt SQL and Mail password from ISPCP

#!/usr/bin/perl # # This is GPL! # # Writen by Mikkel Christensen, Mikjaer Aps # chdir(“/var/www/ispcp/engine”); require ‘/var/www/ispcp/engine/ispcp_common_code.pl’; my ($rs, $real_password); my $pass = $ARGV[0];; ($rs,$real_password) = decrypt_db_password($pass); printf (“%s”,$real_password); exit(0); ~

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