Monday, June 2, 2008, 06:57 PM - Technology
If anyone uses shorewall for their firewall needs, and uses a dynamic IP, then this is definitely the most useful tidbit ever. This grabs a list of addresses bound to the local host with ipv4 devices (ipv6 can be added by replacing inet with inet6). This comma-separated list is then stored in the $SELF variable which can be used in rule columns such as Original Destination. All you have to do is add this line to the params file.
SELF=$(ifconfig | sed -n 's/.*inet addr:\\([^ ]*\\).*/\\1/gp' | sed ':a;N;s/\\n/,/;ta')
Simply restarting shorewall will rerun this... so you can cue a re-parse by adding 'service shorewall restart' to your network init, or your dhcp renewal script.
Really, it is useful for more than shorewall... but it is why I use it :).




( 2.9 / 458 )
Sunday, June 1, 2008, 05:49 PM - Technology
This is a quick lil one-liner to display which services are running currently versus which are running by default. It is helpful when you have a server running for a while, and you need to restart but you forgot which services you've manually started.
vimdiff <(for i in /etc/init.d/*; do echo -n "$i "; $i status 2>/dev/null | grep -c running; done | egrep -v '0$' | cut -d' ' -f1 | cut -d/ -f4) <(chkconfig --list | awk '{ print $1, $7}' | sed -n '/5:on/p' | cut -d' ' -f1)
It takes a while to come up with the report, but it isn't something you'd run often anyway... The right side of the screen shows the default services, and the left side shows the currently running services.
Thursday, May 8, 2008, 09:18 AM - Technology
I figured I'd share this gem to get hgwebdir.cgi working with thttpd, as I needed this for a light user-space server for a while. I don't use it anymore, but people are more than welcome to try this out to get hgwebdir.cgi working with thttpd. Just stick the following lines of python in the cgi file, before the call to WSGIServer, making sure that SCRIPT_NAME points to the appropriate location of the file itself.
import os
os.environ["SCRIPT_NAME"] = '/cgi-bin/hgwebdir.cgi'
os.environ["REQUEST_URI"] = os.environ["SCRIPT_NAME"]
if os.environ.has_key("PATH_INFO"):
os.environ["REQUEST_URI"] += os.environ["PATH_INFO"]
if os.environ.has_key("QUERY_STRING"):
os.environ["REQUEST_URI"] += "?" + os.environ["QUERY_STRING"]
Wednesday, March 12, 2008, 05:14 PM - Personal
I have time to write today, as I'm home sick :(. Anyway, I'm very excited to have finally made the big move to Chicago. I purchased a condo in Lakeview at the very end of my last semester in college, and have been moved in since January. It has been a long time since I've posted, mainly because so many huge changes have been made, it has been impossible to keep up with.
The Chicago area is great. I use public transportation every day and thank God for the fact that I don't rely on using a car; especially as this dollar keeps weakening, bringing gas prices up to unrealistic numbers. I'm in a great area, within walking distance to nearly everything.
My job is a half hour away, in the loop. The trip isn't nearly as bad as it sounds, however. I can almost always read or use my laptop on the way there and back; which really makes time fly.
I finally have a roommate as of this month; although for a short period of time. I plan on getting another roommate in a few months; hopefully someone I know. I still need to rent out my parking spaces though!
Anyway, things are looking up. My job is incredible, along with the people I work with and the perks. I actually feel like I'm missing out being home sick.
Sunday, March 2, 2008, 10:10 PM - News
For whom it may concern,I have recently upgraded my server, including web, e-mail, etc. This action has been brought about due to a broken motherboard, and many other sever reasons for needing a new system.
The new machine is not completely set up yet, but e-mail and webspace should be working. If anyone finds any new problems using their services, please let me know!
I realize this is generally off-blog-topic, but it needs to be said somewhere. I have had _MANY_ things going on in my life that I would have loved to blog about, but honestly, I haven't had the time! I hope to start blogging again soon.
Thanks,
Mike
Wednesday, November 14, 2007, 05:04 AM - Programming
I have had an off & on interest in many, many different aspects of technology (most specifically electrical engineering and computer science), but I find myself coming back around to AI. I've always been absolutely fascinated by the human mind, and the biomimetics derived from the mind in many technical fields. Therefore, I will most likely be re-scratching a long-lived itch of mine, regurgitating a bunch of information as I go on my blog.For now, I am finishing my CS degree and planning a very busy next two months. However, I will be taking some reading materials with me wherever I go (like I always do), except this time the topic will be artificial intelligence. I also find this area at the very least partially useful for my upcoming career in automated trading.
Googling for 'artificial intelligence programming' has already brought up some great resources I plan to browse through, especially to get book reviews. Please, if anyone has any tips, post comments! I read them greatfully :).
Wednesday, November 7, 2007, 04:54 PM - Family

As a tribute to my sister Amy, and anyone else out there who has adopted, I am temporarily changing my site's color to purple. I have a 'thing' for adoption, personally.. I'd much rather see children in need being taken care of than more children not taken care of. I realize that not everyone can afford adoption, but in my humble opinion, if you can, you should :).
OK, that ends my adoption rant. I just wanted to explain the new color. :)
Sunday, November 4, 2007, 05:33 PM - Personal

Ever look at your calendar and say... "Holy $&*#" ???
This is my feeling as I stare at this approaching date. This is when my last final ends. I plan to move to Chicago, buy Christmas presents, go to Mexico, and start my job in 30-some days after this hour. Live will be BUSY! But.. I can't wait.
There are so many good things about my plans, that I completely overlook the cold, windy Chicago weather which I face. Blech!
The other major consideration I'm making is whether or not to have a vehicle. The best plan would be to find groceries, etc. inside walking distance from my Condo, such that a car becomes completely unnecessary. This, and I don't wish to pay for parking!!! I'd rather use that money to pay for my scary mortgage that I'm planning for...
So, if anyone has any experience living in Chicago, with or without a vehicle, I'm up for hearing your stories :). I want advise before I find a place that doesn't have a parking spot :/.
Wednesday, October 31, 2007, 04:00 PM - Cool

A few of you already know this, but I worked on a research project called DMDR last year at Purdue, under Dr. Kihong Park. It was an awesome experience. I highly recommend doing some sort of research project if you're an undergrad.
This story is about a project I discovered in the latest ACM Queue journal, which highlighted some "futuristic" technologies in distributed file systems. As I was reading about them, I found an article on pNFS. This made me cry. Tears of steel. Why? Because it turns out that they did what I wanted to do, and approached in my research!!!
If anyone is interested in DFS technology, pNFS is definitely worth checking out. If not because I wanted to do it, then because it is potentially extremely useful for a corporation. I may join this project someday...
If you're bored, check out my whitepaper, and then read the ACM article. The best part is that I originally wanted to do my project as an extension of NFS (just like them), but determined the ramp-up would be way too much for a semester project... Ahhh!
Oh well, maybe someday my project will be in the ACM journal instead ;).
Wednesday, October 31, 2007, 02:53 PM - Personal

As of a few hours ago, I have verbally accepted the offer from Allston. Therefore, I am also planning to move to Chicago, and will being my job on Jan 21, 2008. I will be spending the week before that in Mexico, as a 'fair well' party for collegiate life.
I plan to investigate future opportunities outside of the financial business eventually, but at least for now, I go where the money is :). I can't deny that I'd enjoy learning the financial business and being somewhat successful in it, either.. Plus, I can go to London in a few years; yay :).
I apologize to anyone expecting technology info in this blog, lately. I plan to really start making interesting posts next year, after things calm down. For now, I'm not even concerning myself with extra-curricular research, so my blog wouldn't be very exciting if I tried to update it accordingly.
Next

Calendar



