Skip to content

Instantly share code, notes, and snippets.

View informationsea's full-sized avatar

Yasunobu Okamura informationsea

View GitHub Profile
@informationsea
informationsea / arrayrunner.py
Last active October 7, 2015 13:48
GridEngine Array Job Support Tool
#!/usr/bin/env python
import argparse
import os
import subprocess
import shlex
import sys
def _main():
"""
@informationsea
informationsea / gist:3192226
Created July 28, 2012 07:16
Density plot with grid
library(lattice)
gridensityplot <- function(...) {
densityplot(..., panel=function(...) {
panel.grid(h=-1, v=-1)
panel.densityplot(...)
})
}
@informationsea
informationsea / gist:3192275
Created July 28, 2012 07:39
Draw Heatmap with R
library(lattice)
library(gregmisc)
myxyplot <- function(x, y,
xlab=deparse(substitute(x)),
ylab=deparse(substitute(y)),
xlim,
ylim,
nbins=c(50, 50), alpha=0.05, func=function(x){x}, sub="", heat.map=T) {
c <- cor.test(x, y)
@informationsea
informationsea / transpose.py
Created August 30, 2012 11:20
Transpose Text Matrix
#!/usr/bin/env python
import argparse
import sys
import itertools
def _main():
parser = argparse.ArgumentParser(description='Transpose text array')
parser.add_argument('input', default=sys.stdin, nargs='?', type=argparse.FileType('r'))
parser.add_argument('output', default=sys.stdout, nargs='?', type=argparse.FileType('r'))
@informationsea
informationsea / gist:3747741
Created September 19, 2012 04:51
Draw bw-plot
library(lattice)
mybwplot <- function(x, y, interval=0.2, ylab=deparse(substitute(y)), xlab=deparse(substitute(x)), main="", sub="") {
bwplot(y ~ factor(trunc(x/interval)*interval), xlab=xlab, ylab=ylab, main=main, sub=sub,
panel=function(...){
panel.grid(h=-1, v=0)
panel.bwplot(...)
}, scales=list(rot=c(45,0)))
}
@informationsea
informationsea / growl.applescript
Created September 19, 2012 05:20
Message notify with growl on Mountain Lion
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"}
-- Make a list of the notifications
-- that will be enabled by default.
-- Those not enabled by default can be enabled later
@informationsea
informationsea / fixpermission.py
Created October 27, 2012 17:35
Fix permission by suffix of filename and prefix of file
#!/usr/bin/env python
import argparse
import os
import os.path
import stat
def _main():
parser = argparse.ArgumentParser(description='fix permission by suffix of filename and prefix of file')
parser.add_argument('dir', default='.', nargs='?', help='fix directory (default:%(default)s)')
@informationsea
informationsea / gist:4131400
Created November 22, 2012 14:20
Density plot with grid and summary
library(lattice)
library(grid)
mydensityplot <- function(data, xlab=deparse(substitute(data)), grid=F, summary=F, ...) {
densityplot(data, xlab=xlab, ...,
panel=function(...){
if (grid) {
panel.grid(h=-1, v=-1)
}
if (summary) {
@informationsea
informationsea / gist:4148022
Created November 26, 2012 12:44
Munin plugin for Raspberry Pi / cpuspeed
#!/bin/sh
# -*- sh -*-
: << =cut
=head1 NAME
cpuspeed - Plugin to monitor CPU speed
=head1 APPLICABLE SYSTEMS
@informationsea
informationsea / gist:4148209
Created November 26, 2012 13:29
Munin plugin for Raspberry Pi / sensors_temp
. $MUNIN_LIBDIR/plugins/plugin.sh
if [ "$1" = "autoconf" ]; then
if [ -r /sys/class/thermal/thermal_zone0/temp ];then
echo yes
exit 0
else
echo "no (missing /sys/class/thermal/thermal_zone0/temp)"
exit 0
fi