Skip to content

Instantly share code, notes, and snippets.

View hansode's full-sized avatar

Masahito Yoshida hansode

View GitHub Profile
@hansode
hansode / gist:755936
Last active September 24, 2015 13:37
IP packets debug with netfilter(iptables)
#!/bin/bash
#
#
#
nic=${1:-'eth0'}
#vif-jly0dfqe
bounds="s d"
cmds="F X Z"
@hansode
hansode / gist:759431
Created December 30, 2010 03:52
IP packets debug with netfilter(ebtables)
#!/bin/sh
#
#
#
nic=${1:-'eth0'}
#vif-jly0dfqe
protocol_maps="
ip4=ip4
ip6=ip6
arp=arp
@hansode
hansode / gen-selfsigned-cert.sh
Created August 2, 2011 20:00
Generate Self-Signed Certificate
#!/bin/sh
#
# based on http://sourcery.blogspot.com/2007/09/script-for-openssl-certificate-signing.html
#
set -e
C=
ST=
L=
@hansode
hansode / pararell-curl.sh
Created September 9, 2011 07:25
pararell-curl.sh
#!/bin/bash
#
# $ pararell-curl.sh --url=[url]
# $ pararell-curl.sh --url=[url] --thread=6
#
LANG=C
LC_ALL=C
set -e
@hansode
hansode / mirror-epel.sh
Created October 28, 2011 08:40
mirror part(s) of epel repository.
#!/bin/bash
pkg_keywords="^erlang|^wx"
rhel_ver=6
arch=x86_64
base_uri=http://download.fedora.redhat.com/pub/epel/${rhel_ver}/${arch}
wget_opts="-m --no-parent"
wget ${wget_opts} ${base_uri}/repodata/
@hansode
hansode / Makefile
Created November 14, 2011 05:53
bridge & bonding configuration files of rhel on virtualbox
all: deploy setup
restart:
/etc/init.d/network restart
setup:
yum install bridge-utils
modprobe bonding
deploy:
@hansode
hansode / build-bundled-tarball.sh
Created November 21, 2011 09:19
build local gem repository from Gemfile(s)
#!/bin/sh
#
#
set -e
LANG=C
LC_ALL=C
tarball=$1
[ $# = 1 ] || {
@hansode
hansode / _config.sh.example
Created December 5, 2011 10:21
build and deploy project(s)
prefix=/home/wakame
git_repo_maps="
wakame-adapters=git://github.com/axsh/wakame-adapters.git
wakame-vdc=git://github.com/axsh/wakame-vdc.git
"
initscript=./initializer/initscript.sh
environment=development
#environment=integration
@hansode
hansode / dump-metadata.sh
Created December 19, 2011 03:11
Dump Amazon EC2 metadata server's params.
#!/bin/bash
#
# $ ./dump-metadata.sh [ PARAM ]...
#
# $ ./dump-metadata.sh
# $ ./dump-metadata.sh /
# $ ./dump-metadata.sh /ami-id
# $ ./dump-metadata.sh /public-ipv4
# $ ./dump-metadata.sh /ami-id /public-ipv4
#
@hansode
hansode / Makefile
Created February 14, 2012 09:54
MapReduce.sh
all: prepare
prepare: RFC-all.tar.gz rfc/rfc1.txt
rfc/rfc1.txt:
[ -d rfc ] || mkdir rfc
cd rfc && tar zxvf ../RFC-all.tar.gz
RFC-all.tar.gz:
curl --ftp-pasv ftp://ftp.rfc-editor.org/in-notes/tar/RFC-all.tar.gz -o $@