May 31

I run into a problem where my karma run hangs (see grunt watch hangs on karma:unit:run task). After digging into it I found out that it relates to problem #1 in post etc/hosts bug and dns resolution. Upgrading to 10.8 damaged etc/hosts. DNS resolution of localhost was extremely slow.

To fix this you could use 127.0.0.1 instead of localhost or split lines in etc/hosts

Instead of

127.0.0.1 strug-imac.hypoport.local localhost

split them into single lines

127.0.0.1 localhost
127.0.0.1 strug-imac.hypoport.local

Tagged with:
Jun 13

Currently I’m setting up a new SSD. One of my first installations is homebrew, a must have IMO.

I have two users. Allen the admin and Stan the standard user. Stan is a developer who works most of his time inside our company network. Allen is responsible for installing apps and so on. For security reasons Stan don’t want to be admin. Nevertheless Stan wants to use homebrew, he loves it too. Allen don’t want to have two homebrew installations so that he allows Stan to use his homebrew.

Update 2013-05-31: considering /Library/Caches/Homebrew

Setup

  1. Create a group brew and add Stan
  2. brew doctor (Allen checks if he installed brew correctly)
  3. sudo chgrp -R brew /usr/local (Change the group of homebrew installation directory)
  4. sudo chmod -R g+w /usr/local (Allow group members to write inside this directory)
  5. sudo chgrp -R brew /Library/Caches/Homebrew (Change the group of homebrew cache directory)
  6. sudo chmod -R g+w /Library/Caches/Homebrew (Allow group members to write inside this directory)
  7. brew doctor (Stan checks if he can use homebrew)
  8. We are done!

Detailed Setup

Create a group brew and add Stan
One way to create a group brew is to open the System Preferences and select Users & Groups. Unlock this screen and press the lower left +. Select the account type Group and name it brew. After creating this group add Allen and Stan.

Allen checks if he installed brew correctly

allen$ brew doctor
Your system is raring to brew.

Change the group of homebrew installation directory

allen$ sudo chgrp -R brew /usr/local
Password:
allen$ ls -la /usr/local
total 16
drwxrwxr-x 8 root brew 272 Jun 12 22:31 .
drwxr-xr-x@ 13 root wheel 442 Jun 12 22:36 ..
-rw-r--r-- 1 admin brew 159 Jun 12 22:28 .gitignore
drwxr-xr-x 2 admin brew 68 Jun 12 22:33 Cellar
drwxr-xr-x 6 admin brew 204 Jun 12 22:28 Library
-rw-r--r-- 1 admin brew 789 Jun 12 22:28 README.md
drwxr-xr-x 3 admin brew 102 Jun 12 22:28 bin
drwxr-xr-x 3 admin brew 102 Jun 12 22:28 share

Allow group members to write inside this directory

allen$ sudo chmod -R g+w /usr/local
allen$ ls -la /usr/local
total 16
drwxrwxr-x 8 root brew 272 Jun 12 22:31 .
drwxr-xr-x@ 13 root wheel 442 Jun 12 22:36 ..
-rw-rw-r-- 1 admin brew 159 Jun 12 22:28 .gitignore
drwxrwxr-x 2 admin brew 68 Jun 12 22:33 Cellar
drwxrwxr-x 6 admin brew 204 Jun 12 22:28 Library
-rw-rw-r-- 1 admin brew 789 Jun 12 22:28 README.md
drwxrwxr-x 3 admin brew 102 Jun 12 22:28 bin
drwxrwxr-x 3 admin brew 102 Jun 12 22:28 share

Change the homebrew cache directory accordingly

sudo chgrp -R brew /Library/Caches/Homebrew
sudo chmod -R g+w /Library/Caches/Homebrew

Stan checks if he can use homebrew
In my case Allen and Stan is one person, so that a simple login do the trick.

allen$ login stan
Password:
stan$ brew doctor
Your system is raring to brew.

Tagged with:
Sep 10

Homebrew is my favorite package manager. If you installed Xcode just for brew than this post might be interesting for you.

Kenneth Reitz created a GCC Installer for OSX without Xcode! Thank you. This package is about 500 MB. Compared to Xcode you save at least 1,5 GB on your SSD.

So let’s go to work:

  • Remove Xcode
  • sudo /Developer/Library/uninstall-devtools --mode=all

    This will delete Xcode. For more details see John’s post

  • Download and install GCC for Mac without Xcode
  • Currently 10.6 and 10.7 packages are available at https://github.com/kennethreitz/osx-gcc-installer/downloads

  • Install brew (see http://mxcl.github.com/homebrew/)
  • /usr/bin/ruby <(curl -fsSkL raw.github.com/mxcl/homebrew/go)
  • You're done
  • You can verify your success with brew doctor.

Caution:
You don't need Xcode for formulas like gradle, groovy, maven, tomcat etc. Nevertheless some formulas will require Xcode!

Tagged with:
Jun 08

A German software developer should think about using a US keyboard because:

  • IDE shortcuts are based on a US keyboard layout, so that some shortcuts can’t be used. E.g. Ctrl-Shift-/ won’t work because / is Shift-7 on are German keyboard
  • Important characters like {,},[,],@,=,? are easily reachable
  • Only the alphabet letters z and y are switched
  • There are ways to type German umlaute more easily than on a German keyboard (cont. reading!).

Mac
Developer who can call a Mac their own should use the modified US keyboard from Jan Borchers. It allows you to press option-a instead of option-u-a for the letter รค. I think this is even better then the layout on a German keyboard. The installation is done quickly:

  • download
  • unzip
  • move Roman.bundle to /Library/Keyboard Layouts
  • move USGerman.icns and USGerman.keylayout from within Roman.bundle to /Library/Keyboard Layouts
  • restart your mac
  • add and select keyboard “U.S. With Umlauts via Option Key”

For a detailed instruction visit the above link.

Linux and Windows
Bernd Schoeller has created similar layouts for Linux and Windows

Update
If you are using CoRD to connect to windows machines you have the problem that the keyboard layout is automatically mapped to romanian. To fix this you need to open
/Applications/CoRD.app/Contents/Resources/windows_keymap_table.txt
and change the key Romanian to – in my case english: Romanian=0×409

Update
When you move the Roman.bundle to /Library/Keyboard Layout it could happen that suddenly the layout stop working. This might effect some accounts only. To prevent you from that you need to copy the *.icns and *.keyboard file into /Library/Keyboard Layout and restart your mac.

Tagged with:
preload preload preload