Skip to content

Instantly share code, notes, and snippets.

View sagarnikam123's full-sized avatar
:octocat:
Brushing on previous skills

Sagar Nikam sagarnikam123

:octocat:
Brushing on previous skills
View GitHub Profile

Keybase proof

I hereby claim:

  • I am sagarnikam123 on github.
  • I am sagarnikam123 (https://keybase.io/sagarnikam123) on keybase.
  • I have a public key ASCd2iI6vadCVSHDVzoy7GcyAGXEc7kVomS-GUx7O3vTbwo

To claim this, I am signing this object:

@sagarnikam123
sagarnikam123 / EC2SSHLogin.sh
Last active January 28, 2016 05:21
SSH login to Amazon EC2 instance & file transfer
#Usernames for diff. amazon machines
Amazon Linux - ec2-user
RHEL5 - root / ec2-user
Ubuntu - ubuntu
Fedora - fedora / ec2-user
SUSE Linux - root / ec2-user
#Change permission on .pem file
chmod 400 msys-aws-nvirginia-analytics.pem
@sagarnikam123
sagarnikam123 / fbDownloadPhoto.py
Created May 22, 2015 08:59
Download photos from Facebook fan page.
#fbDownloadPhoto.py
'''
This script downloads all photos from Facebook fan page
Pre requisite
- Facebook Fanpage id
- Python 2.7
- Python pip
- Facebook-python-sdk (http://facebook-sdk.readthedocs.org/en/latest/install.html)
@sagarnikam123
sagarnikam123 / removePDFPassword.sh
Created May 19, 2015 04:57
remove PDF password (only if you know the password of PDF)
##### remove PDF password (only if you know the password of PDF)
### qpdf
sudo apt-get install qpdf
qpdf --password=password --decrypt input.pdf output_decrept.pdf
### pdftops
@sagarnikam123
sagarnikam123 / Wifi-hotspotOnLinux.sh
Last active August 29, 2015 14:17
Wifi-hotspot on Linux (Ubuntu 14.04)
# Script to enable wifi-hotspot on Linux (Ubuntu) Machine.
# remove hostapd & ap-hotspot if already present (ubuntu 14.04)
sudo apt-get remove ap-hotspot
sudo apt-get remove hostapd
# we are downloading specific version of hostpad, bcoz in 14.04, it is buggify.
# if below lines not working then directly install
# sudo apt-get install hostpad
@sagarnikam123
sagarnikam123 / gistTry.txt
Created September 10, 2013 06:59
First R commit
This is text file for loading R code to Gist
@sagarnikam123
sagarnikam123 / reducer.R
Created August 21, 2013 12:57
reducer script in R for running WordCount program on Hadoop
#! /usr/bin/env Rscript
# reducer.R - Wordcount program in R
# script for Reducer (R-Hadoop integration)
trimWhiteSpace <- function(line) gsub("(^ +)|( +$)", "", line)
splitLine <- function(line) {
val <- unlist(strsplit(line, "\t"))
list(word = val[1], count = as.integer(val[2]))
@sagarnikam123
sagarnikam123 / mapper.R
Created August 21, 2013 12:54
mapper script in R for running WordCount program on Hadoop
#! /usr/bin/env Rscript
# mapper.R - Wordcount program in R
# script for Mapper (R-Hadoop integration)
trimWhiteSpace <- function(line) gsub("(^ +)|( +$)", "", line)
splitIntoWords <- function(line) unlist(strsplit(line, "[[:space:]]+"))
## **** could wo with a single readLines or in blocks
con <- file("stdin", open = "r")