Månedsarkiv: juni 2007

Change timezone on Debian boxes

Current default timezone: ‘Europe/Copenhagen’ Local time is now: Mon Jun 25 13:51:47 CEST 2007. Universal Time is now: Mon Jun 25 11:51:47 UTC 2007. Run ‘dpkg-reconfigure tzdata’ if you wish to change it.

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

Recover MySQL root password

/etc/init.d/mysql stop /usr/bin/mysqld_safe –skip-grant-tables –skip-networking & mysql -u root use mysql; UPDATE user SET Password=PASSWORD(“your password here”) WHERE User=”root”; exit # kill all the mysql processes /etc/init.d/mysql stop # Start MySQL again /etc/init.d/mysql start

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

Tool for recovering broken harddisk…and stuff like that

http://www.cgsecurity.org/wiki/TestDisk

Udgivet i Knowledge Base, Old Base | Skriv en kommentar

Dualscreen med x200 paa debian med aabne drivere

Section “Files” FontPath “/usr/share/fonts/X11/misc” FontPath “/usr/X11R6/lib/X11/fonts/misc” FontPath “/usr/share/fonts/X11/cyrillic” FontPath “/usr/X11R6/lib/X11/fonts/cyrillic” FontPath “/usr/share/fonts/X11/100dpi/:unscaled” FontPath “/usr/X11R6/lib/X11/fonts/100dpi/:unscaled” FontPath “/usr/share/fonts/X11/75dpi/:unscaled” FontPath “/usr/X11R6/lib/X11/fonts/75dpi/:unscaled” FontPath “/usr/share/fonts/X11/Type1” FontPath “/usr/X11R6/lib/X11/fonts/Type1” FontPath “/usr/share/fonts/X11/100dpi” FontPath “/usr/X11R6/lib/X11/fonts/100dpi” FontPath “/usr/share/fonts/X11/75dpi” FontPath “/usr/X11R6/lib/X11/fonts/75dpi” # path to defoma fonts FontPath “/var/lib/defoma/x-ttcidfont-conf.d/dirs/TrueType” EndSection Section “Module” … Læs resten

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

Parse dhcpd.leases and return all active leases

#!/usr/bin/php <? $fh=fopen(“/chroot/dhcp/var/lib/dhcp/dhcpd.leases”,”r”); while ($dat=fgets($fh)) { if (preg_match(“/lease/”,$dat)) { $active=false; $ip = preg_split(“/ /”,$dat);$ip=$ip[1]; $dat=fgets($fh); while (!preg_match(“/hardware ethernet/”,$dat)) { if (preg_match(“/binding state active/”,$dat)) { $active=true; } $dat=fgets($fh); } $mac = preg_split(“/ |;/”,$dat); $mac=$mac[4]; if ($active) { print $ip.” – “.$mac.”\n”; … Læs resten

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