Never been to TextSnippets before?

Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world (or not, you can keep them private!)

About this user

« Newer Snippets
Older Snippets »
8 total  XML / RSS feed 

macbook hibernate mode

// description of your code here

Old school sleep, ram can be lost, no sleepimage, but fast
sudo pmset -a hibernatemode 0


You can delete sleepimage with sudo after setting 0


Full hibernate, ram goes to /var/vm/sleepimage
sudo pmset -a hibernatemode 3


sleep mode apple macbook pro

To avoid sleep/wakeup problems, always:

UNPLUG BEFORE CLOSING LID

and when waking up

OPEN LID AND WAKING BEFORE PLUGGING IN

Pretty fucked up system Apple has for their safe sleep.

stop Apple Tiger dashboard advisory daemon

Useless daemon tries to contact Apple to make sure widgets installed in Dashboard are the right version (the fuck?)

udo mv /System/Library/LaunchDaemons/com.apple.dashboard.advisory.fetch.plist /System/Library/

bash terminal profile

// description of your code here

export PATH=/opt/local/bin:/opt/local/sbin:$PATH
export DISPLAY=:0.0
export EDITOR=/usr/bin/vim
case $TERM in
xterm* | aterm | rxvt | screen )
XTITLE="\[\e]0;\u (\w)\a\]" ;;
* )
XTITLE="" ;;
esac
PS1="$XTITLE""[\u:\w]\n\\$ "
. /etc/aliases_bash

prevent .DS_Store files being created everywhere by OS X

// description of your code here

defaults write com.apple.desktopservices DSDontWriteNetworkStores true

add mysql symbolic link to OS X MacPorts installed mysql

instead of having to type out mysql5 each time I want to run mysql, make a symbolic link to mysql5

ln -s ../lib/mysql5/bin/mysql /opt/local/bin/mysql

mysql on OS X

mysql installed via ports by default resides in

/opt/local/share/mysql5/mysql


from this location you can start/stop mysql with the following

./mysql.server stop
./mysql.server start


to have a my.cnf file to edit

sudo cp my-small.cnf my.cnf

Customizing OS X keyboard

In order to change the mapping of the keyboard in OS X you must use Ukelele or a similar program to create a keylayout XML file in ~/Library/Keyboard Layouts. Once this file is created, it is available for use via System Preferences -> International -> Input Menu -> check the keyboards you want available for use.

Within Ukelele goto File -> New -> Copy of other keyboard layout -> (Within Finder) Macintosh HD/[Ukelele install dir]/System Keyboards/Roman/French.keylayout

Now you should see a basic layout of the keyboard. Pressing control keys such as alt and ctrl should show a different set of characters on the same keyboard. Note that the Windows key is the Apple key.

Open up the Character map (also found within Internation/Input Menu and activated via the same drop down as the keyboards in the top bar) and click and drag characters where you want them active on the keyboard. When finished with the layout, save the file, something with extension keylayout and put it within ~/Library/Keyboard Layouts. Logout and log back in and use the Input Menu to search for the keyboard you just named and highlight its checkbox. The keyboard should now be available from the top bar drop down menu. In some cases you may have to rename the layout file and logout/login for the changes to take effect.
« Newer Snippets
Older Snippets »
8 total  XML / RSS feed