Tag Archives: scripting

farewell letter, the geeky way

#!/usr/bin/perl #note the -1 option lawl #@awesome_team_of_duane=`ls -1 /i1pb`; @awesome_team_of_duane=`ls -1 /home`; foreach (@awesome_team_of_duane) { print "Hi $_ \n"; print "It's been a pleasure working with you. I would like to take this time \n"; print "to thank you and … Continue reading

Posted in Uncategorized | Tagged , , | Leave a comment

I’m ‘expect’ing something lol

Supposed you just ran a script that would change your password on all the servers you’re admin’ng and you don’t have full confidence that changes have been implemented throughout. Or you may just want to check if all these servers … Continue reading

Posted in Uncategorized | Tagged , | Leave a comment

great ‘expect’ations (no pun intended)

CHANGING PASSWORD ACROSS MULTIPLE SERVERS scenario:supposed you have a boat-load of *nix servers being administered like say 2+ and these servers don’t use single sign-on authentication whereas your access credentials different between systems. in analogy, it’s like having the same … Continue reading

Posted in Uncategorized | Tagged , , , | Leave a comment

editing multiple files

to remove a specific line that contained a specific string e.g. | /usr/bin/odeiavir -r from multiple files in multiple folders e.g. /var/qmail/mailnames/hostname.com/user1/.qmail /var/qmail/mailnames/hostname.net/user2/.qmail /var/qmail/mailnames/hostname.org/user3/.qmail Run this: #find /var/qmail/mailnames -type f -name .qmail |xargs perl -pi -e ‘s/\| \/usr\/bin\/odeiavir .+//g’ What … Continue reading

Posted in Uncategorized | Tagged , | Leave a comment

icecast startup script

#!/bin/bash # # Startup script for icecast # # chkconfig: 2345 86 25 # description: Icecast Streaming Server # # processname: icecast # config: /etc/icecast.xml # pidfile: /usr/share/icecast/icecost.pid . /etc/rc.d/init.d/functions RETVAL=0 PIDFILE=/usr/share/icecast/icecost.pid CONF=/etc/icecast.xml ICECAST=/usr/bin/icecast OPTS=”-b -c $CONF” start() { echo … Continue reading

Posted in Uncategorized | Tagged , , | Leave a comment

playing with playlists.no pun intended.

suppose you have a playlist that you always use to stream audio content, but at times it gets boring to always listen to the same sequence of songs. what if you wanted your stream to play a commercial after every … Continue reading

Posted in Uncategorized | Tagged , , | 1 Comment

the $? variable

my encounter with this variable hasn’t been very pleasant i’ve been trying to debug a snippet of shell script similar to this: #!/bin/bash Test() { var=3 return $var } Test2() { Test print this is the return value $? print … Continue reading

Posted in Uncategorized | Tagged | Leave a comment