Raam Dev’s Weblog

Avatar

Life is an aftertaste. Drink up and wait for it...

  • Here is what my MacBook Pro desktop typically looks like while I’m working. All these programs running and I have 24% free memory and 60% free CPU. :)

    (0)

Water found on Mars, NASA scientists confirm

It looks like all those Sci-Fi books that talk about life on Mars are becoming more realistic. If there is one thing that never ceases to inspire awe, it’s life on Mars and the idea of standing on another planet exploring places where no other humans have stood (at least not in currently known history).

That feeling of awe is what I experienced when I saw this news headline this morning: Water found on Mars, Nasa scientist confirm.

Sure, there still isn’t one hundred percent scientific proof that water has been found on Mars, but the scientists feel sure enough to confirm it. They saw a white substance, which was present a few inches underneath the surface, “melt” away over the course of a few days. That confirmed the substance wasn’t salt or CO2 ice (CO2 ice would take hours, not days, to melt and salt wouldn’t melt at all). Of course there’s a chance that the substance isn’t water either, but something unknown to scientists. I hope not.

Finding water on Mars would swing the door wide open to future human trips to the planet and would make setting up a base on the planet a whole lot easier. One of the biggest problems with human space travel is the need to transport our water supply, something that is both heavy and very costly. Having a base on Mars with access to water would not only allow astronauts to explore Mars, but also use it as a refill station for other exploration.

I just hope that near-future space exploration is not hindered by other events on this planet. We seriously need to fix our energy problems (by fixing our political problems) and stop turning our only home into a dumpster. Recycle!

  • It’s difficult being vegan. Being vegan means you need to be willing to sacrifice. It means accepting the single vegan choice on a restaurant menu of fifty items and skipping a latte if they don’t offer a soy option. It means making it known to the world that you don’t eat meat when ordering an item you’re unsure about. It means always packing alternatives (ProBar, almonds, trail mix). It means having respect and care for what you put into the one and only machine you are truly responsible for maintaining. (1)
  • I’ve felt unusually tired this past week. I’m not sure if it has something to do with starting the new workout routine (Phase III) or if it’s because I caught something (if I’m working out regularly, I can get sick and not feel the symptoms as long as I keep working out). My eyes have also been unusually sensitive to bright sunlight and headaches have been more intense and widespread. (2)
  • Wow. That was an awesome workout! For the first time in months I actually had ton’s of energy from beginning to end. I pushed through every exercise and challenged myself with heavier than normal weights. I’m not sure if it’s the Zinc and Magnesium I started taking last week or the 5mg of creatine I started taking earlier this week — maybe a combination of both. Either way, I finally feel like I’m getting somewhere. I finally broke through that plateau! (0)

Case Sensitivity in Mac OS X

Case sensitivity in Mac OS X does not exist.

The OS X command line is probably the most commonly used feature of my MacBook Pro. I love the fact that almost all the Linux commands I’m used to using on a Linux box work the same way in OS X. So, as you can imagine, I was shocked when I couldn’t rename a simple directory:

eris:~ raam$ mv Downloads/ downloads/
mv: cannot move `Downloads' to a subdirectory of itself, `downloads/Downloads'

That command should allow me to rename ‘Downloads’ to ‘downloads’, but apparently OS X thinks ‘Downloads’ and ‘downloads’ are the same thing! That’s absurd! In the Unix world, case matters!

So how did I eventually rename it?

eris:~ raam$ mv Downloads/ downloads2/
eris:~ raam$ mv downloads2/ downloads/

That’s just ridiculous.

I installed the Fluxbox window manager on my MacBook Pro a while back and decided to start it up to make sure I had access to a “real” command line. Sure enough, the command worked as expected within Fluxbox. Maybe I’ll start using Fluxbox a lot more often.

Check out this snippet from an article on InformIT:

Mac OS X, like the classic Mac OS before it, is not case sensitive; it doesn’t care whether you said File1.txt or file1.txt. Only one of them can exist in a folder at the same time, and there’s no ambiguity for either computers or humans in telling which file you meant. Even Unix commands like ls will work if you give them filenames to operate on that don’t match the capitalization of the actual files (try it: ls /library).

That’s really quite disappointing. I have suddenly lost so much respect for the OS X command line. Being derived from BSD in the Unix world, you would think Apple would keep something as fundamental as case sensitivity in OS X.

The Real McCain

How does someone like this even get enough support to run for US presidency? Are there really that many stupid people in this country?

Wait, nevermind.

