Skip to content

Instantly share code, notes, and snippets.

Avatar
🏠
Working from home

Istvan l1x

🏠
Working from home
View GitHub Profile
View golang_bashrc.sh
export PATH=$PATH:~/go/bin
export GOROOT=$HOME/go
export GOPATH=$HOME/gopath
View java.sh
alternatives --install /usr/bin/java java /usr/java/jdk1.7.0_51/bin/java 2
update-alternatives --config java
View riak_client.go
package main
import (
"fmt"
"log"
"strconv"
"github.com/tpjg/goriakpbc"
)
func main() {
View riemann.test.rb
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)
View hashing.clj
(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"))
View sshd_config
StrictModes yes
Protocol 2
AddressFamily inet
ListenAddress 0.0.0.0
LoginGraceTime 60
PermitRootLogin yes
IgnoreRhosts yes
PubKeyAuthentication yes
AuthorizedKeysFile .ssh/authorized_keys
View minutes.clj
(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]
View python_demo.txt
[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
View distcp_s3.sh
hadoop distcp s3n://<key>:<secret>@mybucket/dir hdfs://target/
View gist:9011482
CREATE EXTERNAL TABLE uservisits(
sourceIP STRING,
destURL STRING,
visitDate TIMESTAMP,
adRevenue FLOAT,
userAgent STRING,
countryCode STRING,
languageCode STRING,
searchWord STRING,
duration INT
You can’t perform that action at this time.