Category: *nix

random 64-bit integers in *nix


references

od -N 8 -t uL -An /dev/random | tr -d " "
Advertisements

sharing dot files between computers using git


create a repository

As anyone might know, Bitbucket permits private repositories.

$ git pull git@bitbucket:<username>/dot-files.git

put dot files in it

$ cd dot-files/
$ mv ~/.shuttle.json .
$ mkdir .m2
$ cd .m2
$ mv ~/.m2/settings.xml .
$ mv ~/.m2/settings-security.xml .
$ cd ..
$ git add \*
$ git commit -m "dot files added"
$ git push

link dot files

$ cd ~
$ ln -s /path/to/the/dot-files/.shuttle.json
$ cd .m2
$ ln -s /path/to/the/dot-files/.m2/settings.xml
$ ln -s /path/to/the/dot-files/.m2/settings-security.xml

java_home environment variable


Windows

N/A

OS X

installations

$ ls -l /Library/Java/JavaVirtualMachines/
....
$

/usr/libexec/java_home

$ /usr/libexec/java_home
/Library/Java/JavaVirtualMachines/jdkx.y.z_mm.jdk/Contents/Home

$ /usr/libexec/java_home -v 1.8
/Library/Java/JavaVirtualMachines/jdk1.8.0_mm.jdk/Contents/Home

$ /usr/libexec/java_home -v 1.7
/Library/Java/JavaVirtualMachines/jdk1.7.0_mm.jdk/Contents/Home

~/.profile

$ cat ~/.profile
...
export JAVA7_HOME=$(/usr/libexec/java_home -v 1.7)
export JAVA8_HOME=$(/usr/libexec/java_home -v 1.8)
export JAVA_HOME=$JAVA8_HOME
...

$ echo $JAVA7_HOME
/Library/Java/JavaVirtualMachines/jdk1.7.0_75.jdk/Contents/Home

$ echo $JAVA8_HOME
/Library/Java/JavaVirtualMachines/jdk1.8.0_31.jdk/Contents/Home

$ echo $JAVA_HOME
/Library/Java/JavaVirtualMachines/jdk1.8.0_31.jdk/Contents/Home

$

Ubuntu

See installing latest oracle jdk in old ubuntu.