Kategoriarkiv: Old Base

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

USB Serial OSX install

The new unit: Has no label on the unit. Vendor-id: 0x0403 (Future Technology Devices International Limited) Product-id: 0x6001 Download the driver from: http://www.ftdichip.com/Drivers/VCP.htm The old unit: Is labeled Belkin on both sides of the unit. Vendor-id: 0x050d (Belkin Corporation) Product-id: … Læs resten

Udgivet i Knowledge Base, Old Base | Skriv en kommentar

SSL SMTP operation

% perl -MMIME::Base64 -e ‘print encode_base64(“\000base\@example.net\0001234abcd”)’ AGJhc2VAZXhhbXBsZS5uZXQAMTIzNGFiY2Q= % telnet 1.2.3.4 25 220 smtp.example.net NO UCE ESMTP ehlo testing 250-smtp.example.net NO UCE 250-STARTTLS 250-PIPELINING 250 8BITMIME quit % openssl s_client -starttls smtp -crlf -connect 1.2.3.4:25 220 a.mx.jms1.net NO UCE ESMTP ehlo … Læs resten

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

SSL Imap Operation

openssl s_client -connect hostname:993 a login user@example.com password a1 select inbox a1 fetch 1 full a2 fetch 1 body a3 logout

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

Skift sprog i Debian (Slip af med sprog)

statscollector2:~# df -h Filsystem Størr Brugt Tilb Brug% Monteret pÃ¥ /dev/sda1 227G 704M 215G 1% / tmpfs 506M 0 506M 0% /lib/init/rw udev 10M 80K 10M 1% /dev tmpfs 506M 0 506M 0% /dev/shm Rediger /etc/locale.gen Udkommenter det sprog/locale du … Læs resten

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

Fix charset fuckups for good … (iso/uft to xml entities)

#!/usr/bin/php <? for ($i=1; $i<$argc; $i++) { //print_r($argv); print “Doing “.$argv[$i].”….”;; $buffer=file_get_contents($filename=$argv[$i]); $buffer=html_entity_decode($buffer); $buffer=htmlentities($buffer); file_put_contents($filename,$buffer); print “Done!\n”; } ?> This is the sweet sensation about PHP …. Kiss dude 😉

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