The Real McCain.

American soldier exposes US policy in Iraq

  • Until entire communities are willing to sacrifice individual comforts, a sustainable society based on renewables will cease to exist. (0)
  • I started taking supplements of Zinc and Magnesium today (100mg and 400mg respectively) after reading that vegans (especially body-building vegans) generally have Zinc and Magnesium deficiencies. It’s easy for me to notice the effect of slight changes to my diet (since I control my diet so well) and I’m really curious how the extra Zinc and Magnesium will affect my overall health. (1)

Apple’s home page not viewable in 1024×768

Apple's Site Requires 1280x1024

I do all my browsing with my web browser resized to 1024×768, mainly because I don’t need the window to take up the whole screen, but also because I like to see how compatible sites are with lower resolutions. As you can see from the screenshot above, Apple’s home page is not fully viewable in 1024×768.

According to Google Analytics, 30% of all the visitors to my blog are browsing with a screen resolution of 1024×768. I’m not alone: According to W3Schools 48% of their visitors are browsing their site with 1024×768.

Come on Apple, don’t lose sight of usability!

Syntax Highlighting Plugins

I’m getting sick of the iG:Syntax Hiliter bug that causes it to lose its configuration every time I do anything in the Plugins section. I also hate its proprietary syntax tags ([php] or [html]) because if someday the plugin author stops maintaining it and a newer version of WordPress breaks the plugin, I’m screwed (unless I wade through the code to fix it myself).

Here is what my code looks like whenever the plugin options are reset:

And here is what I want it to look like:

It makes so much more sense to use a plugin like Snippet Highlight which uses <pre> tags with CSS classes. The code for the plugin is dead simple, so maintaining it should be easy. Speaking of maintaining it, there’s a bug that causes Snippet Highlight to allow WordPress to parse HTML. I already notified the author, but if I have some free time this week I’m going to see if I can fix it.

I Use Twitter, But I’m Not a Twitter Shitter

Twitter is a service for friends, family, and co–workers to communicate and stay connected through the exchange of quick, frequent answers to one simple question: What are you doing?

I approach new services and tools the same way I approach a problem holding nothing but a roll of duct tape: How can I use that roll of duct tape to solve a problem?

Sure, Twitter has an intended use, but is there a law that forces people to limit themselves to that use? The hacker mentality is all about finding unconventional uses for existing things. I’m very anti-social. I have few friends. The friends that I do have are mostly like me and using a tool like Twitter to keep each other updated on what we’re doing would be pretty boring.

A recent comic on Penny Arcade about taking the Twitter question “What are you doing?” to an extreme gave me a good laugh. This morning David, my co-worker, told me that the blog post follow-up to the comic explained exactly the way he felt about Twitter. Here is an excerpt from that post:

The last “tweet” I ever did really explains it all, for me. I was up in Vancouver, and I put up a message saying so, and what kinds of activities I was engaged in. After I did it, I heard a voice - my own voice - saying, “Who the fuck do you think you are? Who are you that you can force your Goddamned minutia on other people, your stupid bullshit, your stone-ground artisanal condiments? How dare you. You should be ashamed.” And I was.

Excuse me, but what makes Twitter any different than a blog with an RSS feed?

The post length. That’s it.

I’m against spending time authoring content that ends up being scattered all around the net, inside different free services that I really have no control over. They could disappear at any given moment, erasing all of my written history, all that time. I’d rather not give that power to anyone. Not Facebook, not MySpace, and not Twitter.

The only reason I’m using Twitter is because I have a plugin that automatically turns my “tweets” into a blog post — not just a normal blog post, but one that is placed inside the Asides category so that it shows up specially formatted to make it clear that it’s not something worthy of an entire post. If Twitter disappears, big deal. I still have all my tweets saved in the database for my blog.

But why use Twitter at all? It’s simple. They provide an interface (SMS) that allows me to save my thoughts when they occur.

Quick, short thoughts. That’s what I use Twitter for. Once in awhile I’ll use it to say where I am or what I’m doing. If there happens to be someone following me on Twitter who’s interested in that information, all the better.

The “hundred and forty character cage”? I like it. Since my tweets show up on the front page of my blog, I need to think about the importance of the message. If taking a shit is of great importance to me, then I have bigger things to worry about than whether or not I should use Twitter.

s3delmany.sh - Delete Many S3 Objects With One Command

