Fast user switching via commandline

This is quite an undocumented feature, here is how it works:

Show login screen (without logging out):

# Show the login screen (without logging out)
# From:

/System/Library/CoreServices/Menu\ Extras/ -suspend

Switch current user (replace 501 with the correct UID):

# Switch to another user without logging out - replace 501 with the uid of the user you switch to
# From:

/System/Library/CoreServices/Menu\ Extras/ -switchToUserID 501

Finder / Toggle visibility of hidden files

Via Shell this way:

# Toggle Finder showing hidden files
# From:

value=`defaults read AppleShowAllFiles`
if [ $value == "TRUE" ]
  defaults write AppleShowAllFiles FALSE
  defaults write AppleShowAllFiles TRUE
killall Finder
exit 0

System wide key remapping

When editing text or code it is quite often very useful to jump to the beginning or the end of a line, or to move the cursor one page up or down..
Unfortunately the keys dedicated to this task (home/end/pageup/pagedown on a windows-pc) have got a different meaning on a mac: Page up/down scroll one page up/down – without moving the caret (cursor), home/end move to the beginning/end of a document – also without moving the insertion point.

Continue reading “System wide key remapping”

Now using a blog

This should be more convenient to read and (for me) to publish – all content will be migrated to wordpress the next days. First at all the theme needs to be updated.

CSS selector according to language

To handle multiple languages on one page, it’s best practice to use the lang(xml:lang)-tag. These can be selected via CSS. (Doesn’t work in IE 6, of course.)
<code lang="html">
<span lang="en" xml:lang="en">this is english..</span>
<span lang="en" xml:lang="de">hier ist deutsche Texte..…</span>

<code lang="css">
p[lang="de"] { color: green; /* whatever */}
p[lang="en"] { color: red; /* whatever */}

Safari and friend IE

The same page viewed with Safari (Mac), IE 7 and IE 6 – for IE 6 the css hacks used have been disabled to see everything in its full glory. Notice the interesting placement of the right box.

Click on an image and use the arrow keys to flip through: