This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pig -x local -f profiles.pig > acompli-hbase.txt | |
cat acompli-hbase.txt |cut -d',' -f1-3 | cut -d'(' -f 2 > acompli-hbase-final.txt | |
HADOOP_USER_NAME=cloud_analytics pig -P cloud_analytics_pig.properties -m cloud_analytics_pig.param -f backfill_agentHoldingTimeAggregate.pig -p month_string= | |
HADOOP_USER_NAME=cloud_analytics pig -P cloud_analytics_pig.properties -m cloud_analytics_pig.param -f dau-hugegames.pig -useHCatalog | |
hdfs dfs -ls /analytics/events/event_date=2017-09-08/action_type=a | |
mapred job -kill job_1486125356459_708807 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ansible-playbook -i hosts verify.yml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ssh-add -K ~/.ssh/id_rsa | |
ssh -L 9098:localhost:9097 sandbox.hortonworks.com -p 2222 -l root | |
ssh -L 4098:localhost:4098 abhishekgupta@hdp01-cli01 | |
ssh -A jump.p.helpshift.com ssh -A hdp01-cli01 cat /home/abhishekgupta/dataplat-2716.csv/csr-2716.csv > csr-2716.csv | |
rsync -avz -e "ssh -p 2222" --exclude 'target/*' --exclude '.git*' bitter root@127.0.0.1:/root/abhishek/bitter | |
mvn clean package -DskipTests -Pbackfill && hdfs dfs -put -f target/jswine/jswine.jar |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
#import pydoop.hdfs as hdfs | |
import subprocess | |
import ast | |
import re | |
import csv | |
#with hdfs.open('/adhoc/faq-suggestion-report-all/daily/dt=2017-07-03/B/') as f: | |
# for line in f: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
d=2017-07-03 | |
while [ "$d" != 2017-07-12 ]; do | |
echo "Running for date:" $d | |
echo -e '\n\n' | |
#curl -L http://google.com?q=$d | |
HADOOP_USER_NAME=hdfs yarn jar /home/abhishekgupta/gerrit/emrgent/target/emrgent-0.1.1-standalone.jar prod daily sdk_q A dt=$d | |
HADOOP_USER_NAME=hdfs yarn jar /home/abhishekgupta/gerrit/emrgent/target/emrgent-0.1.1-standalone.jar prod daily sdk_q B dt=$d | |
d=$(date -I -d "$d + 1 day") | |
echo -e '\n\n' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(ns demo.dsl.sxml) | |
(defn format-attrs-map [attrs-map] | |
(->> (seq attrs-map) | |
(map (fn [[key val]] (str (name key) ":" "'" val "'"))) | |
(clojure.string/join " "))) | |
(defn generate-html [tag-name attrs body] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
https://github.com/abhilater/clojure-type-selection-flowchart | |
https://stackoverflow.com/questions/8614734/how-do-i-implement-a-java-interface-in-clojure | |
https://stackoverflow.com/questions/5821892/why-should-i-use-reify-instead-of-proxy-in-clojure | |
https://groups.google.com/forum/#!topic/clojure/WIIcvsYLzh0 | |
AOP | |
==== | |
https://stackoverflow.com/questions/5573418/aspect-oriented-programming-in-clojure | |
https://github.com/technomancy/robert-hooke | |
https://groups.google.com/forum/#!topic/clojure/Wsc6du1VxEs |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
https://stackoverflow.com/questions/2563632/how-can-i-merge-two-commits-into-one |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defn with-local-redefs-fn | |
[a-var its-new-value func] | |
(cast clojure.lang.IFn @a-var) | |
(alter-meta! a-var | |
(fn [m] | |
(if (::scope-count m) | |
(update-in m [::scope-count] inc) | |
(assoc m | |
::scope-count 1 | |
::thread-local-var (doto (clojure.lang.Var/create @a-var) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;; Clojure lazy-seq function to generate n prime numbers. | |
;; It generates .5 million prime numbers in 20 secs using | |
;; the naive non-sieve algo | |
;; Author: Abhishek Gupta (@abhilater) | |
(defn n-primes | |
[] | |
(filter (fn [num] | |
(loop [end (int (Math/sqrt num)), div 2, re (rem num div)] | |
(cond |