Skip to content

Instantly share code, notes, and snippets.

View l1x's full-sized avatar
🏠
Working from home

Istvan l1x

🏠
Working from home
View GitHub Profile
export PATH=$PATH:~/go/bin
export GOROOT=$HOME/go
export GOPATH=$HOME/gopath
package main
import (
"fmt"
"log"
"strconv"
"github.com/tpjg/goriakpbc"
)
func main() {
@l1x
l1x / java.sh
Created January 30, 2014 04:22
alternatives --install /usr/bin/java java /usr/java/jdk1.7.0_51/bin/java 2
update-alternatives --config java
class Riemann::Bench
attr_accessor :client, :hosts, :services, :states
def initialize
@hosts = [nil] + (0...100).map { |i| "host#{i}" }
@services = %w(test1 test2 test3 foo bar baz xyzzy attack cat treat)
@states = {}
@client = Riemann::Client.new(:host => (ARGV.first || 'localhost'))
end
def evolve(state)
@l1x
l1x / hashing.clj
Last active August 29, 2015 13:55
(ns clj-hashing
(:import
[com.google.common.hash Hashing HashFunction HashCode ]
[java.nio.charset Charset ]))
(def ^:private ^HashFunction murmur-fun (Hashing/murmur3_128))
(def ^:private ^HashFunction sha1-fun (Hashing/sha1))
(def ^:private ^HashFunction md5-fun (Hashing/md5))
(def ^:private ^sun.nio.cs.UTF_8 utf8-chr-set (Charset/forName "UTF-8"))
@l1x
l1x / sshd_config
Last active August 29, 2015 13:56
StrictModes yes
Protocol 2
AddressFamily inet
ListenAddress 0.0.0.0
LoginGraceTime 60
PermitRootLogin yes
IgnoreRhosts yes
PubKeyAuthentication yes
AuthorizedKeysFile .ssh/authorized_keys
(defn epoch
"Returns (System/currentTimeMillis)/1000"
[]
(int (/ (System/currentTimeMillis) 1000)))
(defn epoch-min
"Returns the epoch-min, to any epoch input
epoch min is the the last minute's epoch value
1390086540 1390086600 1390086660"
[epoch]
[vagrant@vagrant-centos64 ~]$ export PATH=$PATH:/opt/rr/py27/bin
[vagrant@vagrant-centos64 ~]$ grep conf ~/.bash_history ^C
[vagrant@vagrant-centos64 ~]$ virtualenv sergey
New python executable in sergey/bin/python2.7
Also creating executable in sergey/bin/python
Installing setuptools, pip...done.
[vagrant@vagrant-centos64 ~]$ ls -larth sergey/
total 20K
drwxrwxr-x 3 vagrant vagrant 4.0K Feb 11 22:51 lib
drwxrwxr-x 2 vagrant vagrant 4.0K Feb 11 22:51 include
hadoop distcp s3n://<key>:<secret>@mybucket/dir hdfs://target/
CREATE EXTERNAL TABLE uservisits(
sourceIP STRING,
destURL STRING,
visitDate TIMESTAMP,
adRevenue FLOAT,
userAgent STRING,
countryCode STRING,
languageCode STRING,
searchWord STRING,
duration INT