I’ve been doing some stuff at work using Amazon S3 to store files and during my testing I uploaded a ton of files that didn’t need to be there. Unfortunately, the command line tool I’m using, s3cmd, does not allow me to delete multiple files at once. There is no way to do a wild-card delete. This means I would need to get the full path to each object and delete them one by one:


./s3cmd del s3://s3.ekarma.net/img/1205794432gosD.jpg
Object s3://s3.ekarma.net/img/1205794432gosD.jpg deleted
./s3cmd del s3://s3.ekarma.net/img/1205794432g34fjd.jpg
Object s3://s3.ekarma.net/img/1205794432g34fjd.jpg deleted

Yea, there’s no way I’m doing that for over 200 objects. I mean come on, there are tools to automate this kind of stuff! So I created s3delmany.sh:

#!/bin/sh
# -------------------------
# s3delmany.sh
# Author: Raam Dev
#
# Accepts a list of S3 objects, strips everything
# except the column containing the objects,
# and runs the delete command on each object.
# -------------------------

# Redirect output to the screen
2>&1

# If not using s3cmd, change this to the delete command
DELCMD="./s3cmd del"

# If not using s3cmd, change $4 to match the column number
# that contains the full URL to the file.
# This basically strips the rest of the junk out so
# we end up with a list of S3 objects.
DLIST=`awk 'BEGIN { print "" } { print $4, "\t"} END { print ""}'`

# Now that we have a list of objects,
# we can delete each one by running the delete command.
for i in "$DLIST"; do $DELCMD $i
done

Download
s3delmany.zip

Installation
1. Extract s3delmany.zip (you can put it wherever, but I put it in the same directory as s3cmd).
2. Edit it with a text editor and make sure DELCMD is set correctly. If you’re not using s3cmd, change it to match the delete object command for that tool.
3. Make it executable: chmod 755 s3delmany.sh

Usage
If you’re using s3cmd and you placed s3delmany.sh in the /s3cmd/ directory, you should be able to use the script without modifying it. The script works by taking a list of objects and running the delete command on each one.

To pass s3delmany.sh a list of objects, you can run a command like this:

./s3cmd ls s3://s3.ekarma.net/img/ | ./s3delmany.sh

This will delete all objects under /img/. Make sure you know the output of your s3cmd ls command before you pass it to s3delmany.sh! There is no prompt asking if you’re sure you want to delete the list, so get it right the first time!

Hint: s3cmd doesn’t allow you do use wild-cards, but when you run the ls command, you can specify the beginning of an object name and it will only return objects starting with that. For example, s3cmd ls s3://s3.ekarma.net/img/DSC_, will return only those objects that begin with DSC_.

Alternate Usage
If you have a text file containing a list of S3 objects that you want to delete, you can simply change print $4 to print $1 and then do something like this:

cat list.txt | ./s3delmany.sh

By the way, print $4 simply tells s3delmany.sh that the S3 objects are in the 4th column of the data passed to it. The ./s3cmd ls command outputs a list and the object names are in the 4th column. The awk command expects the columns to be separated by tabs (\t).

If you have any questions or comments, please don’t hesitate to use the comment form below!

Every Little Bit Counts

I watched a great documentary tonight called The 11th Hour, produced and narrated by, of all people, Leonardo Dicaprio. It was definitely weird to see and hear him talk about something serious, but I suppose thats always the case when actors take non-acting positions on the screen. If you’re interested in watching the movie, there are plenty of ways to get it.

Despite it being very cold both at night and in the morning, I’ve had the heat off in my apartment for the past month. I didn’t turn it on even once. I did this mainly because the previous two months’ gas bills were over $250 and I simply couldn’t afford paying that much for heat. When I received this month’s bill, I was happy to see it under $150.

That’s when I realized how living without heat wasn’t all that bad. Sure, it was a little annoying, but it wasn’t cold enough to make me sick — I simply dressed warm. It never got below 45 degrees because the residual heat from the furnace in the basement (for the apartment above me) rose up and provided some heat to my first floor apartment. I saved a ton of money and helped the environment at the same time. All that by simply overcoming a minor inconvenience.

I keep all of my lights off in my apartment (there are seven rooms) except maybe one where I sit at my computer. I turn off all of my computer screens when they’re not being used and I unplug things like my multi-function printer until I need to use it. I have three computers and two routers running 24/7 and I turn on an electric space heater every now and then when my feet are cold. For the past three months my electric bill has not topped $50.

There are tons of more ways that I can reduce unnecessary energy expense and I will continue to look for new ways to reduce waste. Every little bit counts.