-
install arandr
sudo apt-get install arandr
-
save 2 configurations, one for monitors attached on docking, another for laptop only.
~/.screenlayout/dock.sh
~/.screenlayout/undock.sh
-
add new udev rule:
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 | |
ALLUXIO_CMD=/opt/alluxio/bin/alluxio | |
echo "using alluxio command at $ALLUXIO_CMD" | |
SCAN_PATH=$1 | |
#for k in $($ALLUXIO_CMD fs ls -fR $SCAN_PATH | grep LOST | cut -f2 -d'%' | tr -d ' '); do echo "deleting $k"; $ALLUXIO_CMD fs rm $k;done | |
$ALLUXIO_CMD fs ls -fR $SCAN_PATH | grep LOST | cut -f2- -d'%' | xargs -P 30 -I{} $ALLUXIO_CMD fs rm '{}' |
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
def greedySetCover(targetSet, subSets): | |
if not subSets: | |
return None | |
probeKey = max(subSets, key=lambda x: len(targetSet.intersection(subSets[x]))) | |
probeSet = subSets[probeKey] | |
#result = set() | |
resKeys = set() | |
while len(targetSet) > 0: | |
#result.update(probeSet) | |
targetSet = targetSet.difference(probeSet) |
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
SELECT description FROM pg_catalog.pg_description WHERE objsubid = | |
( | |
SELECT ordinal_position FROM information_schema.columns WHERE table_name='YOUR_TABLE_NAME' AND column_name='YOUR_COLUMN_NAME' | |
) | |
and objoid = | |
( | |
SELECT oid FROM pg_class WHERE relname = 'YOUR_TABLE_NAME' AND relnamespace = | |
( | |
SELECT oid FROM pg_catalog.pg_namespace WHERE nspname = 'public' | |
) |
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
def fetchLinesByMarker(ffile, lineMarker): | |
buff = [] | |
for ln in ffile: | |
if ln.startswith(lineMarker): | |
if buff: | |
yield(''.join(buff)) | |
del(buff[:]) | |
buff.append(ln) | |
yield(''.join(buff)) |
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
sudo -u hdfs hadoop fsck / -files -blocks | grep BAD_BLOCK_ID -B 5 |
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
package com.hiveextensions.udf; | |
import java.security.MessageDigest; | |
import java.security.NoSuchAlgorithmException; | |
import org.apache.hadoop.hive.ql.exec.UDF; | |
public final class CryptoHash extends UDF { | |
public String evaluate(final String s, final String algorithm) { |
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
diff <(hadoop fs -ls /user/mapred/ | cut -f4 -d'/' | sort -u) <(hadoop fs -ls /user/mapred/*/*_data/$(date +%Y%m%d)* | cut -f4 -d'/' | sort -u) | grep '<' | cut -f2 -d'<' |
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
hadoop job -list | grep job_ | awk 'BEGIN{FS="\t";OFS=","};{print $1,strftime("%H:%M:%S", (systime()-int($3/1000)),1),"\""$4"\"","\""$6"\""}' |