Skip to content

Instantly share code, notes, and snippets.

@spikeekips
spikeekips / es-dump-index.py
Last active Aug 15, 2021
The simple script to dump the data from ElasticSearch for inserting by bulk API.
View es-dump-index.py
# -*- coding: utf-8 -*-
"""
################################################################################
Dump ElasticSearch index for inserting BULK
################################################################################
requires `rawes`.
for more details, run `-h` to show help message.
@spikeekips
spikeekips / etcd-cluster.sh
Last active Aug 29, 2015
simple `etcd` cluster launch script for latest linux.
View etcd-cluster.sh
#!/bin/sh
n=$1
args=$(echo $@ | sed -e "s/^$1//g")
ip=$(ip addr show eth0 | grep '\<inet\>' | awk '{print $2}' | sed -s 's/\/.*//g')
./etcd \
-bind-addr=0.0.0.0 \
@spikeekips
spikeekips / serf-rpc-client.py
Last active Aug 29, 2015
naughty rpc client for `serf` for python
View serf-rpc-client.py
import logging
import msgpack
import socket
import threading
import string
DEFAULT_IPC_VERSION = 1
DEFAULT_READ_BUFFER_SIZE = 8192 *100
DEFAULT_HOST = '127.0.0.1'
@spikeekips
spikeekips / run-serf-agent.sh
Created Mar 7, 2014
simple `serf` agent launch script
View run-serf-agent.sh
#!/bin/sh
n=$1
args=$(echo $@ | sed -e "s/^$1//g")
if [ "$(uname)" == "Darwin" ];then
ips=$(ifconfig | grep '\<inet\>' | awk '{print $2}')
for i in $ips
do
echo $i | grep '^127\.' &>/dev/null
@spikeekips
spikeekips / serializing-python-object-msgpack-vs-json.ipynb
Last active Aug 29, 2015
Comparison Of The Serializing Python Object - msgpack vs. j(b)son
View serializing-python-object-msgpack-vs-json.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@spikeekips
spikeekips / locmemcache.py
Created Apr 23, 2014
persistant `LocMemCache` without checking expiry.
View locmemcache.py
import sys
from django.core.cache.backends.locmem import LocMemCache as LocMemCache_django
class LocMemCache (LocMemCache_django, ) :
def __init__ (self, name, params, ) :
params['max_entries'] = sys.maxint
super(LocMemCache, self).__init__(name, params, )
def has_key(self, key, version=None):
@spikeekips
spikeekips / gist:d4e2c3eb0e587fc0de07
Last active Aug 29, 2015
Send directory using `tar` and `nc`
View gist:d4e2c3eb0e587fc0de07
@spikeekips
spikeekips / parse_unity_build_warnings.py
Created Aug 1, 2014
Parse Unity3d error and warning log from file.
View parse_unity_build_warnings.py
# -*- coding: utf-8 -*-
import sys
import re
import csv
import StringIO
WARNINGS = dict(
_never_used_=lambda x : x.get('message').find(' never used') != -1,
@spikeekips
spikeekips / gist:bfaa9216894704d19964
Created Apr 28, 2015
Install and Running MySQL in OSX
View gist:bfaa9216894704d19964

Install and Running MySQL in OSX

Install MySQL

$  uname -a
Darwin bebop.local 14.3.0 Darwin Kernel Version 14.3.0: Mon Mar 23 11:59:05 PDT 2015; root:xnu-2782.20.48~5/RELEASE_X86_64 x86_64
$ xcode-select -v
xcode-select version 2339.
$ brew -v install mysql
@spikeekips
spikeekips / activate_go.sh
Created May 7, 2015
workspace manager for python virtualenv and golang
View activate_go.sh
root=$(cd $(dirname ${BASH_SOURCE})/../; pwd)
export VIRTUALENV_GO=$root
export GOPATH=$VIRTUALENV_GO
export GOBIN=$VIRTUALENV_GO/bin
export PATH=$VIRTUALENV_GO/bin:$PATH