Reading man pages in Preview.app

This is a neat little command line to open man pages in Preview.app:

man -t bash | open -f -a /Applications/Preview.app

In fact its converting it to a PDF file. I just tried it and its a lot better to read and search than in the Terminal.app.

Found on bitfever.de

MacPorts Quicky

If you ever wanted to know what ports are actually available through MacPorts check out their trac site at http://trac.macosforge.org/projects/macports/browser/trunk/dports

That’s it for now.

Safari for Windows supports color profiles and remote execution

The good news is that Safari for Windows also supports color profiles which is a feature that no other browser has. This is really cool because when you post a picture to the internet, lets say with you cameras color profile attached, it looks very different than in Photoshop. This is because all the other browsers don’t understand those profiles and take sRGB as the default color space.

The bad news is that Safari for Windows already has a 0-Day Exploit. In fact it was posted only two hours after it was available. Personally, I don’t think it is that bad because Apple needs to have some training lessons in terms of secure code and dealing with exploits. I’m very curious how Apple will adopt to the new Windows user base which is a lot more experienced or even interested in finding such security issues.

Continue reading

Great Stuff, being able to type utf-8 characters in a Terminal on OS X!

I know what you are thinking: »Those poor OS X users with their mutilated unix user land. I wrote about the ancient version of locate that OS X ships with, now this also applies to the standard shell, bash. OS X ships with version GNU bash, version 2.05b.0(1)-release, which just like locate has poor or non UTF-8 support. If you start typing characters like ä, ü or ö you get everything but that. You can’t search for them and so on. Seriously, this is so weak but again, you can help yourself with MacPorts. I found this article on the web, describing the steps nessecary for enabling UTF-8 in Terminal.app, iTerm and X11 Term. For the sake of redundant information storage I’ll give you the management summary for Terminal.app.

  1. Use MacPorts to install the latest version of bash: sudo port -c install bash (-c is for autoclean mode)
  2. Edit /etc/shells and add the path to the new version of bash which is /opt/local/bin/bash
  3. Edit ~/.profile and add the following lines:
    export LC_ALL=de_DE.UTF-8
    export LANG=de_DE.UTF-8

    This adds support for german utf-8 characters. Use locale -a to find your favorite language code.
  4. Run chsh and change the path of the shell to /opt/local/bin/bash
  5. Open the window settings, select Display and make sure the drop-down at the bottom is set to UTF-8 and make sure Wide Glyphs are enabled too. Then click the »Use Settings as default« button.
  6. Restart Terminal.app – Tada.wav
  7. If it doesn’t work open the Terminal.app preferences and see if you manually set the shell path, if so change it to to /opt/local/bin or switch back to the default login shell

Now if you want to have UTF-8 support in locate and all the other tools as well, you have to read my previous post about findutils and coreutils.

Afterwards you are able to do things like this and feel less handicapped.

:~ $ touch äüö
:~ $ ls äüö
äüö
:~ $ rm äüö
:~ $

Getting proper unix user land tools on os x

Personally, I think the Mac OS X unix userland is rotten. There are apple tools mixed with some current unix tools and there are outdated unix tools like locate. Maybe you didn’t even notice that but locate for example doesn’t even know the -i option for case insensitive lookups in the locate.datbase. As usual, you can help yourself with MacPorts. Simply install the GNU coreutils and findutils. For convenience provide the +with_default_names option. If you don’t add this option you get glocate instead of locate and so on. Now the new locate can’t find anything unless you run updatedb from /opt/local/bin/updatedb. After that everything should be fine. Checkout what tools are included in coreutils and findutils by clicking on the equivalent hyperlinks. This resolves the weird behavior of tools on OS X that you might expect to work like on your FreeBSD or Linux machines.

Install coreutils (the -c option is equivalent to sudo port clean portname):

sudo port -c install coreutils +with_default_names
sudo port -c install findutils +with_default_names

Locate before the installation:

man locate
LOCATE(1) BSD General Commands Manual LOCATE(1)

NAME
locate -- find files

SYNOPSIS
locate pattern

DESCRIPTION…

and afterwards:

LOCATE(1) LOCATE(1)

NAME
locate - list files in databases that match a pattern

SYNOPSIS
locate [-d path | --database=path] [-e | -E | --[non-]existing] [-i |
--ignore-case] [-0 | --null] [-c | --count] [-w | --wholename] |-b |
--basename] [-l N | --limit=N] [-S | --statistics] [-r | --regex ]
[--max-database-age D] [-P | -H | --nofollow] [-L | --follow] [--ver-
sion] [-A | --all] [-p | --print] [--help] pattern...

DESCRIPTION…

I think you get the idea.