May 29 2008

Adding Swap Space to a Linux box

First make the swapfile (This example adds 256mb):

# dd if=/dev/zero of=/mnt/swapfile1 bs=1024 count=256k
# mkswap -c /mnt/swapfile1

Now attach the file to existing swap space:

# swapon /mnt/swapfile1

Bam! you’re done =)

.: Adam


May 29 2008

Sheesh…

This has to be one of the most expensive business trips I’ve ever taken. Here’s a run down:

- $80 for a new phone because I lost mine the night before I had to leave for San Francisco

- $50 movies to watch on the plane (7 hour plan ride)

- $40 cab ride to the airport (didn’t have any vouchers to give me, so I can’t expense it)

- $85 power cord for my mac (left mine at home)

- $10 razor (left mine at home)

- $100 new shoes (my only presentable pair were covered in mud from a weekend of paintball

- $55 jacket. It was way colder here than I was expecting and needed something to keep warm for walking around the city

- $10 taxi to get me to the place to buy the jacket on my lunch break

- $8 subway lunch (register was broke, so no receipt)

That’s it so far, but I still got 2 days left here =)

.: Adam


May 28 2008

Paintball to Memorialize

Last weekend, I went out to PA to do some paintball action with my friend Mike and some of his coworkers. On the way out, we stopped at Wendy’s for some dinner and saw a cool Sparta sign. So on the way back, we stopped and I snapped this shot of Mike and Hamal…

sparta.jpg

This still cracks me up when I look at it =)

.: Adam


May 28 2008

New Job

I have officially started my new position with IT Convergence as a Director of Identity Management Solutions. I see a lot of potential with this company and am really looking forward to what we can do together!

I think I’m going to start adding some IdM related material to this blog now that I’m doing more that engineering and architecture work. So if you’re in the Identity Management world, you may want to stay tuned =)

.: Adam


May 12 2008

The Fall

This is the latest film by Tarsem Singh, the director of The Cell. I saw this last night with my friend Nina (she’s from Finland =). It was amazing. Visually stunning like the cell, but not as over-the-top. The story line was much deeper and more captivating.

This is a movie for everyone!

Check out TheFallTheMovie.com for more photos trailers!

.: Adam


May 12 2008

Trick: Prevent Image Caching of Dynamic Images

For the longest time I’ve been struggling with an issue of browsers caching dynamic images that have the same name. Here’s my use case:

A user has a profile photo on their profile photo that’s called MyProfilePhoto.jpg. The user uploads a new image for their profile photo. When they load their profile page, the browser sees the request for MyProfilePhoto.jpg and just pulls from cache. But in reality, the image has changed. This causes the user to re-upload the photo and get super frustrated. The solution seems to be stupidly simple: Append a random querystring value.

So my new image source value is something like: MyProfilePhoto.jpg?r=1234

This causes the image to be reloaded every time the page is loaded. Another way that I’ve thought about attacking this and making it a little more controlled is to store a random value to the database when a new image is uploaded and just append that value to the querysting. This will ensure that the new image is always loaded, and that it will pull from cache until the image changes.

I’m just lazy, and don’t want to add more fields into my user tables =)

You can see this in effect on my profile page on bodymod.org. Just view the source of my profile image.

.: Adam