Archive for the ‘Computers’ Category

ZoneEdit DynDNS

Monday, July 7th, 2008

The IP on Carnivore doesn’t change much but when it does, it’s almost always at inconvenient times.
I knew ZoneEdit could do DynDNS but I’d never set it up. I did some searching a found a script here.
I changes a bit of it to make it work a little better for me. (Instead of going to a website to find out what my IP is, I just grab it off of the interface, I have it send me an email with the new IP, and have it run my iptables script if there is a new update)

Just dump this somewhere, create a domains.list file, and tell cron to run it every so often. I have mine set to run every 4 hours. The TTL on my zones are 1 hour. This seems reasonable enough.

#ZoneEdit DNS Updater

#Zone Edit config
ZEuser=”USERNAME”
ZEpasswd=”PASSWORD”

#Log file
dns_tmp=/tmp/dns_temp.log
dns_log=/var/log/dnsupdate.log

#If the lastIP record doesn’t exist, make a fake one.
if [ ! -f lastIP.txt ]; then
touch lastIP.txt
fi

#Get IP for error checking
myIP=`/sbin/ifconfig eth0|/bin/grep addr:|/bin/sed ‘s/.*addr:\([^ ]*\) .*/\1/’`
OldIP=`cat lastIP.txt`

if [ "$myIP" != "$OldIP" ]; then
#run firewall script
/path/to/FW-SCRIPT
#send email
echo “Carnivore IP Changed to $myIP” | /usr/bin/formail -I “Subject: New IP for SERVERNAME” | /usr/sbin/sendmail EMAIL-ADDRESS
#begin update
echo “========================================”
echo Time: `date ‘+%T – %d %B %Y’` >> $dns_log
echo “NEW = $myIP OLD = $OldIP” >> $dns_log

# domains.list is a file that has each of the hostnames you want to update, 1 on a line
if [ -f domains.list ]; then
#Update each domain in domains.list
for domain in `cat domains.list`; do
echo “Updating: $domain” >> $dns_log
wget -O $dns_tmp –http-user=$ZEuser \
–http-passwd=$ZEpasswd –no-check-certificate \
“https://dynamic.zoneedit.com/auth/dynamic.html?host=$domain”
cat $dns_tmp >> $dns_log
rm -f $dns_tmp
done
else
echo “Domain list file does not exist.”
fi

#rm -f index.html
echo $myIP > lastIP.txt

else
echo “No Update Necessary”

fi

exit 0

Microsoft 4000 Keyboard and Xmodmap

Thursday, May 29th, 2008

I wanted to map a few of the multimedia keys on my Microsoft 4000 keyboard so synergy would recognize them. The intent was to use the forward/back and play/pause button to control iTunes on the Mac. This is pretty simple, except the keyboard isn’t directly connected to the MBP. I had to do some keyboard map hacking to get this to work properly. Recorded here for future reference.

~/.Xmodmap

keycode 233 = F34
keycode 234 = F35
keycode 162 = F33

(then run ‘xmodmap ~/.Xmodmap’)

/etc/synergy/synergy.conf

section: options
keystroke(F33) = keystroke(control+alt+space,infinity)
keystroke(F34) = keystroke(control+alt+right,infinity)
keystroke(F35) = keystroke(control+alt+left,infinity)
end

(restart synergys)

And then I used a nifty app Sizzling Keys on the MBP that let me assign hotkeys to pretty much anything I want. I mapped Ctrt+alt+whatever to the appropriate actions in iTunes and viola!

smokeping

Thursday, December 6th, 2007

I’ve been using smokeping for various reasons all over campus and the ICCN lately.
I find it excellent for what I want it to do. I do however, find it a pain to set up.
It seems the author merely tarred up a directory and posts it to the website. Thus, users have to edit each and every script/cgi to reflect the actual locations of libraries and binaries on their system.
This isn’t hard, its just annoying.

