9th Annual System Administrator Appreciation Day
sysadmin day!! If you can read this, thank your sysadmin….
sysadmin day!! If you can read this, thank your sysadmin….
this one needs to be explained a little: Jaime Miravilles (gauche) et Salvador Dali (droite) as the two confused priests in “Un Chien Andalou (Andalusian Dog)” 1929 Un Film De Luis Bunuel Et Salvador Dali
begin snippet: function port { if [ $? -ne 0 ] ; then printf “warning: ” if [ $? -eq 6 ]; then echo “cant resolve host” fi if [ $? -eq 7 ]; then echo “cant connect to host” fi printf “site may be down\n” else printf “site is up\n” fi } curl -s … Read More
this script looks in a specific directory for sql dumps labeled xxx_20080101_xxx_alumn.sql.gz, xxx_20080101_xxx_const.sql.gz & xxx_20080101_xxx_log.sql.gz to ungzip and dump back into sql (assuming the db is there already). change as needed. #!/bin/bash # this script assumes that you have the sql backups gzipped FILE_DIR=/export/tmp/backup/temp if [ $# -lt 2 ]; then printf “\nneeds date of … Read More
boredom led me to write a command that does the same thing but three different ways; assume that the file that is being cat to use for this example contains: line 1 line 2 <form id=”form_login” name=”form_login” method=”post” action=”session_id=XXXXXx.xxxxx.NAM1&locid=0&lf=0&i> and i need NAM1 only. well, i actually need the three letter code and number. it … Read More
here is another in the long line of stupid scripts for nagios. this script finds specific process, then counts them and spits out an error level according to setting enjoy!! #!/bin/bash ## replace “ORA_” with some other unique identifier ## from vi :1,$s/ORA_/”unique”/g ORA_TEMP=/tmp/ora_procs.tmp ## replace “ora_” with what you need grep’ed ps -ef | … Read More