Skip to content

Instantly share code, notes, and snippets.

@shantanusingh
shantanusingh / FindJNI.cmake
Last active August 29, 2015 13:57 — forked from emchristiansen/gist:6845954
Cmake FindJNI mod to detect Oracle JDK
# This is a modified version of FindJNI.cmake which lets it work with
# Oracle Java 7 in Ubuntu 13.04.
# The file at /usr/share/cmake-2.8/Modules/FindJNI.cmake should be
# overwritten with this file.
#See http://stackoverflow.com/questions/17636166/cmake-find-packagejni-not-work-in-ubuntu-12-04-amd64
# - Find JNI java libraries.
# This module finds if Java is installed and determines where the
# include files and libraries are. It also determines what the name of
# the library is. This code sets the following variables:
@shantanusingh
shantanusingh / jdk7-on-Amazon AMI
Last active August 29, 2015 13:57 — forked from tankchintan/gist:1335220
Instal JDK7 on Amazon AMI
# First verify the version of Java being used is not SunJSK.
java -version
# Get the latest Sun Java SDK from Oracle http://www.oracle.com/technetwork/java/javase/downloads/jdk-7u1-download-513651.html
wget --no-cookies --no-check-certificate --header "Cookie: oraclelicense=accept-securebackup-cookie" "http://download.oracle.com/otn-pub/java/jdk/7u51-b13/jdk-7u51-linux-x64.tar.gz"
# Rename the file downloaded, just to be nice
mv jdk-7u1-linux-i586.rpm\?e\=1320265424\&h\=916f87354faed15fe652d9f76d64c844 jdk-7u1-linux-i586.rpm
#Untar and move to /usr/java
#!/bin/sh
##
# Install autoconf, automake and libtool smoothly on Mac OS X.
# Newer versions of these libraries are available and may work better on OS X
#
# This script is originally from http://jsdelfino.blogspot.com.au/2012/08/autoconf-and-automake-on-mac-os-x.html
#
export build=~/devtools # or wherever you'd like to build
-nosplash
--launcher.defaultAction
openFile
-vm
C:/JDK7/jre/bin/server/jvm.dll #Windows
#/Library/Java/JavaVirtualMachines/jdk1.7.0_25.jdk/Contents/Home/bin/java #OS X
-vmargs
-Xincgc
-Xss1m
-Duser.name=FirstName LastName
#
# Run as root
# $ bash <(curl -s https://raw.github.com/gist/1631411)
#
# Update, upgrade and install development tools:
apt-get update
apt-get -y upgrade
apt-get -y install build-essential git-core curl \
libssl-dev \
@shantanusingh
shantanusingh / gist:3274335
Created August 6, 2012 13:06 — forked from rolo/gist:1481128
Install Postgres 9.1, PostGIS and create PostGIS template on Ubuntu 11.10 Oneiric Ocelot
#!/bin/bash
#
# Install Postgres 9.1, PostGIS and create PostGIS template on a clean Ubuntu 11.10 Oneiric Ocelot box
# http://wildfish.com
# add the ubuntu gis ppa
sudo apt-get -y install python-software-properties
sudo add-apt-repository ppa:ubuntugis/ubuntugis-unstable
sudo apt-get update
@shantanusingh
shantanusingh / movingredistolinode.md
Created April 19, 2012 20:46 — forked from csanz/movingredistolinode.md
Moving your redis instance to linode

Move your redis instance to Linode!

create linode server instance

local:

<shell>$ssh root@(IP ADDRESS)

remote:

@shantanusingh
shantanusingh / gist:2272004
Created April 1, 2012 06:33 — forked from bihe/init.d play
init.d script to launch Play framework under Ubuntu
#!/bin/sh
### BEGIN INIT INFO
## END INIT INFO
# Path to play install folder
PLAY_HOME=/usr/share/play
PLAY=$PLAY_HOME/play
# Path to the JVM
JAVA_HOME=/usr/lib/jvm/java-1.6.0-openjdk
@shantanusingh
shantanusingh / redis_schema.txt
Created January 17, 2012 15:59 — forked from deepak/redis_schema.txt
how to name keys in redis for keyvalue stores
# how to name keys in redis for keyvalue stores
http://code.google.com/p/redis/wiki/TwitterAlikeExample
http://rediscookbook.org/introduction_to_storing_objects.html
http://www.slideshare.net/playnicelyapp/redis-schema-design-for-playnicely-redis-london-meetup
antirez has a book about keyvalue design in the pipeline
http://code.google.com/p/redis/wiki/IntroductionToRedisDataTypes
schema:
<namespace>:<globalObject>
@shantanusingh
shantanusingh / elasticsearch.sh
Created October 31, 2011 20:43 — forked from alkema/elasticsearch.sh
install elasticsearch on ubuntu
sudo apt-get install unzip
wget https://github.com/downloads/elasticsearch/elasticsearch/elasticsearch-0.17.4.zip
unzip elasticsearch-0.17.4.zip
sudo apt-get install python-software-properties
sudo add-apt-repository "deb http://archive.canonical.com/ lucid partner"
sudo apt-get update
sudo apt-get install sun-java6-jre sun-java6-plugin
sudo mv elasticsearch-0.17.4 /usr/local/share
cd elasticsearch-servicewrapper
sudo mv service /usr/local/share/elasticsearch-0.17.4/bin