Skip to content

Instantly share code, notes, and snippets.

let g:blogger_blogid = "99999999999999999999"
let g:blogger_email = "[email protected]"
let g:blogger_pass = "password"
let g:blogger_ruby_path = "/usr/local/bin/ruby"
@r-plus
r-plus / check_sh_variables_declaration.py
Last active December 10, 2015 03:28
Check variables declaration for shell script.
#!/usr/bin/env python
# require: python 2.4+
# usage: python sh_declaration_checker.py < sample.sh
from re import findall
from sys import stdin
usedVarlist = set()
declaredVarlist = set()
@r-plus
r-plus / ios601_springboard_frameworks
Created December 30, 2012 04:06
iOS 6.0.1 SpringBoard linking frameworks.
SpringBoard:
/System/Library/PrivateFrameworks/StoreServices.framework/StoreServices (compatibility version 1.0.0, current version 1.0.0)
/System/Library/PrivateFrameworks/AirTraffic.framework/AirTraffic (compatibility version 1.0.0, current version 116.0.0)
/System/Library/PrivateFrameworks/IOSurface.framework/IOSurface (compatibility version 1.0.0, current version 1.0.0)
/System/Library/PrivateFrameworks/MultitouchSupport.framework/MultitouchSupport (compatibility version 1.0.0, current version 240.20.0)
/System/Library/PrivateFrameworks/MobileWiFi.framework/MobileWiFi (compatibility version 1.0.0, current version 1.0.0)
/usr/lib/libIOAccessoryManager.dylib (compatibility version 1.0.0, current version 1.0.0)
/System/Library/PrivateFrameworks/IOMobileFramebuffer.framework/IOMobileFramebuffer (compatibility version 1.0.0, current version 1.0.0)
/System/Library/PrivateFrameworks/CoreSurface.framework/CoreSurface (compatibility version 1.0.0, current version 1.0.0)
/System/Library/PrivateFrameworks/B
@r-plus
r-plus / ios601_backboardd_frameworks
Created December 30, 2012 04:08
iOS 6.0.1 backboardd linking frameworks
backboardd:
/usr/lib/libsp.dylib (compatibility version 1.0.0, current version 1.0.0)
/System/Library/PrivateFrameworks/CrashReporterSupport.framework/CrashReporterSupport (compatibility version 1.0.0, current version 1.0.0)
/usr/lib/liblockdown.dylib (compatibility version 1.0.0, current version 1.0.0)
/System/Library/PrivateFrameworks/IOMobileFramebuffer.framework/IOMobileFramebuffer (compatibility version 1.0.0, current version 1.0.0)
/System/Library/PrivateFrameworks/IOSurface.framework/IOSurface (compatibility version 1.0.0, current version 1.0.0)
/System/Library/PrivateFrameworks/AggregateDictionary.framework/AggregateDictionary (compatibility version 1.0.0, current version 1.0.0)
/System/Library/Frameworks/CoreGraphics.framework/CoreGraphics (compatibility version 64.0.0, current version 600.0.0)
/System/Library/Frameworks/SystemConfiguration.framework/SystemConfiguration (compatibility version 1.0.0, current version 499.0.0)
/System/Library/Frameworks/IOKit.framework/Versions/A/IOKit (compat
@r-plus
r-plus / zabbix_item_app_mod.py
Created January 23, 2013 02:34
zabbixのホスト設定をエクスポートしたXMLの全ての監視アイテムのアプリケーション値を設定する。
#!/usr/bin/env python
#
# Usage: python hoge.py xmlfile configfile
# configfile format:
# <Prefix of zabbix-key> space separate <application name>
from xml.etree.ElementTree import *
from sys import argv
# reading configuration
@r-plus
r-plus / dump_then_scp.sh
Created March 25, 2013 06:31
圧縮と転送をひとまとめにしてバックグラウンドで実行して最後に待つ。(サブシェルとwaitはbash, csh, zshにあるのは確認)
#!/bin/sh
for DB in DB_A DB_B DB_C; do
# something dump.
dump database $DB
# compress then scp in background.
(gzip dumpfile; scp dumpfile.gz SERVER:/root) &
done
# wait all compress and scp.
@r-plus
r-plus / gz2xz.sh
Created March 27, 2013 10:00
カレントディレクトリ以下のgzをxzに圧縮しなおす
#!/bin/sh
FILES=$(find $(pwd) -name "*.gz" -and ! -name "*.tar.gz")
for FILE in $FILES; do
(gunzip -c $FILE | xz > ${FILE%.*}.xz; [ $? -eq 0 ] && rm -f $FILE) &
done
wait
@r-plus
r-plus / button.mm
Last active December 15, 2015 19:29
button or view?
UIButton *baseView = [[UIButton alloc] initWithFrame:self.frame];
baseView.backgroundColor = [UIColor colorWithWhite:0.0 alpha:0.3];
[baseView addTarget:self action:@selector(dismissActionSheet) forControlEvents:UIControlEventTouchUpInside];
@r-plus
r-plus / OpenCloudTabs+.xm
Last active December 16, 2015 01:19
OpenSource version of CloudTabs+. Licensed under the GPLv3.
#import <UIKit/UIKit.h>
static BOOL isActivatingFromLongPress;
%hook BrowserToolbar
- (void)_installGestureRecognizers
{
%orig;
id bookmarkButton = MSHookIvar<id>(self, "_bookmarksItem");
UILongPressGestureRecognizer *longGesture = [[UILongPressGestureRecognizer alloc] initWithTarget:self action:@selector(longPressBookmarkButton:)];
debugfs -R 'stat /root/test' /dev/mapper/vg01-lv02