Anyway, what isn’t included is an init script for RedHat or CentOS, so I wrote one.
Of course, you’ll have to edit it to reflect where your actual binaries are.
#!/bin/bash
#
# chkconfig: - 16 84
# description: A smokeping init script for RHEL
#
# processname: smokeping
# config: /usr/local/smokeping/etc/config

# source function library
. /etc/rc.d/init.d/functions

RETVAL=0
prog="smokeping"

case "$1" in
start)
echo -n $"Starting $prog: "
daemon /usr/bin/smokeping
RETVAL=$?
[ $RETVAL -eq 0 ] && touch /var/lock/smokeping
echo
;;
stop)
echo -n $"Shutting down $prog: "
killproc smokeping
RETVAL=$?
[ $RETVAL -eq 0 ] && rm -f /var/lock/smokeping
echo
;;
restart|reload)
$0 stop
$0 start
RETVAL=$?
;;
condrestart)
if [ -f /var/lock/smokeping ]; then
$0 stop
$0 start
fi
RETVAL=$?
;;
status)
status smokeping
RETVAL=$?
;;
*)
echo $"Usage: $0 {start|stop|restart|reload|condrestart|status}"
exit 1
esac

exit $RETVAL

vi/vim graphical cheat sheet

Monday, March 5th, 2007

Save for future reference.

vi/vim graphica cheat sheet tutorial

New Years Accomplishment Wish-List…Part 1

Wednesday, January 3rd, 2007

So I’m not really good at making resolutions, so I figured I’d make a list of accomplishments I’d like to realize this year.
Some could probably be considered resolutions, but hey, if I don’t deem them as such, I can’t say that I failed to stick to them. :)

1. Lose Weight: I don’t consider myself overweight, and I am in no means overweight when considering my age/height, however, I’m above my target weight. I feel like I’ve eat too much and am not as active as I’d like to be. Here is my plan: Purchase a stationary bike, play Hockey, quit laying around after work.

2. Get back into shape: You’d think that this would fit under No1, but to me, it doesn’t. It might certainly be a result of No1, but I could easily lose weight without increasing my stamina and energy level.

3. Get my General License: Now that the FCC has dropped the Morse Code requirement for all Amateur Radio classes, I have no excuse. I just need to hunker down and study. It really only gains me HF privileges and I don’t have an HF radio, but I would still like to do it.

4. Catch up on new/old Technology: This is pretty much a requirement of my job, but I’ve been doing a lousy job of it lately. I get so busy at work that I don’t have time to read/research/poke around with new technology. And once I get home, I don’t feel like it. I got a few good books for Christmas and need to set aside some time to read them. I also need to read up on a few of the things we’re going to be implementing at work.

5. Cook More: I can do it. I’ve got the tools. I just need to make myself cook. Too many microwave dinners, too much eating out, too many pizzas.

6. Save for a Down Payment: I kinda started this in August but I need to work a little harder at it. A buddy of mine moved in December, seeing his house and helping him move/rearrange made me jealous. I want the flexibility of a house, and I want to start gaining equity. And I want a garage. :)

7. Do something Racy: (Its not what you think Mom) I often say I own a street legal Race Car. And I do. But what have I done with it? Nothing. I want to autocross, or rally or something. Maybe even just go to a performance driving school.

This is the end of Part 1. If/when I think of more, I’ll add a Part 2.

[AUTOSAVED] New Years Accomplishment Wish-List…Part 1

Wednesday, January 3rd, 2007

So I’m not really good at making resolutions, so I figured I’d make a list of accomplishments I’d like to realize this year.
Some could probably be considered resolutions, but hey, if I don’t deem them as such, I can’t say that I failed to stick to them. :)

1. Lose Weight: I don’t consider myself overweight, and I am in no means overweight when considering my age/height, however, I’m above my target weight. I feel like I’ve eat too much and am not as active as I’d like to be. Here is my plan: Purchase a stationary bike, play Hockey, quit laying around after work.

