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
# pfreixes, 2012-07-27 | |
# Add to /etc/bash_completion.d/supervisorctl | |
_supervisor() | |
{ | |
local cur prev opts base | |
COMPREPLY=() | |
cur="${COMP_WORDS[COMP_CWORD]}" | |
prev="${COMP_WORDS[COMP_CWORD-1]}" |
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 main | |
import ( | |
"log" | |
"flag" | |
"net" | |
"strings" | |
"time" | |
"os" | |
"os/signal" |
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
upstream plik { | |
server 127.0.0.1:8080; | |
server 127.0.0.1:8081; | |
} | |
upstream stream { | |
server 127.0.0.1:8080; | |
server 127.0.0.1:8081; | |
hash $key; | |
} |
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
/* | |
* Copyright (C) 2014 The Async HBase Authors. All rights reserved. | |
* This file is part of Async HBase. | |
* | |
* Redistribution and use in source and binary forms, with or without | |
* modification, are permitted provided that the following conditions are met: | |
* - Redistributions of source code must retain the above copyright notice, | |
* this list of conditions and the following disclaimer. | |
* - Redistributions in binary form must reproduce the above copyright notice, | |
* this list of conditions and the following disclaimer in the documentation |
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 utils | |
/* | |
* Charles-Antoine.Mathieu <[email protected]> | |
* CIDR tree for blacklist matching purpose. | |
* | |
* It's actually a simple binary tree with each node matching a byte | |
* of the cidr until the mask is exhausted. The tree has to be walked | |
* from the root following one of the two available pointers depending | |
* if the ip to be matched is above of below the median stored in the node. |
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
The simplest definition I can give for Big-O notation is this: | |
Big-O notation is a relative representation of the complexity of an algorithm. | |
There are some important and deliberately chosen words in that sentence: | |
relative: you can only compare apples to apples. You can't compare an algorithm to do arithmetic multiplication to an algorithm that sorts a list of integers. But a comparison of two algorithms to do arithmetic operations (one multiplication, one addition) will tell you something meaningful; | |
representation: Big-O (in its simplest form) reduces the comparison between algorithms to a single variable. That variable is chosen based on observations or assumptions. For example, sorting algorithms are typically compared based on comparison operations (comparing two nodes to determine their relative ordering). This assumes that comparison is expensive. But what if comparison is cheap but swapping is expensive? It changes the comparison; and | |
complexity: if it takes me one second to sort 10,000 elements h |
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/sh | |
# Small script to setup the HBase tables used by OpenTSDB. | |
# Taken from git://github.com/stumbleupon/opentsdb.git | |
# Version: 1.1.0 | |
test -n "$HBASE_HOME" || { | |
echo >&2 'The environment variable HBASE_HOME must be set' | |
exit 1 | |
} | |
test -d "$HBASE_HOME" || { |
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 | |
### | |
# Charles-Antoine Mathieu <[email protected]> | |
# | |
# Parse memstore flushes in hbase rs logs (tested against hbase 0.96) | |
# $1 : rs log file | |
# $2 : command : flush | major | |
### |
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
''=~('('."\?". | |
'{'.('`'|'%').('['^'-' | |
).('`'|'!'). ("\`"| ',' | |
).'"'.('['^'.'). ((( '[' | |
))^'(').('`'|('%')).( '{' | |
^'[').('{'^'/').('`'|')') .+( | |
'`'|'-').('`'|'%').':'.':'.( '`' | |
^'(').('`'|')').('{'^')').( '`' | |
|(( '%'))).('['^'(').'\\'.'"' .+( | |
'[' ^'.').('['^'(').("\`"| ',' |