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
null=None | |
true=True | |
false=False |
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
# zsh prompt: | |
export PROMPT="%/ %% " | |
# zsh styles: | |
export CLICOLOR=1 | |
export STYLE_COLOR_RED="\x1b[31;01m" | |
export STYLE_COLOR_GREEN="\x1b[32;01m" | |
export STYLE_COLOR_BLUE="\x1b[34;01m" | |
export STYLE_UNDERLINE="\x1b[04;01m" | |
export STYLE_BLINK="\x1b[05;01m" |
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
function hosts() { | |
if [ $# -eq 0 ]; then | |
hosts_file_num_lines=$(wc -l /etc/hosts | awk '{print $1}') | |
marker_string_frequency=$(grep StevenBlack /etc/hosts | wc -l) | |
if [ "$marker_string_frequency" -gt 1 ]; then | |
echo -e $COLOR_GREEN"/etc/hosts file contains entries for AdBlock"$COLOR_RESET" (contains $hosts_file_num_lines lines)" | |
else | |
echo -e $COLOR_GREEN"/etc/hosts file is right now pristine"$COLOR_RESET" (contains $hosts_file_num_lines lines)" | |
fi | |
elif [ $# -eq 1 ]; then |
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 manu.sandbox.demos.hadoop; | |
import org.apache.hadoop.conf.Configuration; | |
import org.apache.hadoop.fs.FileSystem; | |
import org.apache.hadoop.fs.Path; | |
import org.apache.hadoop.io.IntWritable; | |
import org.apache.hadoop.io.LongWritable; | |
import org.apache.hadoop.io.Text; | |
import org.apache.hadoop.mapreduce.Job; | |
import org.apache.hadoop.mapreduce.Mapper; |
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
class NetworkUtils { | |
public static String getLocalIp() { | |
try { | |
Enumeration<NetworkInterface> interfaces = NetworkInterface.getNetworkInterfaces(); | |
while (interfaces.hasMoreElements()) { | |
NetworkInterface networkInterface = interfaces.nextElement(); | |
if (networkInterface.isLoopback() || !networkInterface.isUp() || networkInterface.isVirtual() || networkInterface.isPointToPoint()) { | |
continue; | |
} | |
Enumeration<InetAddress> addresses = networkInterface.getInetAddresses(); |
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 manu.sandbox.utils; | |
import java.util.Deque; | |
import java.util.LinkedList; | |
/** | |
* Helps you generate possible combinations of array of arrays in a thread-safe way | |
*/ | |
public class CombinationGenerator<T> { | |
private final Deque<T> buffer = new LinkedList<>(); |
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 manu.sandbox.utils; | |
import java.math.BigDecimal; | |
import java.math.BigInteger; | |
import java.util.ArrayList; | |
import java.util.HashMap; | |
import java.util.List; | |
import java.util.Map; | |
import java.util.concurrent.*; |
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 manu.sandbox.utils; | |
import java.util.*; | |
public class AverageCalculator { | |
private static class FrequencyComparator implements Comparator<Double> { | |
private final Map<Double, Integer> histogram; |
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 manu.sandbox.demos; | |
import com.fasterxml.jackson.annotation.JsonValue; | |
import com.google.common.collect.Sets; | |
import java.util.HashMap; | |
import java.util.Map; | |
import java.util.Set; | |
/** |
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
import org.apache.hadoop.conf.Configuration; | |
import org.apache.hadoop.hbase.HBaseConfiguration; | |
import org.apache.hadoop.hbase.KeyValue; | |
import org.apache.hadoop.hbase.client.*; | |
import org.apache.hadoop.hbase.ipc.HBaseRPC; | |
import org.apache.hadoop.hbase.ipc.HMasterInterface; | |
import org.apache.hadoop.hbase.ipc.RpcEngine; | |
import org.apache.hadoop.hbase.util.Bytes; | |
import java.io.IOException; |
NewerOlder