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
/usr/bin/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
http://osxfaq.com/tips/unix-tricks/week91/thursday.ws
http://paulbeachsblog.blogspot.com/2008/02/adding-user-to-group-using-dscl.html
http://support.apple.com/downloads/Server_Admin_Tools_10_5

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

Tuesday, April 20, 2010

VimClojure - REPL without opening a clojure file

If you just want to get a clojure REPL within vim using the excellent VimClojure, just change vim to clojure mode like so

:set ft=clojure

and start the REPL using typing \sr

Make sure, nailgun server is running in the background

Instructions to install VimClojure

Sunday, February 28, 2010

Friday, February 19, 2010

macosx tar - annoying ._* files

I noticed that tar generates files starting with ._* when creating an archive


$ tar cvzf jfa.tgz jfa


And the corresponding listing in archive

ashee-mac:shiva amitava$ tar tvf jfa.tgz
drwxr-xr-x amitava/staff 0 2010-02-19 09:18:22 jfa/
-rw-r--r-- amitava/staff 187 2010-02-19 08:40:06 jfa/._.htaccess
-rw-r--r-- amitava/staff 616 2010-02-19 08:40:06 jfa/.htaccess
....
....


Notice how it adds "._.htaccess"

I found the solution here

Here's the command for convenience
$COPYFILE_DISABLE=true tar cvzf jfa.tgz jfa



COPYFILE_DISABLE=true (for Leopard)
COPY_EXTENDED_ATTRIBUTES_DISABLE=true (for Tiger)

Monday, February 15, 2010

Clojure version

user=> *clojure-version*
{:major 1, :minor 1, :incremental 0, :qualifier ""}