This file contains hidden or 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 sys,operator,getopt | |
| class bcolors: | |
| HEADER = '\033[95m' | |
| OKBLUE = '\033[94m' | |
| OKGREEN = '\033[92m' | |
| WARNING = '\033[93m' | |
| FAIL = '\033[91m' |
This file contains hidden or 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
| After ssh into linux box from Mac OS X terminal. Add the following lines to .screenrc | |
| defscrollback 5000 | |
| termcapinfo xterm* ti@:te@ |
This file contains hidden or 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
| diff -r -U3 -I "String to exclude" <directory-1> <directory-2> |
This file contains hidden or 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
| chrome.tabs.query({'active': true, 'lastFocusedWindow': true, 'currentWindow': true}, function (tabs) { | |
| var url = tabs[0].url; | |
| console.log(url); | |
| }); |
This file contains hidden or 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
| function testURL(url, retryInterval, maxRetryInterval) { | |
| $.ajax({ | |
| url: url, | |
| type: "GET", | |
| timeout: 2000, | |
| success: function(resp) { | |
| console.log(url + " is alive!") | |
| }, | |
| error: function(x, t, m) { | |
| if (t == 'timeout') { |
This file contains hidden or 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
| function notifyMe(url) { | |
| if (!Notification) { | |
| alert('Notifications are supported in modern versions of Chrome, Firefox, Opera and Firefox.'); | |
| return; | |
| } | |
| if (Notification.permission !== "granted") | |
| Notification.requestPermission(); | |
| var notification = new Notification('Site is up!', { |
This file contains hidden or 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
| <configuration> | |
| <!-- Metastore configs --> | |
| <property> | |
| <name>hive.metastore.warehouse.dir</name> | |
| <value>/apps/hive/warehouse</value> | |
| </property> | |
| <property> | |
| <name>hive.metastore.cache.pinobjtypes</name> | |
| <value>Table,Database,Type,FieldSchema,Order</value> | |
| </property> |
This file contains hidden or 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
| export HADOOP_PREFIX="/work/hadoop/current" | |
| export HADOOP_COMMON_HOME="/work/hadoop/current" | |
| export HADOOP_HDFS_HOME="/work/hadoop/current" | |
| export HADOOP_MAPRED_HOME="/work/hadoop/current" | |
| export HADOOP_YARN_HOME="/work/hadoop/current" | |
| export HADOOP_CONF_DIR="/work/hadoop/current-conf" | |
| export TEZ_VERSION=0.5.2 | |
| export TEZ_PREFIX=/work/tez/current | |
| export TEZ_DIST=$TEZ_PREFIX/tez-dist/target/tez-${TEZ_VERSION} |
This file contains hidden or 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
| #List all public DNS from command line | |
| ec2-describe-instances | cut -f 4 | grep ^ec2 |
This file contains hidden or 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
| *`which` in ruby* | |
| http://stackoverflow.com/questions/2108727/which-in-ruby-checking-if-program-exists-in-path-from-ruby | |
| def which(cmd) | |
| exts = ENV['PATHEXT'] ? ENV['PATHEXT'].split(';') : [''] | |
| ENV['PATH'].split(File::PATH_SEPARATOR).each do |path| | |
| exts.each { |ext| | |
| exe = "#{path}/#{cmd}#{ext}" | |
| return exe if File.executable? exe | |
| } | |
| end |