Skip to content

Instantly share code, notes, and snippets.

View geetanjaligg's full-sized avatar

Geetanjali geetanjaligg

View GitHub Profile
@geetanjaligg
geetanjaligg / grubrecover.md
Last active August 29, 2015 14:05
Grub recover

###Determine your normal system partition - (the switch is a lowercase "L") sudo fdisk -l

###If you aren't sure, run df -Th

Look for the correct disk size and ext3 or ext4 format.

###Mount your normal system partition:

@geetanjaligg
geetanjaligg / es.sh
Last active August 29, 2015 14:05
Install elastic search and it's plugins
# install 1.3.1 ( stable version )
cd ~
sudo apt-get update
sudo apt-get install openjdk-7-jre-headless -y
### Check http://www.elasticsearch.org/download/ for latest version of ElasticSearch and replace wget link below
# NEW WAY / EASY WAY
wget https://download.elasticsearch.org/elasticsearch/elasticsearch/elasticsearch-1.1.1.deb
sudo dpkg -i elasticsearch-1.1.1.deb
@geetanjaligg
geetanjaligg / resume_network.sh
Created August 27, 2014 07:06
Fix : Networking auto disabled after resuming in Ubuntu 14.04
#!/bin/sh
case "${1}" in
resume|thaw)
restart network-manager
;;
esac
# put in /etc/pm/sleep.d/
# chmod 775 /etc/pm/sleep.md/resume_network.sh
@geetanjaligg
geetanjaligg / scheduler.py
Last active August 29, 2015 14:05
APScheduler ( Documentation modified )
# using apscheduler 2.1.2 since 3.0 version has a problem with importing Scheduler module
# sudo pip install apscheduler==2.1.2
from apscheduler.scheduler import Scheduler
sched = Scheduler()
sched.start()
def job_function():
print "Hello World"
@geetanjaligg
geetanjaligg / rsync.sh
Created September 4, 2014 09:36
Copy and exclude a specific directory [Linux]
rsync -av --progress sourcefolder /destinationfolder --exclude thefoldertoexclude
@geetanjaligg
geetanjaligg / bum.md
Created September 4, 2014 09:40
BUM! to manage upstart services. To enable/disable service from auto-starting on boot.

Install BUM! ( Boot Up Manager )

>sudo apt-get install bum

@geetanjaligg
geetanjaligg / r.md
Last active August 29, 2015 14:06
Install R and R-Studio

Install R

sudo apt-get install r-base-core

To install packages

sudo R

update.packages()

Install RStudio [ Ubunutu ]

32 bit

@geetanjaligg
geetanjaligg / scp
Created September 29, 2014 13:33
Resume a large scp transfer
rsync --partial --progress --rsh=ssh user@host:remote_file local_file
@geetanjaligg
geetanjaligg / index_es.py
Last active August 29, 2015 14:10
Read json file and index in ElasticSearch
import rawes #install rawes. pip install rawes
es = rawes.Elastic('localhost:9200')
#index each line
with open('sample.json','r') as f:
for line in f:
es.post('index_name/index_type',data=line)
#!/bin/sh
# one way (older scala version will be installed)
# sudo apt-get install scala
#2nd way
sudo apt-get remove scala-library scala
wget http://www.scala-lang.org/files/archive/scala-2.11.4.deb
sudo dpkg -i scala-2.11.4.deb
sudo apt-get update