Posted: September 9th, 2009 | Author:Jerod | Filed under:OS X | Comments
OS X’s built-in System Profiler provides a great graphical display of pretty much anything you’ll want to know about your Mac.
That’s cool and all, but what if you want to access that information programmatically? Turns out you can also run the System Profiler from the terminal by executing this command:
jerod@mbp:~$ /usr/sbin/system_profiler
What’s great about this access method is that it allows you to slurp that data into any other program and have your way with it! For instance, I wanted to track my new battery’s cycle count and charge capacity over time. Why? I dunno, because I’m a geek, okay, get off my back!… Anyways, with the system_profiler command I simply run this little Ruby script every day:
Ruby uses the (possibly familiar) backticks (line 3) to capture output from a shell command. All that was left for me to do was to parse the raw data and save it to a CSV file.
Finally, note that the my script is passing SPPowerDataType as an argument which narrows down the returned results. You can learn more about how to use the system_profiler command by readings its manual. Just:
Looks like I’m not the only one who hates Snow Leopard’s blue ring around selected windows in Exposé.
Thankfully, we don’t have to live with such monstrosities. Here’s a quick fix to free yourself from the blue haze. Fire up Terminal.app, then:
1
2
3
4
cd /System/Library/CoreServices/Dock.app/Contents/Resources/
sudo mv expose-window-selection-big.png expose-window-selection-big.ugly
sudo mv expose-window-selection-small.png expose-window-selection-small.ugly
sudo killall Dock
This will disable the blue rings altogether, but you may want to replace these two images with some custom ones that look a little cooler instead.
Let me know via the comments or on Twitter if you find some replacement images!
***UPDATE***
My friend Doug provided some drop-in replacement images that are a huge improvement. Just drop them into the directory after renaming the default images. So after step #3 above, do:
4
open .
This will open Finder in the current directory. Now drag the replacement images into this directory, provide your password, and kill the Dock.
OS X ships with PHP5 installed but it does not have readline() support compiled in. Anybody using PHP from the command-line will want this, as it allows handy things such as tab completion and scrolling through command history using the up arrow.
Thankfully, MacPorts has a readline variant that can be easily installed:
sudo port install php5 +readline
If you execute the command above, apache2 will come along for the ride because it’s a default variant for the PHP5 port. If you don’t want apache2 (OS X ships with apache2 anyways), modify the command to look like this:
sudo port install php5 -apache2 +readline
Not sure if your PHP install has readline support? Execute this one-liner to find out:
I don’t like FTP. Reasons abound, but to list a couple:
Too complex to configure
Insecure by default
But lets face it, sometimes you need to set up a quick and dirty FTP server for one-time use. Sure, OS X supports FTP file sharing natively but its a bit clunky because you have to either A) allow Anonymous access, or B) create a user account on your system and set up sharing on it. Lame.
There are many freeware,and shareware FTP clients but not too many servers. After a cursory review of all the offerings on IUseThis, I settled on PureFTPd Manager which is a free and open-source front-end for PureFTPd…and what a great choice I made.
Why does this app rock my socks off?
Dead simple configuration – nice GUI walks you through everything
Virtual users – one new system account and endless virtual users it can represent