Skip to content

Instantly share code, notes, and snippets.

View informationsea's full-sized avatar

Yasunobu Okamura informationsea

View GitHub Profile
@informationsea
informationsea / japan-ip.txt
Last active December 22, 2015 01:29
IPv4 addresses assigned to Japan (20130831 update)
1.0.16.0/20
1.0.64.0/18
1.1.64.0/18
1.5.0.0/16
1.21.0.0/16
1.33.0.0/16
1.66.0.0/15
1.72.0.0/13
1.112.0.0/14
14.0.8.0/22
@informationsea
informationsea / outofjapan-ip.txt
Created August 31, 2013 09:38
IPv4 addresses which is not assigned to Japan and private, link local, multicast, loopback
0.0.0.0/8
1.0.0.0/20
1.0.32.0/19
1.0.128.0/17
1.1.0.0/18
1.1.128.0/17
1.2.0.0/15
1.4.0.0/16
1.6.0.0/15
1.8.0.0/13
@informationsea
informationsea / make-ip-list.py
Last active December 22, 2015 01:29
Make IP address list of Japan
#!/usr/bin/env python
# Copyright (C) 2013 Yasunobu OKAMURA
# GPLv3 or later
import argparse
import ipaddress # pip install py2-ipaddress
def inverse_range(addr_range):
"""
@informationsea
informationsea / reformat_fasta.py
Created September 22, 2013 15:00
Re-format FASTA file.
#!/usr/bin/env python
import argparse
import sys
import Bio.SeqIO
def _main():
parser = argparse.ArgumentParser(description="Re-format fasta file")
parser.add_argument('input', default=sys.stdin, nargs='?')
parser.add_argument('output', default=sys.stdout, nargs='?')
# -*- shell-script -*-
# If not running interactively, don't do anything
[ -z "$PS1" ] && return
# ==== system configuration ====
if [ -f /etc/bashrc ]; then
. /etc/bashrc
fi
@informationsea
informationsea / count-bam.py
Created October 8, 2013 03:44
Count mapped reads and unmapped reads in bam files.
#!/usr/bin/env python
import argparse
import pysam
def _main():
parser = argparse.ArgumentParser(description="Count mapped reads and unmapped reads")
parser.add_argument('bam', nargs='+')
options = parser.parse_args()
@informationsea
informationsea / growl.applescript
Created November 5, 2013 03:08
Growl script for Maverick's Message
on showgrowl(theNotify, theImage, theTitle, theMessage)
tell application "Growl"
-- Make a list of all the notification types
-- that this script will ever send:
set the allNotificationsList to ¬
{"Login", "Logout", "Present", "Text Message", "Invitation", "File Transfer Completed"}
-- Make a list of the notifications
-- that will be enabled by default.
-- Those not enabled by default can be enabled later
@informationsea
informationsea / tweet.py
Created December 11, 2013 12:20
Twitter Post
#!/usr/bin/env python
import argparse
import twitter
def _main():
parser = argparse.ArgumentParser(description="Tweet something")
parser.add_argument('status')
options = parser.parse_args()
@informationsea
informationsea / ipmitoolsensor.sh
Created December 19, 2013 03:58
Munin plugin
#!/bin/sh
#. $MUNIN_LIBDIR/plugins/plugin.sh
TEMP=`ipmitool sensor|grep 'Temp'`
NUM=`echo "$TEMP"|wc -l`
if [ "$1" == "config" ];then
cat <<EOF
graph_title Temperatures
@informationsea
informationsea / post-macdeployqt.sh
Created February 15, 2014 17:03
Sign Qt based application
#!/bin/sh
if [ ! "$3" ]; then
echo $0 QTPREFIX APP INDENTIFY
exit 1
fi
prefix=$1
app=$2
id=$3