Skip to content

Instantly share code, notes, and snippets.

Petr Michalec epcim

View GitHub Profile
View awk.txt.howto.md
    #!/bin/sh

    awk '{
    if (x=index($1,"AN")>0)
            print $NF,"=>","Fail";
    else
            print $NF,"=>","Pass";
View backup.howto.md

rsync, rdiff-backup tutorial

time sudo tar --exclude "*rdiff-backup-data*" czf /hg2g/bkp/ape_pmichalec-workforce-nb.t410.linux.home_2011-08-07.tar.gz /media/portable-hg2g/bkp/ape/pmichalec-workforce-nb.t410.linux.home

View bash.howto.md

Some BASH trics, scripts etc.

Disable CTRL+C in script

trap '' 2
View bibble-correct_bibble_workqueues.howto.md
#!/bin/sh
# fix bibble labs workqueus
```
for i in `ls *.work`; do cat $i | sed -e 's/\(.*\)\/\(.*\)/\/home\/epcim\/hg2g\/pho\/archive\/2008\/2008-09_DovolenaToskanskoKorsica\/ape-allToProcess\/\L\2/' > $i.ok ; done
echo rm *.work
for i in `ls *.work.ok`; do N=`echo $i | sed -e 's:\.ok::'`; echo mv $i $N ; done
```
View bluemix.howto.md

Bluemix, cloud foundry basics

connect

cf api https://api.ng.bluemix.net

login

cf login -u user@email.com -o user@email.com -s SITENAME

deploy

View check-used-inodes.howto.md

Bash script: check used inodes

    find / -xdev -printf '%h\n' | sort | uniq -c | sort -k 1 -n

    du --inodes -S | sort -rh | sed -n \
            '1,50{/^.\{71\}/s/^\(.\{30\}\).*\(.\{37\}\)$/\1...\2/;p}'
You can’t perform that action at this time.