External IP Address for Geektool
Posted onecho “External IP :” `curl -s http://checkip.dyndns.org | awk ‘{print $6}’ | sed “s/\(.*\)\<\/body\>\<\/html\>/\1/”`
echo “External IP :” `curl -s http://checkip.dyndns.org | awk ‘{print $6}’ | sed “s/\(.*\)\<\/body\>\<\/html\>/\1/”`
uptime | awk ‘{sub(“:”, “h “,$3); sub(“,”, “min”,$3); print “Uptime : “$3}’
To run a process in the background as a job and carry on working add an & (ampersand) at the end of the command line. For example: find /usr/man -name *.1 -print > sect1 & [1] 2548 The shell forks a child process to run the command and displays the job number ([n]) and the PID (Process […]
A MAC address is a unique identifier assigned to your network card, and some networks implement MAC address filtering as a method of security. Spoofing a MAC address can be desired for multiple reasons, and it is very easy to spoof your MAC address in both Mac OS X 10.4 and 10.5. For the purpose […]
Aperture describes an adjustable opening inside your camera lens that controls the amount of light striking the film. As the size of the aperture changes, the angle of light striking the film also changes. It is this angle change, much like eyeglasses change the angle of the light, that creates changes in depth of field. […]
By default Mac OS X’s Terminal application uses the Bash shell (Bourne Again SHell) but doesn’t have directory and file colour highlighting enabled to indicateresource types and permissions settings. Enabling directory and file colour highlighting requires that you open (or create)~/.bash_profile in your favourite text editor, add these contents: export CLICOLOR=1 export LSCOLORS=ExFxCxDxBxegedabagacad … save the file and open a new Terminal […]
Apple have no way of directly controlling Spaces from Applescript or from the command line so a little bit of slight of hand is needed. osascript -e ‘tell application “System Events” to keystroke “2” using control down’ This will Send a CTRL and 2 which will directly change to Space 2. If you use a […]
Using Screen Screen is started from the command line just like any other command: [admin@gigan admin]$ screen You may or may not get a text message about screen. If you do not, then you probably think nothing has happened, but it has. You are now inside of a window within screen. This functions just like […]
A little Automator action to Join PDF’s together Combine PDF
Here is a little app I knocked up to change the Apple Screenshot Format ScreenShot Changer
This hint basically does the same job as AP Grapher, but can be run from the command line or over SSH — so I was able to have someone else carry my MacBook Pro around the shed while I stayed near the wireless router and fiddled with its antennas. I ssh’d into my MacBook Pro […]
SSH Port Forwarding All too frequently, after people setup a firewall to protect themselves, they discover it sometimes keeps them out as well. There are several solutions to consider when this comes up: 1. Poke holes in the firewall with firewall rules (if the firewall is under your control). 2. Use a virtual private network […]
Launching Carbon applications with root privileges Older Carbon applications have to be run via LaunchCFMApp because they are in the wrong binary format for Mac OS X, so LaunchCFMApp handles the necessary translation. To launch a Carbon application directly (without using open), one has to actually run LaunchCFMApp, giving it the application as an argument: /System/Library/Frameworks/Carbon.framework/Versions/Current/Support/LaunchCFMApp […]
Just for reference so I dont forget, goto : /var/db/dslocal/nodes/Default/computers/ on the client and remove the plists Reboot the mac and the MCX settings will be gone 5836 Ravensbourne Network Design v1_0
There is a really nice app by Digital Rebellion that removes FCSvr, Final Cut Studio and a host of other apps and files. Check it out here. One thing I noticed is that the app does not remove the fcsvr local user. This is mentioned in Apple’s “best practices” document. sudo dscl localhost delete /Local/Default/Users/fcsvr
CocoaDialog is an excellent way of using OS looking Dialogs from the command line CocoaDialog Site
Making a Reference Movie from a Text File (XML) You can also create a .qtl reference movie by typing three lines of text using a text editor or word processor. Actually, you can copy and paste the first two lines because they’re always the same. The syntax may seem a little cryptic, but the process […]
Two useful flags you can specify when comparing files are -b (ignore blanks) and -i (ignore case). You can use them separately or in combination. The ignore blanks feature is especially useful when you’re comparing the source code for two programs, since indentation changes are rarely significant. For example, here’s how you might compare two program files, ur2cool.c and ur2cool.backup: diff […]