"hello world"
article in Tech linux-unix-and-friends

Mac / MacOS / MacOSX - A Unix that you can let your kids use.

So it has been awhile since I last used a Apple. In fact, some of the last times I remember being on a mac involved developing hypercard stacks for my elementary school. Hypercards were pre-html html, you had a set of cards, and you linked them together with scripting, displayed images and text, etc. It was pretty amazing stuff back in the day. This was on the Machintosh. You know, after the Apple IIe.

Anyways, enough history.

I just bought a new iMac 20" Intel dual core. oy am I happy. I've been away for so long! Now the OS is based on bsd so I feel right at home.

The thing that attracts me most to the new macs is that they can run all the great software I've been using on my Linux and Unix machines over the years. gcc,makefiles,grep,ssh,wget,etc,etc

put macosx to sleep

press the option-command-eject buttons.

disable an external monitor without unplugging it?

Eun/DisableMonitor - Easily disable or enable a monitor on your Mac.

PDF printer on the mac.

Looks like it is nice and easy to add a PDF printer to MacOSX. MacOSX includes CUPS. Nice!
codepoetry - CUPS-PDF Package for Mac OS X

Setup network sharing with Bonjour

Have you ever needed to get to a machine that you know is on the same local network but don't know its IP? Bonjour allows you to find computers by name on your network without having to look it up or setup DNS. Instead, just add .local to your hostname and you are set! Very neat.

About Bonjour Bonjour, also known as zero-configuration networking, enables automatic discovery of computers, devices, and services on IP networks. Bonjour uses industry standard IP protocols to allow devices to automatically discover each other without the need to enter IP addresses or configure DNS servers.

"Bonjour is a networking protocol that sends and receives network packets on UDP port 5353. If you have a firewall enabled, you will need to ensure that UDP port 5353 is open for Bonjour to work correctly. Certain firewalls will only partially block Bonjour packets, so if you experience intermittent behavior, check the firewall settings and verify that Bonjour is listed as an exception and is allowed to receive incoming packets. Bonjour will configure the Windows firewall appropriately during installation on Windows XP Service Pack 2 and above." -- [Bonjour for Windows 1.0.3]
Bonjour for Windows - O'Reilly ONLamp Blog

Developers can download the Bonjour SDK to add Bonjour technology to their applications. For more information about developing products that use Bonjour, and to download the SDK, please visit .


Screen savers

mikeash.com: ChemicalBurn - ChemicalBurn is a screensaver that simulates a transportation network. Packages are generated with a destination, and attempt to find the fastest way there. Frequently used routes get faster, making them more popular. The result is a beautiful self-organizing network colorfully displayed on your screen.

Some resources I've found

Mac OS X Internals: A Systems Approach
MacBook motion sensor malarkey gets useful
Version Tracker for MacOSX
rEFIt - An EFI Boot Menu and Toolkit - rEFIt is a boot menu and maintenance toolkit for EFI-based machines


Key mappings on the mac

Mac Tip: Access the Dock and Menu Bar from Your Keyboard
Dan Rodney - Mac OS X Keyboard Shortcuts
I know this seems like a silly thing to be annoyed about...but some keys don't work the same on the Mac as they do on Win machines. For instance, "home" and "end" keys on Win machines move you to the start and end of your current textbox. On the Mac, "home" and "end" are used to scroll you to the top and bottom of your current document. (this can be really annoying if you are trying to select all the text in your textbox by holding "shift" and hitting "home").

The solution to this is to use "Apple-A" to select all the text, then hit the left arrow. Or you can use the Win equivalent "Apple-Leftarrow" and "Apple-Rightarrow" to move "home" and "end" respectively.

It is funny what can annoy you when switching to a new platform.


Help, my mac mouse won't work

Could be that you have Mouse Keys enabled. To disable hit the "Option" key five times to toggle Mouse Keys

Open an app from terminal

open -a "Activity Monitor"

Get a root account in your terminal



File sharing with windows

First off you need to turn sharing on by doing the following
  1. Open System Preferences and click Sharing and, if necessary, click Services.
  2. Select Windows Sharing in the list, then click Start.
  3. Click Accounts and select the name of the user account that will share files. Enter the password for that user.
  4. Look below the services list for your computer's network address. Give this address to Windows users.
