Skip to content

Instantly share code, notes, and snippets.

View ansrivas's full-sized avatar

Ankur Srivastava ansrivas

View GitHub Profile
@ansrivas
ansrivas / scala sbt installer
Last active August 29, 2015 14:21
Instructions to install sbt and scala on ubuntu 14.04
For Scala installation:
// to install any desired version of scala for eg: scala-2.11.6.deb
$ wget http://www.scala-lang.org/files/archive/scala-2.11.6.deb
$ sudo dpkg -i scala-2.11.6.deb
$ sudo apt-get update
For SBT installation
// version 0.13.8
@ansrivas
ansrivas / setup scala version globally to use with sbt
Created May 20, 2015 16:55
Set scala version globally to be used with SBT
for sbt version 0.13+
$ vim ~/.sbt/0.13/global.sbt
enter this line : for corresponding scala version to be used globally
scalaVersion := "2.11.6"
@ansrivas
ansrivas / scala eclipse project
Created May 26, 2015 11:04
Creating sbt eclipse project
//To create a scala eclipse project
//Open and write into this file
mkdir -p ~/.sbt/0.13/plugins/
vim ~/.sbt/0.13/plugins/plugins.sbt
addSbtPlugin("com.typesafe.sbteclipse" % "sbteclipse-plugin" % "3.0.0")
//now create a sample directory where you want your project to be
@ansrivas
ansrivas / sbt-assembly
Created June 25, 2015 21:40
Creating a jar out of scala projects
1. Check the current version of sbt-installed
$ sbt sbtVersion
2. Depending upon the version of sbt,from this link, https://github.com/sbt/sbt-assembly
add this to your "project/assembly.sbt" in the root directory of your project
addSbtPlugin("com.eed3si9n" % "sbt-assembly" % "0.13.0")
the versions in the end for sbt assembly will differ based on sbt version. Explained clearly in the above git hub page
@ansrivas
ansrivas / update_python_packages.sh
Created July 27, 2015 14:09
a shell script to update all available python packages in the system
pip freeze --local | grep -v '^\-e' | cut -d = -f 1 | xargs pip install -U
#using ggplot as example to download the development branch
pip install -I git+git://github.com/yhat/ggplot.git
@ansrivas
ansrivas / .Xresources
Last active August 29, 2015 14:26
include this to fix xterm's configuration, copy this in home directory and execute "xrdb -merge ~/.Xresources"
! Use a nice truetype font and size by default...
xterm*faceName: DejaVu Sans Mono Book
xterm*faceSize: 14
! Every shell is a login shell by default (for inclusion of all necessary environment variables)
xterm*loginshell: true
! I like a LOT of scrollback...
xterm*savelines: 16384
@ansrivas
ansrivas / gist:7ad03c672a07a6b8cd17
Last active June 1, 2016 22:51
Fixing bluetooth connections in lubuntu
sudo vim /etc/bluetooth/audio.conf
# under [General] section, just include this line
Enable = Socket
sudo service bluetooth restart
#now you can add the bluetooth device and change the settings in pulse-audio-mixer.
In a bash file
#run with sudo
#this requirement wasn't satisfied on my ubuntu machine
apt-get install libhdf5-dev
pip install h5py
#a shell script to create an eclipse project, in current directory if 3rd argument isn't passed
#else creates in the current directory
groupID=$1
archetypeArtifactId=$2
directory=$3
if [[ "$1" == "" || "$2" == "" ]] ; then
echo "ERROR !!"
echo "Usagae : bash maven_proj.sh <groupid> <archetypeArtifactId> <absolute-path-directory>(optional)"
exit