shell color code script

so i have forgotten over the years how to add color to text in my terminal. so i wrote this script to show me some color combinations. here is what the output looks like: click image to enlarge

md5sum & sha1sum from zshrc

i just added this quick little function just to give me a quick output when attaching to emails: function checksum() { printf “FILE: `echo ${1}`\n” ; printf “SIZE: `ls -al ${1} | awk ‘{ print $5 }’` bytes\n” ; printf “MD5 : `md5sum ${1} | awk ‘{ print $1 }’ | tr ‘[:lower:]’ ‘[:upper:]’`\n” ; … Read More

script to control pianobar from any local terminal

i sit in multiple terminal sessions all day on my personal and work machine with my headphones on listening to pianobar (cli client for pandora : get it here or in gentoo emerge pianobar) and i realized that it was becoming a pain to send controls to the pipe for pianobar. so i wrote a … Read More

script to sync folder to s3 using cron and s3cmd

so on the command line, i have been looking for a brain dead simple way of syncing my photographs to s3 every x amount of hours. i wrote a small script to handle that and can be placed in cron to automatically copy new folders to s3. i am working on making this script also … Read More

shell script to output bandwidth rx/tx & packet rx/tx values to graphite

so this script uses bwm-ng (gentoo : gentoo: emerge bwm-ng, or http://www.gropp.org/?id=projects&sub=bwm-ng) and netcat. pretty straight forward : #!/bin/bash ####### # this script uses bwm-ng to gather the bandwidth rx/tx and packet rx/tx on specified interfaces # it only sends numeric values # # to run this script : # nohup sh ~/scripts/bandwidth_graphite.sh & >/dev/null … Read More

muttrc with encrypted passwords

so after some more work trying to ensure that my passwords are not easily gotten, i managed to get my passwords encrypted into one file and removed after being read. here is the snippet from my .muttrc-accounts : set my_tmp=`gpg -q –no-verbose -o /tmp/.passwords.tmp -d ~/.passwords.gpg` set my_pass_acct1=`cat /tmp/.passwords.tmp | grep IDENTIFIER1 | awk ‘{ … Read More

shell script to output citrusleafdb namespace values to graphite

exactly as the name says. if you are a citrusleaf user, here is an easy (and hacky) way to output your namespace values to graphite with a nohup script every 10 seconds in github or here: #!/bin/bash ####### # this script runs through clinfo and grabs all the values for citrusleaf, then parses them out … Read More

thinkpad hibernate / suspend stuff without TuxOnIce

at time of writing, gentoo TuxOnIce is at sys-kernel/tuxonice-sources-3.0.26 and gentoo sources is at sys-kernel/gentoo-sources-3.3.1. so after compiling tuxonice-sources (here is my .config for reference) and configuring all the hibernate / suspend scripts referenced here i realized that after resuming from either suspend to ram or hibernating to swap that my function keys were borked. … Read More

thinkpad tmux battery status

so i realized that with the setup i have that i did not have a detailed battery indicator on my thinkpad except for the battery light, so i decided to use acpi (gentoo: sys-power/acpi, or sourceforge). by just typing acpi (with the laptop unplugged) you get : Battery 0: Discharging, 99%, 02:58:51 remaining while plugged … Read More

snippet to add aws volumes and instances (rough)

just a snippet of something i was working on to add volumes to instances in aws using the amazon ec2 ami / api tools. very rough draft. TMP_VOL_OUT=”$(basename $0).$$.tmp” TMP_INST_OUT=”$(basename $0).$$.tmp” ## input the number of volumes to create- echo “How many volumes to create ?: \c” read VOLNUM echo “Creating ${VOLNUM} volumes” ## input … Read More