Skip to content

Instantly share code, notes, and snippets.

@is
is / settings.xml
Created September 25, 2010 06:52
My maven settings file
<settings>
<mirrors>
<mirror>
<id>nexus</id>
<mirrorOf>*</mirrorOf>
<url>http://si.io8.org/nexus/content/groups/public</url>
</mirror>
</mirrors>
<profiles>
@is
is / msgpack-http.py
Created September 27, 2010 16:11
Sample code, msgpack over http post in Python.
import msgpack
import urllib2
def main():
m = msgpack.packb(['hello', 12])
u = urllib2.urlopen('http://localhost:8080/0', m)
s = u.read()
u.close()
print (len(m), len(s))
@is
is / ScribeBuildNote.txt
Created November 14, 2010 11:30
Scribe Build Note
Common:
* add "-lrt" for libevent dependency
RHEL/Centos 5
RHEL/Centos 4
* zlib's version is 1.2.1, thrift 0.5.0 need is 1.2.3.
* link boost/tr1/tr1 to include directory.
@is
is / gist:1300210
Created October 20, 2011 01:45
cherokee-admin error in restricted network.
[root@ci2 app]# /is/app/cherokee/sbin/cherokee-admin -b 0.0.0.0 -i -x -u
[20/10/2011 09:46:12.488] (warning) rrd_tools.c:121 - Could not find the
rrdtool binary. | A custom rrdtool binary has not been defined, and the
server could not find one in the $PATH.
Cherokee Web Server 1.2.100 (Oct 19 2011): Listening on port 0.0.0.0:9090, TLS
disabled, IPv6 enabled, using epoll, 4096 fds system limit, max. 2041
connections, 2 threads, 1020 connections per thread, standard scheduling policy
Web Interface:
@is
is / fresh-zone-serial.py
Created October 7, 2012 14:48
Increase bind zone serial by python script
#!/usr/bin/python
import os, sys
def fresh_serial(fn):
fin = file(fn, 'r')
lines = fin.readlines()
fin.close()
ols = []
for line in lines:
@is
is / build.gradle
Created October 15, 2012 16:44
Gradle read package information from POM file
defaultTasks 'hello'
repositories {
mavenCentral()
}
configurations {
mavenAntTasks
}
@is
is / gist:3968764
Created October 28, 2012 14:34
Convert String array to byte[][] in JRuby
tsbegin = Time.gm(2012, 8, 10)
tsend = Time.gm(2012, 10, 30)
tsadd = 3600 * 6
splits = Array.new
while tsbegin < tsend do
splits << tsbegin.strftime("%Y%m%d%H%M").to_java_bytes
tsbegin += tsadd
end
@is
is / TransmissionClient.scala
Created March 21, 2013 16:36
Set X-Transmission-Session-Id when return code == 409
// If Code == 409, Set X-Transmission-Session-Id and retry.
def httpX[T](x: Handler[T]): HttpPackage[T] = {
val hand = x.copy(request = x.request <:< Map("X-Transmission-Session-Id" -> sessId))
var is409: Boolean = false
val r = http.x(hand.copy(
block = { (code, res, ent) =>
if (code != 409)
hand.block(code, res, ent)
else {
@is
is / config
Created March 27, 2013 14:21
ssh_config
Host *
StrictHostKeyChecking no
@is
is / sync.sh
Created April 14, 2013 05:35
sync postgresql yum repo
# http://yum.postgresql.org/repopackages.php#pg92
yum install -y http://yum.postgresql.org/9.2/redhat/rhel-6-x86_64/pgdg-centos92-9.2-6.noarch.rpm
mkdir -p /data/repos
cd /data/repos
reposync -r pgdg92,pgdg92-source -s