Yes yes, I know, sometimes you just get curious about your boot sector. Your Sysadmin says you'll go to hell if you play with it, and god knows what would happen if you tried to modify it. But sometimes, when you've been screwing with Lilo and Grub and you can't really remember which one is installed, it's nice to have a peek:
dd if=/dev/hda of=mbr.img bs=512 count=1 xxd -g 4 mbr.img
Where /dev/hda is the drive you want to look at.
Output should look something like this:
-snip-0000150:
31fffcf3 a51f61ff 26427cbe 7f7de840 1.....a.&B|..}.@0000160:
00eb0ebe 847de838 00eb06be 8e7de830 .....}.8.....}.00000170:
00be937d e82a00eb fe475255 42200047 ...}.*...GRUB .G0000180:
656f6d00 48617264 20446973 6b005265 eom.Hard Disk.Re0000190:
61640020 4572726f 7200bb01 00b40ecd ad. Error.......00001a0:
10ac3c00 75f4c300 00000000 00000000 ..<.u...........-snip-
Oh no, I've displayed all my most intimate parts for everybody to see. Oh well...hey, there's Grub. Cool. :)
So you want to map a public IP to a private IP behind your Linux (netfilter) based firewall. Here is the syntax:
## Standard Stuff ##
echo 1 > /proc/sys/net/ipv4/ip_forward
iptables --table nat -A POSTROUTING -o eth0 -j SNAT --to $NAT_IP
## The 1:1 NAT stuff ##
iptables -t nat -A PREROUTING -d $EXTERNAL_IP
-j DNAT --to-destination $INTERNAL_IP
iptables -t nat -A POSTROUTING -s $INTERNAL_IP
-j SNAT --to-source $EXTERNAL_IP
iptables -t nat -A POSTROUTING -s $INTERNAL_NET -d $INTERNAL_IP
-j SNAT --to-source $NAT_IP
Where $NAT_IP is the external IP of your firewall. The last rule is required if you want hosts on your internal net to be able to talk to that external IP as well.
After a successful night of coding, I decided to start blogging my development of the MachDB.
Yay! First post! I'll describe it more later.
(also checking out the cool labels that blogger has now)
And going to bed.
Watching Jay Leno this week, I heard a band I wasn't familiar with, Fiction Plane. 3 talented guys sang a great song called "Two Sisters". One of the best rock/pop songs I've heard in a long time. And going back to look up the name, I discovered that the NBC Jay Leno web site has a free 160kbps MP3 for download....right above a link to buy it. :) Get it right here, before somebody realizes the (what has to be) mistake and takes it down.
I'm always impressed with bands that can create great music with only a few bodies. Trivia note: If you look them up, you may think the lead singer, Joe Sumner, looks familiar. His dad is Sting.
I got a new toy recently. A Canon TC-80N3...a programmable remote timer for my DSLR. I've always been a huge fan of Time Lapse video, especially the clouds moving and flowers blooming. I made one of my own, recorded at full image size and scaled down to 1080p for your viewing pleasure. File is 28MB: Mira Mesa Night Sky Timelapse 2007-05-09. Here's the embedded version:
Other than seeing the stars move at 450 times normal speed, the neatest part is the planes flying around at the bottom. They almost look like UFO's. You can see the fog roll in later in the shots as the camera gets a layer of dew on the lens. The exposure was 10sec each, taken every 30 seconds and playback is at 15fps.
I'll be making more of these and posting them to my blog as I have time. Tell me what you think.
Other timelapse posts:
Blogerize My Time Lapse
6 hours of Friday
More Timelapses
Pumpkins
Flight of the Servers/VMIX Down Page
My company, VMIX was recently on the local San Diego ABC affiliate, 10 News. I was actually in a few of the shots and when looking for the video, found that the 10news.com website's windows media video player didn't work on my Mac. So I created a quick hack to return the URL to the .asx file so I can play it with VLC.
Search for the story and pull up the video detail page. The URL should be something like this: http://www.10news.com/video/13299238/detail.html
Open up "Terminal" on your mac and paste this command, replacing the first URL with the URL of your video detail page:
curl http://www.10news.com/video/13299238/detail.html -s
| grep 200k
| awk -F"'" '{print "http://mfile.akamai.com/12922/wmv/vod.ibsys.com"$2}'
| sed 's/wmv$/asx/g'
The result should be something like this:
http://mfile.akamai.com/12922/wmv/vod.ibsys.com/2007/0511/13299238.200k.asx
Which you should be able to play in VLC. You can also include that URL in your blog to quote the story. Hit this link to see the video coverage and my geeky mug at the keyboard. Video clip courtesy of 10news.com.
Update: Url's changed to local video.
I was explaining this to a friend that suggested I blog it. I try to do it every 6 months with my shoes if they need or not.
The reason this works: the bacteria inside your shoe that produce odor thrive in a warm moist environment. Freeze them and it will kill them out. The baking soda will absorb the smell, if it remains after the bacteria die.
Ever spawn off a big job and immediately realize it'd have been great to get a notification when it's done? If it still has hold of your terminal, you could blindly type the next command and hope it works. But if it's forked into the background, that won't even work. Here's how to do it:
Find the process ID of your job. In my case it was 22603:
$ ps auxw | grep batch_process
user 22603 0.0 0.1 8044 2076 pts/18 S+ 01:24 0:00 batch_process -bg
Great, now that we have it, use it like this below:
$ ( while ps 22603; do sleep 60 ; done ; date | mail
you@yourcompany.com -s "process done" ) &
Now I can log out and wait to get a mail on it.
The same thing works when waiting for a machine to come back up:
until ping -c 2 hostname.domain.com ; do sleep 10 ; done ; date | mail you@yourcompany.com -s "hostname back up"
Alter the number of seconds of sleep for higher resolution on the checks. The above will send 2 ping checks every 10 seconds. Close enough for rock and roll.
I learned something just now while double-checking my ping syntax:
"-a Audible ping.
" Yes, ping will bonk your shell on each packet
return. Whoah cool
I've been a Mac head since my first B&W Mac in the 80's. So my first windows PC was purchased exclusively to play Unreal Tournament. I was blown away by that game, I remember looking at the reflections and the multiplayer game play with my jaw on the floor. I really haven't played much in the way of games since then...
Until recently...the onslaught of thousands of half decent flash games that are fun and entertaining. No fancy graphics needed. In fact, most of them could have been played on an 8 bit system if properly written. The best one I've seen lately is here: http://ec2-1.playr.co.uk/onslaught/ Screenshot of the action below:
Tracy and I went to see Tool tonight. Pretty rockin show. The visuals were great, and they had some sweet laser action going. I do get the distinct feeling that I just got back from the airshow tho...I'm freakin deaf. The music was way too loud for my taste...next time I'll have to remember to bring my earplugs.
Isn't thinking that loud music is too loud a sign of getting older? ;)