Skip to content

Instantly share code, notes, and snippets.

@yashk
yashk / gist:7eb4e11101e3a58a7745
Created November 30, 2015 05:34
interesting cousres
Learning to learn
https://www.youtube.com/watch?v=vd2dtkMINIw
http://apple.stackexchange.com/questions/69549/reversing-some-usr-local-damage
http://apple.stackexchange.com/questions/102806/how-to-recover-from-chown-r-user-usr
http://superuser.com/questions/591108/how-can-i-restore-the-permissions-of-my-usr-folder
@yashk
yashk / PM interview questions
Created October 28, 2014 11:25
PM interview questions
1. two data sets A and B
24 hrs data
A
entity,joinky,timestamp
google.com,1234,12:25
http://blog.mafr.de/2010/08/01/maven-archetype-hadoop/
cntlm -T /home/186946/ntlm.log -s -v -c /etc/cntlm.conf
@yashk
yashk / dns.java
Last active March 24, 2016 12:41
import java.net.InetAddress;
import java.net.UnknownHostException;
public class dns {
public static void main(String[] args) throws UnknownHostException { InetAddress addr = InetAddress.getLocalHost();
System.out.println(
String.format(
"IP:%s hostname:%s canonicalName:%s",
addr.getHostAddress(), // The "default" IP address
addr.getHostName(), // The hostname (from gethostname())
addr.getCanonicalHostName() // The canonicalized hostname (from resolver)
@yashk
yashk / juniper.64bit.ubuntu.txt
Last active August 29, 2015 13:58
Install Juniper netconnect on 64 bit ubuntu
0.install 32 bit libraries on ubuntu
sudo apt-get update
sudo apt-get install libstdc++6:i386 lib32z1 lib32ncurses5 lib32bz2-1.0 libxext6:i386 libxrender1:i386 libxtst6:i386 libxi6:i386
1.Install 32 bit chrome
2.Install 32 bit jre
sudo mkdir -p -v /opt/java/jre/32
DOCKER_VERSION=0.7
DATA_DIR="__data"
POSTGRES_VERSION=9.3
PORT=5432
.PHONY: docker-check docker-version postgres
docker-check:
@command -v docker >/dev/null 2>&1 || \
{ echo >&2 "Docker needs to be installed and on your PATH. Aborting."; exit 1; }
@yashk
yashk / FileCopyWithProgress.java
Created February 26, 2014 11:26
HDFS - FileCopyWithProgress
public class FileCopyWithProgress {
public static void main(String[] args) throws Exception {
String localSrc = args[0];
String dst = args[1];
InputStream in = new BufferedInputStream(new FileInputStream(localSrc));
Configuration conf = new Configuration();
FileSystem fs = FileSystem.get(URI.create(dst), conf);
OutputStream out = fs.create(new Path(dst), new Progressable() {
public void progress() {
System.out.print(".");