install lift with scala 2.8, sbt & jrebel 30. Aug 2010

Here’s how to get Lift running with Scala 2.8, SBT and JRebel on Mac OS X:

1) Download and install the JRebel nightly

$ wget --referer \
  http://www.zeroturnaround.com/jrebel/next-releases/ \
  http://www.zeroturnaround.com/downloads/jrebel-nightly-nosetup.zip
$ sudo unzip -d /usr/share/java jrebel-nightly-nosetup.zip
$ cd /usr/share/java
$ export JREBEL=jrebel-nightly-`date "+%Y-%m-%d"`
$ sudo mv jrebel $JREBEL
$ sudo ln -s $JREBEL/jrebel.jar jrebel.jar

2) Request a JRebel Scala license and copy it to the JRebel directory

$ sudo cp javarebel.lic /usr/share/java/$JREBEL

3) Install the Simple Build Tool via MacPorts.

$ sudo port install sbt

4) Edit the SBT launcher script (at /opt/local/bin/sbt)

JREBELJAR="/usr/share/java/jrebel.jar"
JAVA_OPTS="-Xmx512M -noverify"
exec java $JAVA_OPTS -javaagent:"$JREBELJAR" \
-jar "$LAUNCHJAR" $QUOTED_ARGS

5) Clone the SBT prototype of Lift to your development directory

$ git clone http://github.com/lift/lift_21_sbt.git

6) Comment in the following line in project/build/LiftProject.scala

override def scanDirectories = Nil

7) Change to the project root directory and start SBT with automatic redeployment

$ sbt
> update
> jetty-run
> ~ prepare-webapp

8) Open http://localhost:8080/ in your favorite browser

9) Make a change to src/main/webapp/index.html and refresh your browser

10) Enjoy productivity!

 

disable smart location bar in safari 28. Aug 2010

If you’re also annoyed as hell by the new address bar autocomplete feature in Safari that searches not only URLs but also titles then rejoice because SMRT is here to save your sanity. Suddenly Safari is usable again and you can finally upgrade and take part in all the extension fun!

 

kill all processes by path name 27. Jul 2010

To kill all processes whose executable lies in a certain path issue the following command under Linux:

ps xawww -o pid -o cmd | \
egrep /path/to/executable | \
egrep -o ^[[:digit:]]+ | \
xargs kill

And for Mac OS X:

ps xwww -o pid -o comm | \
egrep /path/to/executable | \
egrep -o ^[[:digit:]]+ | \
xargs kill
 

create a hardware report on mac os x 14. Jul 2010

If you want to generate an anonymous hardware report for your Mac on Snow Leopard you can use the command line version of the System Profiler.

system_profiler -detailLevel mini -xml > hardware_report.spx

This will generate a clickable hardware report without personal information. If you open it in the System Profiler it will be displayed in your native language but the report is language independent nevertheless. If you want an english plaintext version you can just leave the xml option out.

system_profiler -detailLevel mini > hardware_report.txt
 

taking a screenshot in quicktime x 06. Jul 2010

If you are watching a movie in Quicktime X and you take a screenshot with ⌘⇧4 the result looks this:

Quicktime X screenshot 1

Okay, so how can I get rid of those annoying controls? The answer is amazingly simple! If you double click in the window before making the screenshot the controls vanish and the result looks like this:

Quicktime X screenshot 2

Okay, so how can I get rid of the shadow and the rounded corners without using Photoshop? The answer is simple but not really elegant. Execute the following statement in the Terminal:

screencapture -ow ~/Desktop/Screenshot.png

Then your resulting screenshot on your desktop looks like this:

Quicktime X screenshot 3

Okay, so how can I do this more elegantly? You can create a shell script and launch it with a keyboard shortcut. Enabling this involves several steps. First create a directory called Scripts in your home directory. Then launch your favorite text editor, create a new file and paste this slightly adapted command.

screencapture -ow ~/Desktop/Screenshot-$$.png

Save it as TakeScreenshotWithoutShadow.sh in the Scripts directory and execute the following statement in the Terminal to make the shell script executable :

chmod +x ~/Scripts/TakeScreenshotWithoutShadow.sh

Now create an Automator action to launch the shell script.

  1. Open Automator
  2. Choose to create a new Service
  3. Add a “Run Shell Script” item from the Utilitites folder
  4. Replace the default text with ~/Scripts/TakeScreenshotWithoutShadow.sh
  5. From the “Service receives select” dropdown menu select “no input”
  6. Save the action as “Take Screenshot Without Shadow”

Automator screenshot

Finally to create the keyboard shortcut open System Preferences and select the Keyboard panel. Then switch to the Keyboard Shortcuts tab and select Services from the left column. Then scroll down to the bottom of the right column. There you will find your newly created Automator action. Select “Take Screenshot Without Shadow” and double click on the right side of the item to create a keyboard shortcut. Select a reasonable shortcut, for example ⌘⇧5.

System Preferences screenshot

You have to wait a little for the Shortcut to be active. After a minute or so go to Quicktime X, select the desired frame and press the chosen Shortcut. Voilà!

Okay, now go and watch the brilliant music video by director Keith Schofield!

 

1 2 3 ... 8