Friday, May 28, 2010

Title: How to upgrade maven in macosx?

See this at Nabble

In mac, maven is laid out as below

ashee-mac:~ amitava$ which mvn
ashee-mac:~ amitava$ ls -l `which mvn`
lrwxr-xr-x 1 root wheel 24 May 25 09:55 /usr/bin/mvn -> /usr/share/maven/bin/mvn
ashee-mac:~ amitava$ ls -l /usr/share/maven
lrwxr-xr-x 1 root wheel 23 May 28 12:14 /usr/share/maven -> java/maven-2.2.0

So, all I needed is to download the latest version from apache, untar it under /usr/share/java
and update the symlink

ashee-mac:~ amitava$ unlink /usr/share/maven
ashee-mac:~ amitava$ ln -s /usr/share/java/apache-maven-2.2.1 /usr/share/maven

ashee-mac:~ amitava$ mvn --version
Apache Maven 2.2.1 (r801777; 2009-08-06 15:16:01-0400)
Java version: 1.6.0_20
Java home: /System/Library/Frameworks/JavaVM.framework/Versions/1.6.0/Home
Default locale: en_US, platform encoding: MacRoman
OS name: "mac os x" version: "10.5.8" arch: "x86_64" Family: "mac"

Thursday, May 27, 2010

Scala Manifest

Idiomatic way to reflect on scala type

scala> def gt[A](x : A)(implicit m:Manifest[A]) = m
gt: [A](x: A)(implicit m: scala.reflect.Manifest[A])scala.reflect.Manifest[A]

scala> val l = 1 to 10
l: scala.collection.immutable.Range.Inclusive with scala.collection.immutable.Range.ByOne = Range(1, 2, 3, 4, 5, 6, 7, 8, 9, 10)

scala> gt(l)
res8: scala.reflect.Manifest[scala.collection.immutable.Range.Inclusive with scala.collection.immutable.Range.ByOne] = scala.collection.immutable.Range$Inclusive with scala.collection.immutable.Range$ByOne

Thursday, May 6, 2010

Add user to groups in mac (leopard)

$ sudo dscl . create /groups/lms name lms
$ sudo dscl . create /groups/lms passwd "*"
$ sudo dscl . create /groups/lms gid 20014
$ sudo dscl . create /groups/lms users amitava

Related Links

Server Admin Tools does not allow me to edit stuff - just view it