Steve Jobs

Today is the day Steve Jobs passed away.

When I was a kid, hi-tech gadgets in movies amaze me.
The fact that it’s fictional, disappoints me.

Thanks to his vision and Apple, I get to enjoy a “futuristic” life while I’m still alive. The things they do should be the standard to be called innovation.

Light and powerful computers with a pretty user-interface.

A touch phone that reminds me of my schedule, communicate, stay up to date with the news, write notes, listen to music or watch a video. All this while on the move.

These 2 gadgets have become an important part of my life. Helping me to stay organized, learn new things, and earn some income.

A part of me feels that Apple will no longer be as innovative as when Steve Jobs was still around. Another, hopes that I’m wrong.

And I do hope I’m wrong.

MacBook Air, 2 months later

It’s been 2 months since I’ve started using MacBook Air for development work.

I have not found a reason to dislike it so far.

If I really have to squeeze some out, it would be Firefox. But that is probably not Apple’s fault. (Firefox 6 hangs when I try to browse my history and other random moments). Or when you go into time machine mode, it slows down maybe because of the space effects in the background.

With SSD, everything works very fast. Startup, shutdown. Starting up software, etc.

With a 7-hour long battery life, it’s long enough for me to keep working until I’m satisfied. On my previous laptop, I had just a bit more coding to do but forced to stop because of low battery after 2 hours.

Thanks to the long battery life, I stopped shutting down. Just close the lid and next day, resume from where I stopped.

The keys are comfortable to type on. The touchpad is more sensitive than most other laptops I’ve worked with. The gestures are handy.

Love the thin size, light weight and aluminium body. Makes it amazing how they can pack 7 hours of battery life into such thin space.

Best of all, you don’t have to worry about device drivers. Apple has them all covered.

On Windows, I would have to go to every website of every device on my PC/laptop and download the latest drivers, BIOS/firmware for them if I want the best performance or bug fixes. On a Mac, the “Software Update” program will handle everything.

My previous laptop seems to have a bluetooth problem. After I updated the BIOS, it stopped booting up and Dell had to send someone down to replace the motherboard. Another problem is the USB port. It becomes ultra slow when you try to transfer a large file to a portable harddisk. I’m sure it’s not a power issue.

But it’s just 2 months. Let’s see if I can find any more problems with it.

A good use of your phone’s camera

In my many years of dabbling with computers, one good idea I’ve come up with is to take photos of your hardware.

Because you might be browsing for a new sound card at the stores but can’t remember if you have any available PCI slot to use.

You might come across an article one day that claims that a batch of SSDs are faulty, and you end up having to open up your PC to find out the serial number of your SSD to see if you’re affected.

Keep them stored on your phone and dropbox so it’s easily accessible.

A folder of links to your hardware’s details on their manufacturer’s website is useful to keep too. So you can easily check for any new BIOS updates or look up specs.

Digital copies of receipts and warranties too!

In case something spoils and you want to know as soon as possible if it’s still covered under warranty.

And to save yourself from turning your house upside down to find the receipt of your purchase made years ago, always keep them securely together in a folder at a fixed location.

Never thought I would ever use a Mac…

… but their latest Lion OS has me convinced that they’re worth considering.

I named it Prishe. Still looking for a pretty wallpaper of Prishe!

Not to mention my current laptop’s weight is beginning to annoy me. Maybe I’m getting old and weak D:

And this runs on SSD too! With up to 7 hours of battery life!

My current Dell m301z laptop boasts of 5 hours of battery life but the most I could ever squeeze out of it is 2.5 hours.

I once tried to update the BIOS for m301z and it resulted in an unbootable laptop. I had to go through a long phonecall and process before they would send someone down to me and replace the motherboard.

There’s a problem transferring data to my portable USB harddisk, it slows down to a crawl. I’m afraid of updating to the latest BIOS because of what happened.

Then recently, I started exploring the Linux world and found it pretty productive.

Things like running find and sed as a single command (piping) to search and replace text in a config file for 20+ websites.

Using grep to search for .php files infected with malicious iframe scripts.

And since Mac OS X is built on Linux, why not get one in order to learn more command line stuff?

It’s a good thing I waited till Lion got released. Because back then when I wanted to get a MacBook Air, there wasn’t any mention of a new series using the i5 CPUs.

So when the new i5 MacBook Airs started going on sale in Apple’s online store for Singapore, I snapped one up immediately.

When the DHL guy delivered it to me, I opened the box, took out the actual MacBook Air box and held it high with my left hand and played the Zelda “item get” / “item fanfare” sound from my phone with my right hand. It just had to be done.

I’ll post an update again after a few months of use.

Search and Replace in SSH

Getting a lot of exposure in Linux environments lately.

Used “top” to see running processes, “tail -f access_log” to watch accesses to my websites. Updated the iptable to block access from a specific IP address that’s been making requests to wpad.dat on one of my servers.

And now, running a long command to update the MySQL username and password details in .php files for a website with many subdomains.

I don’t have the patience to go through every subdomain in an FTP client to update those details so I googled a bit and requested root access to the server and ran:

find . -name \*.php -type f -exec sed -i ‘s/\$MYSQL_PASSWORD = \”oldpassword\”/\$MYSQL_PASSWORD = \”newpassword\”/g’ {} +

It’s probably not the best way but it’s the only way I can find at the moment.

What it does is to go through all files and folders, and their subfolders in the current directory (I’ve already navigated my way to the www/ dir), look for files with the .php extension, and execute the sed command on those files.

The sed command then looks for the string $MYSQL_PASSWORD = “oldpassword” and replaces it with the new string $MYSQL_PASSWORD = “newpassword”. I could omit the $MYSQL_PASSWORD string but the previous person in charge had used the same string for the username and password.

The first time I ran the command to update the username, I did not specify a file extension and the command took about 10 minutes to finish. It was then I found out that there were log files that are about 1.6GBs in size.

The second time I ran it, I specified .php and it finished in less than a minute.

That was fun.