Skip to content

Instantly share code, notes, and snippets.

View informationsea's full-sized avatar

Yasunobu Okamura informationsea

View GitHub Profile
#include <stdio.h>
#include <windows.h>
#include <tlhelp32.h>
#include <tchar.h>
#include <stdbool.h>
#include <process.h>
#include <errno.h>
#ifdef _DEBUG
void printError( TCHAR* msg );
@informationsea
informationsea / android-convert.sh
Created June 23, 2015 17:29
Convert SVG images to Android icons
#!/bin/zsh
for i in *.svg; do
inkscape -e ../res/drawable-hdpi/${i%.svg}.png -w 48 -h 48 $i
inkscape -e ../res/drawable-mdpi/${i%.svg}.png -w 32 -h 32 $i
inkscape -e ../res/drawable-xhdpi/${i%.svg}.png -w 64 -h 64 $i
inkscape -e ../res/drawable-xxhdpi/${i%.svg}.png -w 96 -h 96 $i
done
inkscape -e ../ic_launcher.png -w 512 -h 512 ic_launcher.svg
@informationsea
informationsea / .tmux.conf
Last active September 7, 2016 13:35
Terminal Multiplexer Configuration
set -g prefix C-z
#set -g status-attr bold
set -g status-bg white
set -g status-fg blue
set -g set-titles on
#set-option -g status-right '#[bg=red] #(echo $USER)@#H #[bg=blue,bold,fg=white] %y/%m/%d (%a) %H:%M' # change by .zshrc
set-option -g status-right "#[bg=blue,bold,fg=white] #(cut -d ' ' -f 1-3 /proc/loadavg) #[bg=red,fg=white] $USER@#h #[bg=blue,bold,fg=white] %Y/%m/%d (%a) %H:%M"
set-option -g status-right-length 80
set-option -g history-limit 10000
#set-window-option -g utf8 on
@informationsea
informationsea / myinline.patch
Created April 13, 2015 10:48
Emacs 24.5 Japanese-English patch
diff --git a/configure.ac b/configure.ac
index 4291453..1ed10b6 100644
--- a/configure.ac
+++ b/configure.ac
@@ -4876,7 +4876,7 @@ case "$opsys" in
## only costs about 1.5K of wasted binary space.
headerpad_extra=1000
if test "$HAVE_NS" = "yes"; then
- libs_nsgui="-framework AppKit"
+ libs_nsgui="-framework AppKit -framework Carbon"
@informationsea
informationsea / deploy-ssh-keys.py
Last active December 18, 2015 08:24
Deploy SSH authorized keys to remote servers
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (C) 2014 Yasunobu OKAMURA
# License: GPL v3 or later
import argparse
import subprocess
import re
import collections
;;configuration for supervisor
[program:munin-graph]
command=spawn-fcgi -u munin -g munin -U nginx -s /var/run/munin/fcgi-graph.sock -S -M 0600 -n -- /var/www/cgi-bin/munin-cgi-graph
@informationsea
informationsea / sensors_temp
Created December 30, 2014 01:42
Munin plugin for Raspberry Pi & ADT7410
. $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
@informationsea
informationsea / ssh-authorized-key-chcker.py
Last active December 18, 2015 08:27
Check ssh authorized keys in remote hosts
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (C) 2014 Yasunobu OKAMURA
# License: GPL v3 or later
import argparse
import subprocess
import re
import collections
@informationsea
informationsea / codesign.sh
Created September 21, 2014 06:09
Code sign script for Qt based application
#!/bin/sh
QTPATH=/usr/local/Qt-5.3.2-systemsqlite
CODE_SIGN_IDENTITY="Developer ID Application: YOURID"
APPNAME=APP.app
for i in `find ${APPNAME}/Contents/Frameworks -name '*.framework'`; do
BASENAME="${i##*/}"
pushd $i
@informationsea
informationsea / index.py
Created September 15, 2014 13:55
Gist List view
import sys
sys.path.insert(0, 'flask.zip')
sys.path.insert(0, 'werkzeug.zip')
from flask import Flask, render_template, request, abort, redirect, url_for
import json
import urllib2
import re
app = Flask(__name__)