2. Get back into shape: You’d think that this would fit under No1, but to me, it doesn’t. It might certainly be a result of No1, but I could easily lose weight without increasing my stamina and energy level.

3. Get my General License: Now that the FCC has dropped the Morse Code requirement for all Amateur Radio classes, I have no excuse. I just need to hunker down and study. It really only gains me HF privileges and I don’t have an HF radio, but I would still like to do it.

4. Catch up on new/old Technology: This is pretty much a requirement of my job, but I’ve been doing a lousy job of it lately. I get so busy at work that I don’t have time to read/research/poke around with new technology. And once I get home, I don’t feel like it. I got a few good books for Christmas and need to set aside some time to read them. I also need to read up on a few of the things we’re going to be implementing at work.

5. Cook More: I can do it. I’ve got the tools. I just need to make myself cook. Too many microwave dinners, too much eating out, too many pizzas.

6. Save for a Down Payment: I kinda started this in August but I need to work a little harder at it. A buddy of mine moved in December, seeing his house and helping him move/rearrange made me jealous. I want the flexibility of a house, and I want to start gaining equity. And I want a garage. :)

7. Do something Racy: (Its not what you think Mom) I often say I own a street legal Race Car. And I do. But what have I done with it? Nothing. I want to autocross, or rally or something. Maybe even just go to a performance driving school.

This is the end of Part 1. If/when I think of more, I’ll add a Part 2.

Oops

Saturday, December 16th, 2006

This is what happens when you don’t do sanity checking.
Start a process, it fails, mail a report, try again.
Loop, forever.
My bad. :(

A perfect combination

Wednesday, October 25th, 2006

Mozilla Firefox 2.0 + Foxmarks + FoxyTunes + Firefox Tab Bar Fix = Perfect Browsing experience.

I had been searching for a LONG time for a way to control iTunes in a way that I could still see my auto-refreshing InterMapper screen on the iLamp.
What other extensions should I try? Leave a comment.

Update:
browser.tabs.closeButtons = 0 (only show the close button the tab if it is in focus)

Fix Firefox 2.0′s tab bar

Sunday, October 22nd, 2006

I moved to Firefox 2.0 on my home machine to fix the slowness I started seeing after having 20+ tabs open in the tab bar.
Much to my surprise and anger, I saw a nice new “feature” that scrolled tabs off the side of the screen after a set number of tabs were open. Or so I thought.
Having a 20″ wide screen monitor, I like to have a BUNCH of tabs open. I searched and searched in Preferences to increase the number of tabs, but it wasn’t there.
Nothing in the help, no extensions to fix it, nothing on the web.

So I decided to prod around in about:config
(open a new tab and type “about:config” in the address bar)

The values you want to set are:
browser.tabs.tabClipWidth
browser.tabs.tabMinWidth

I set mine to 50 and 40 respectively. This allowed me 29 tabs on my 1680×1050 screen before I got the scroll arrows.
I rarely get up to 29 tabs, but I like the fact that I can get there without worry.

Now I can move up to 2.0 on each of my machines when it comes out on Tuesday.

Standards People, Standards!!!

Wednesday, September 20th, 2006

This is my public plee to everyone about standards.

I’m sick and tired of people creating files in proprietary formats. WMV, WMA, doc, xls.
Not everyone uses Windows XP or a variant there of.
I’m primarily Linux at home, and Mac OSX at work. I obviously can’t view these files without headache.

There are standards. jpeg, mpeg, pdf, etc..

Love them, use them.

Learn that if you use something that EVERYONE can use/see, you’ll get a better return.
If you have a website that uses nothing but proprietary formats, I’ll likely stop visiting it, and tell my friends to do the same.
This decreases your hits AND more importantly, decreases the money you get from stupid Google Ads and whatnot.

I encourage you to embrace Open Standards. That is all.