Rsync with a non-standard ssh port

Posted: 3rd August 2017 by Thorben Hemmler in Serveradministration

Mit Komprimierung rsync -avz -e "ssh -p $port" user@remoteip:/path/to/files/ /local/path/ Ohne Komprimierung rsync -av -e "ssh -p $port" user@remoteip:/path/to/files/ /local/path/ Trockenlauf (Test) rsync -avn -e "ssh -p $port" user@remoteip:/path/to/files/ /local/path/

AIX Memory Befehle

Posted: 3rd August 2017 by Thorben Hemmler in Serveradministration

Memory gesamt svmon -G -O unit=MB | head -4 | tail -1 | awk {’print $2’} Memory in use svmon -G -O unit=MB | head -4 | tail -1 | awk {’print $3’} Free Memory svmon -G -O unit=MB | head -4 | tail -1 | awk {’print $4’} Summe XmX ps -fu $USER |grep […]

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  

CentOS7 Ethernet devices in old style

Posted: 24th März 2015 by Thorben Hemmler in CentOS

Hiermit bekommt man wieder den „old-syle“ der ifcfg-ethX devices angezeigt. Edit /etc/default/grub At the end of GRUB_CMDLINE_LINUX line append „net.ifnames=0 biosdevname=0“ Save the file Type „grub2-mkconfig -o /boot/grub2/grub.cfg“ Type „reboot“