Hey OS X Lion, did you eat my Library folder?

Mac OS X Lion (10.7), introduced a bunch of new features to the Mac platform. At the same time it’s taken away some things that experienced Mac users are used to. The idea was to remove things that the average user doesn’t need.

If your like me, you might have yelled “Hey! Where is the Library folder in OS X Lion?”, when trying to access data from the iPhone simulator.

After doing some research, I found that the folder was not gone, it had simply been hidden. Running the following command from the terminal, I was able to make my Library folder visible once again.

chflags nohidden ~/Library/

You may also need to restart finder by using this command

killall Finder && open /System/Library/CoreServices/Finder.app

If for some strange reason you want to go back to being a n00b and hide the Library folder again, you can use the following command

chflags hidden ~/Library

Mac: Rename all files names in a directory to lower case

Just like my last post, I was working with a directory of about 1000 files. There were all sorts of problems with the way they were named. Anyone who is used a *nix type system will know that “.jpg”, “.Jpg”, “.JPG” are all very separate things. To solve the issue I was having I needed to rename all of the files in the directory to lowercase.

I fired up my friend the Mac terminal and ran the following command:

for i in *; do mv "$i" "$(echo $i|tr A-Z a-z)"; done

The code loops through each of the files in the current directory and renames it to the lowercase equivalent. fast, simple, elegant. Major time saver.

Mac: Converting a directory of images into JPG files

Recently I was presented with a problem where I had a directory of about 1000 graphic files of mixed formats (png, gif, bmp, jpg), and I needed to convert them all to jpg files.

I tried various solutions but I ended using the following command in my Mac’s terminal.

mkdir jpegs; sips -s format jpeg *.* --out jpgs

This command creates directory called “jpgs”, and converts all of the files in the current directory into .jpg format, and moves them into the newly created “jpgs” direcotry.

It truly saved the day.

Mac on my PC – LEO4ALL

In my last blog post I talked about how my computer had a system drive failure. I am waiting for Western Digital to send me a new 10,000 rpm drive to replace the broken one, so in the meantime, I thought I would screw around with trying to put Mac OS X on my desktop.

My friend Luis Majano is a great software developer and swears by his Mac Book Pro. At work I run Windows XP, at home it Windows Vista. I have Ubuntu on my laptop and run CentOS on my web servers, so I’m not a die hard about one OS or another, they all have their place.

I love Linux operating systems, so learning from Luis that Mac OS X sits on top of BSD made me more interested in switching (Apple don’t tell you that in their cute commercials). The price of Mac computers is insane though, and not something I’m blindly going to jump into.

So to the point… a broken PC a spare harddrive, and the want to try Mac OS X, whats a geek to do? A few google searches, and a torrent download later, I had in hand, Leo4All.

Leo4All is an awesome distribution of the hacked apple OS to run on none genuine apple hardware. They even have a great wiki (http://osx86leo4all.wikidot.com)

I dropped the DVD into my drive, booted up and a few minutes later I was in the OS X installer. Formatted the drive into an apple format, clicked install and 10 minutes later I was working inside of OS X! everything was there, even time machine! check out the screen shot below…

I had trouble with my network card, as OS X doesnt seem to like a lot of on-mother-board devices. I fixed that by powering down, and installing an old pci NIC. Booted back up and it was there!

I had no audio, but after a few minutes of googeling around, and following likes from the Leo4All wiki, I had it going.

I still havent had any luck getting my dual monitors to work. OS X doesnt seem to like nVidia cards with 512 megs of ram. Oh well, one monitor is fine with me for now.

The USB ports work, and recognize my iPod and iPhone just fine.

So it looks like I’m set. If the experience goes well, who knows, I just might become a switcher! If you know of some sweet mac software I need to try out, let me know.