Archive for the ‘Serveradministration’ Category

UNIX Zeit mit Millisekunden

Posted: 9th Mai 2017 by Thorben Hemmler in Serveradministration

perl -le ‚use POSIX ’strftime‘; use Time::HiRes ‚gettimeofday‘; ($x,$y)=gettimeofday; $y=sprintf("%03d",$y/1000);print strftime("%Y-%m-%d %H:%M:%S",localtime($x)),".$y"‘

Linux: dmesg timestamp human readable

Posted: 30th September 2016 by Thorben Hemmler in Serveradministration

dmesg | perl -ne "BEGIN{\$a= time()- qx!cat /proc/uptime!}; s/\[\s*(\d+)\.\d+\]/localtime(\$1 + \$a)/e; print \$_;" Fri Sep 23 04:27:49 2016 sd 1:0:1:13: [sdbn] Result: hostbyte=DID_OK driverbyte=DRIVER_SENSE Fri Sep 23 04:27:49 2016 sd 1:0:1:13: [sdbn] Sense Key : Illegal Request [current] Fri Sep 23 04:27:49 2016 sd 1:0:1:13: [sdbn] Add. Sense: Illegal function (use 20 00, 24 00, […]

AIX: ls human readable

Posted: 1st Juni 2016 by Thorben Hemmler in Serveradministration

ls -l native_std* | awk ‚BEGIN{mega=1048576} $5 >= mega {$5 = $5/mega "MB"} {print}‘ -rw-r–r– 1 user group 31.0672MB Jun 01 15:32 native_stderr-pce.a.1.log -rw-r–r– 1 user group 41.3623MB Jun 01 15:32 native_stderr-pce.a.3.log

AIX – Kernel Zeit lesbar machen

Posted: 4th Februar 2016 by Thorben Hemmler in Serveradministration

#!/usr/bin/perl use strict; use warnings; my @dmesg_new = (); my $dmesg = "/bin/dmesg"; my @dmesg_old = `$dmesg`; my $now = time(); my $uptime = `cat /proc/uptime | cut -d"." -f1`; my $t_now = $now – $uptime; foreach my $line ( @dmesg_old ) {     chomp( $line );     if( $line =~ m/\[\s*(\d+)\.(\d+)\](.*)/i ) […]

mailq nach Emailadressen sortieren

Posted: 30th April 2015 by Thorben Hemmler in Serveradministration

mailq | awk ‚/^[0-9,A-F]/ {print $7}‘ | sort | uniq -c | sort -n Die Ausgabe sieht dann etwa so aus: 1 info@ebay.de 3 test@test.de 425 spam@spamschleuder.de  

HTTP / WebDav Methoden

Posted: 3rd Februar 2015 by Thorben Hemmler in Serveradministration

HTTP selbst definiert acht Methoden: GET / PUT / DELETE Eine Ressource anfordern, schreiben oder löschen (WebDav: DELETE Þ eine Collection löschen) POST Informationen an den Server Übermitteln (Formulardaten HEAD Ähnlich wie GET. Unterschied liegt darin, dass der Server in seinem Response keinen Message Body zurückgeben muss. OPTIONS Information über eine Kommunikation anfordern, ohne eine […]

Apache Tuning

Posted: 18th November 2014 by Thorben Hemmler in CentOS, Serveradministration

mod_deflate LoadModule deflate_module modules/mod_deflate.so Konfiguration anlegen: /etc/httpd/conf.d/deflate.conf <IfModule mod_deflate.c>  AddOutputFilterByType DEFLATE text/plain  AddOutputFilterByType DEFLATE text/html  AddOutputFilterByType DEFLATE text/xml  AddOutputFilterByType DEFLATE text/css  AddOutputFilterByType DEFLATE text/javascript  AddOutputFilterByType DEFLATE image/svg+xml  AddOutputFilterByType DEFLATE image/x-icon  AddOutputFilterByType DEFLATE application/xml  AddOutputFilterByType DEFLATE application/xhtml+xml  AddOutputFilterByType DEFLATE application/rss+xml  AddOutputFilterByType DEFLATE application/javascript  AddOutputFilterByType DEFLATE application/x-javascript    DeflateCompressionLevel 9   # Browser specific settings  BrowserMatch ^Mozilla/4 […]

Mysql Latin1 auf UTF-8 umstellen

Posted: 3rd November 2014 by Thorben Hemmler in MySQL, Serveradministration

iconv -f iso-8859-1 -t utf8 mysql.sql > mysql-new.sql mysql -u USER -p PASSWORT -h HOST –default-character-set=utf8 DB < mysql-new.sql