The above will allow other windows machines to access your mac home directory. If you'd like to setup sharing of volumes and other folders, do the following:
Install SharePoints
Remember that NTFS is read only! 10.4: An overview of NTFS support in Tiger


package managers on MacOSX

The state of package management on Mac OS X | On the lambda - great article from Tony Fischetti (@tonyfischetti).
Rudix! - Rudix is a collection of pre-built Unix software delivered as packages for OS X: “The hassle-free way to get Unix programs on OS X. (python; binary only - /usr/local)
The MacPorts Project -- Home - system for compiling, installing, and upgrading either command-line, X11 or Aqua based open-source software on the OS X operating system. (tcl; source - /opt/local)
Fink - Home - (perl; both bin|source - /sw
Homebrew — The missing package manager for OS X - Homebrew installs the stuff you need that Apple didn’t. (ruby; src|bottle bins - /usr/local/Cellar with symlinks to /usr/local/bin)
pkgin, a binary package manager for pkgsrc - pkgin is aimed at being an apt / yum like tool for managing pkgsrc binary packages. (C; /usr/pkg)
pkgsrc - pkgsrc is a framework for building third-party software (C; /usr/pkgsrc)


FINK - More unix like ENV for MacOS using fink

Fink is a project that brings tools like dselect and apt-get to Darwin and MacOS X.

If you know how to use dselect or apt-get, then you'll know how to use fink.

All the software packages that fink installs goes into the /sw/ directory. If you need to uninstall simply:
rm -rf /sw/

To setup fink to install unstable packages, you need to add "unstable/main" and "unstable/crypto" to the "Trees:" line.
This what what my line looks like:
Trees: local/main stable/main stable/crypto unstable/main unstable/crypto
vi /sw/etc/fink.conf;
fink selfupdate; fink index; fink scanpackages
You can also just run "fink configure", which will ask you a question to add unstable.

To list the files installed by a package use dpkg.
dpkg -L packagename

Remote desktop

Remote desktop or RDP is something I really want.
Windows RDP client for mac

Why Apple Makes a One Buttoned Mouse
Eek! A Two-Button Mac Mouse?
http://www.macosxhints.com/
StuffIt Standard 11.0 icon
Chick of the VNC
Open source software for the mac

Audio tools

Switching audio devices should be a one or two click thing in every OS. I have to install special apps on all my OS's to provide this functionality...

For device selection checkout the free SoundSource utility.
AppleScript Audio Output Switcher
Soundflower - Free Inter-application Audio Routing Utility for Mac OS X
FlickrBooth - a plugin to upload photos to Flickr right from photobooth.
Mac OS X Packages - Subversion - fink's svn client doesn't include ssl support. These packages work for me. You will also need to make sure /usr/local/bin is in your path after install.


Upgrading autoconf and automake on MacOSX

For some reason, Mac OS X 10.4.9 distributed with autoconf 2.59, automake 1.6.3. I was surprised to see that the old versions were included...autoconf/automake had better versions available at the time of packaging for MacOSX 10.4. At least fink makes it easy to upgrade these nice tools. I wouldn't try downloading and installing the packages from source. I've made that mistake.
% fink selfupdate
(update package descriptions, re-index)
% fink install automake1.9
(gets you automake 1.9.6)
% fink install libtool14
(gets you GNU libtool 1.5.22)
% fink install autoconf
(gets you autoconf 2.60) 
This information was nabbed from autotools on mac os x
The MacPorts Wiki


add paths to environment in macosx

There is a file /etc/paths which is a fine place to add new global paths. Additionally there is /etc/paths.d/ which is just like /etc/paths but you add single files which are added to the env.
Another option is ~/.profile || ~/.bash_profile (user specific) or /etc/profile (global) by using export. these of course affect the shell/terminal
osx - Set environment variables on Mac OS X Lion - Stack Overflow

Copy path to clipboard

On windows, I've found a shell extension which allows you to select a file(s) and copy the full path to the clipboard. This comes in handy all the time for developers as we are working with files all the time.
So now, off to find a way to do it in mac...
Drag the file into Terminal and it automatically puts the path in your Terminal window.
Writing Contextual Menu Plugins for OS X, part 1
FileUtilsCM
FileXaminer

Python on the mac

Using fink makes it painless to install python and some popular python libraries.
# as always it is nice to update fink (things work better that way)
fink selfupdate
fink update-all
fink install scipy-py25
fink install matplotlib-py25
fink install pygame-py25
fink install ipython-py25
# create this link to make python2.5 the default python on the cmdline.
sudo ln -s /sw/bin/python2.5 /sw/bin/python

Configuring and Running X11 Applications on Mac OS X
MacDailyNews - Lock your Mac OS X screen from the menu bar by adding lock icon
Macworld: Mac OS X Hints: Quickly lock your screen


Filesystems on the mac

On a mac, writing to NTFS is not available out of the box in 10.4. Instead, we can install MacFuse and use NTFS-3G to obtain write access.
How-to: Read and Write NTFS Windows Partition on Mac OS X - lifehack.org
macfuse - implements a mechanism that makes it possible to implement a fully functional file system in a user-space program on Mac OS X.
NTFS-3G: Stable Read/Write NTFS Driver


MPlayer - The Movie Player - a very good open source cross-platform video player! Great for MacOSX.

I thought it was pretty neat that you can drag and drop colors to set your Terminal background.
Macworld: Mac OS X Hints: Set Terminal color via drag and drop


DittyBot - An Applescript Adventure at Plastic Bugs


iShowU - a nice screen cap program for the mac, $20 bucks.

Ctrl-Click on app, "Show package contents" gets you into the packaging directory for an app.

Chmox - a Mac OS X CHM viewer


Cocoa for Windows + Flash Killer = SproutCore — RoughlyDrafted Magazine


Applescript programming

AppleScript Language Guide: Introduction to AppleScript Language Guide


Cool utilities and apps for the mac

iTerm - iTerm is a great terminal for MacOSX. It provides a nice tabbed interface...emulation is also a bit better than Terminal.
coconut-flavour.com - [coconutBattery 2.6.5] - this app can tell you about the load cycles, age, and capacity of your battery. (current battery mAh and original battery mAh) Very neat....shows me just how bad my battery has become...
Transmission - is a fast, easy, and free multi-platform BitTorrent client.
InsomniaX - allows you to turn off sleep/hibernate on your macbook when you close the lid.
GIMP on OS X - GIMP goodness on MacOSX


How to Clone Mac OS X to a New Hard Drive done using SuperDuper!, cool cloning is free!


git on the mac

It would be nice if git were included on the base install....
Anyways, I've used the git-osx-installer - Google Code before with success. It also includes a finder plugin for launching git-gui. OpenInGitGui - git-osx-installer - Google Code.


compare two folders on mac

FileMerge is a tool within the Apple Developer Tools. In /Developer/Applications/Utilities...or use spotlight to start it... Shows differences between files/folders on MacOSX.

Homebrew - brew for mac

brew is another package manager, written in Ruby. The preference is to install it into /usr/local. I have used it to install git and other code before with success. I like what I see.
Check it, install brew:
curl -Lsf http://github.com/mxcl/homebrew/tarball/master | sudo tar xvz --strip 1 -C/usr/local
Homebrew — MacPorts driving you to drink? Try Homebrew!
Homebrew: OS X’s Missing Package Manager | Engine Yard Ruby on Rails Blog


Re-map HOME END keys on Mac OS

Edit ~/Library/KeyBindings/DefaultKeyBinding.dict:
"\UF729"  = "moveToBeginningOfLine:";                   /* Home         */
"\UF72B"  = "moveToEndOfLine:";                         /* End          */
"$\UF729" = "moveToBeginningOfLineAndModifySelection:"; /* Shift + Home */
"$\UF72B" = "moveToEndOfLineAndModifySelection:";       /* Shift + End  */
Low Level Manager: OSX + remote vim clipboard sync


unpair mac wireless keyboard

first off; lets just mention that if you have access to the original mac; it is best to just "system preferences","bluetooth"; "turn bluetooth off" or actually unpair from the devices.
How to UNpair keyboard without original computer | Apple Support Communities - apparently com.apple.bluetooth.plist might be a goto place to look..


Use Apple Trackoad from Windows 10

ExtraMagic :: Download - which leads you to download the stock magic trackpad drivers which you can use without actually installing the extramagic driver.
Google Code Archive - Long-term storage for Google Code Project Hosting. - download stock magic trackpad driver from apple (not really from apple, google code, might be better to unpack the files from bootcamp installer).


Apple Magic Mouse on Windows 10

How To: Use the Apple Magic Mouse on Windows 7 - describes the whole process of extracting the bootcampupdate.exe using 7zip, then extracting the msp file, then finding the suitable driver Binary.MultiTouchMouse_Bin or Binary.MultiTP_Bin and extracting to Binary, run DPInst.exe
Boot Camp Software Update 3.1 for Windows 64 bit

Apple Trackpad - Magic Trackpad - unpair from device - trackpad reset

I am a fan of the Magic Trackpad, but for all the intuitive user oriented design Apple puts into products; pairing and unpairing isn't straight forward. But I have to say that pretty much every keyboard or mouse is similarly unclear about how to unpair...pair information should be printed on the device. including default pin. If you cared, maybe some braille.

I myself, like unnatural scrolling with the trackpad. To each his own;I guess up=up&down=down is !Natural.
Ctrl-Click is right click, of course. Two finger tap is right click on Magic Trackpad by default... easy enough to use sys prefs to configure other "Secondary tap"s for 3 and 4 finger tapping magic.

magic trackpad unpair from device
1. Hold down the power button on the Magic Trackpad for 5 seconds until it turns off.
2. Hold down the power button on the Magic Trackpad for another 5 seconds until the light starts flashing... KEEP THE BUTTON HELD DOWN WHILE YOU TRY TO PAIR. The button hold will prevent the Magic Trackpad from pairing with the prior device. Apparently even if you have unpaired the device from the original prior to initiating pairing; hold down the button on the track pad while you complete the pairing.
a1339 pairing
make sure you have some good batteries!

padset - Configure Apple Trackpad devices on a PC without BootCamp - Google Project Hosting


magic mouse expose

the magic mouse is pretty magic; but it doesn't include gesture support for expose like the touch pad does. which is sad, because three finger up is much better than using hot corners... MagicPrefs - provides the awesome three finger up gesture for "Mission Control"


Troublesome large display resolutions in macosx || get 2560x1080 in macosx

windows 8.1 will recognize my LG ULTRAWIDE 2560x1080 over HDMI. I couldn't get this to work on my miniMac. Instead I bought a mini-dp to dp cable and that still didn't seem to like the max resolution of 2560x1080 instead it gave me something like 2560x864 which isn't fun. So I sent searching...people talking about using SwitchResX, but I really didn't want to have to run that to make my monitor work. I found some people were having success with forcing profiles on the monitor, apparently macOS is prone to mis-associating large screens with tv output... running ruby patch-edid.rb and moving the needed profile into the /System/Library/Displays/Overrides; reboot; It's says "force RGB mode (EDID override)" now in System Preferences->Displays. now working! (wonder if I needed that special DP cable after all!)
Force RGB mode in Mac OS X to fix the picture quality of an external monitor | i reckon
How to display 2560x1080 on external monitor fr... | Apple Support Communities
i did find that I had to redo the process when upgrading to OSX Yosemite. I found that I needed to actually manually delete the override and copy the override using finder. (doing a sudo cp did not work after multiple attempts rebooting) I did notice that the display showed override in the title before rebooting, and finally worked when it had done so.
/System/Library/Displays/Contents/Resources/Overrides is the new location for Sierra. csrutil disable to write to /System.
macos - How do I disable System Integrity Protection (SIP) AKA "rootless" on OS X 10.11, El Capitan? - Ask Different


AirPort Base Station - AirPort Express

AirPort Utility 6.3.1 for Mac
Created: 2006-05-19 16:28:36 Modified: 2017-09-28 02:23:01
/root sections/
>peach custard pie
>linux
>windows
>programming
>random tech
>science
>research


moon and stars



My brain

Visible Dave Project



L:0 I:0 A:0