Skip to content

Instantly share code, notes, and snippets.

View buty4649's full-sized avatar

buty4649 buty4649

View GitHub Profile
@buty4649
buty4649 / ansi2irc-color.pl
Created January 23, 2015 09:50
ANSIカラーコードからIRCカラーコードに変換する奴
#!/usr/bin/env perl
use strict;
my @t = qw/1 5 3 7 2 6 10 14 15 4 9 8 12 13 11 0/;
while(<STDIN>) {
s/\e\[0m//g;
s/\e\[(\d\d)m/"\x03".$t[$1-30]/ge;
print;
@buty4649
buty4649 / dstat_disk_latency.py
Created November 10, 2014 11:33
dstatでディスクレイテンシ取るやつ
class dstat_plugin(dstat):
def __init__(self):
self.nick = ('latency',)
self.type = 'd'
self.width = 4
self.scale = 34
self.diskfilter = re.compile('^(dm-[0-9]+|md[0-9]+|[hs]d[a-z]+[0-9]+)$')
self.open('/proc/diskstats')
self.cols = 1
@buty4649
buty4649 / infra_auto.md
Created October 9, 2014 15:13
ITインフラ業務自動化現状確認会の資料

hubotを使ってIRCから便利にする

自己紹介

  • 高谷雄貴
  • 2014/02にペパボに入社
    • 前職ではSEとかSIerとか言われることをやっていた
@buty4649
buty4649 / gen_rrd_nighttime.sh
Created June 19, 2014 10:41
1年前からの日付からRRDを生成。6~19時は0、それ以外は1を書き込む
#!/bin/sh
rrdtool create nighttime.rrd -b $(date -d "1 years ago" +%s) DS:night:GAUGE:600:0:U RRA:MAX:0.5:1:576 RRA:MAX:0.5:6:432 RRA:MAX:0.5:24:540 RRA:MAX:0.5:288:450
perl -MRRDs -e '
$e=time;
$s=$e-3600*24*365;
while($s<=$e) {
$d=($s + 9 * 3600)%(24 * 3600);
if($d >= (19 * 3600) || $d <= (6 * 3600)) {
" おまじない
set runtimepath=~
loadplugins
" 基本的な設定 ============================================
" ブラウザのタイトル
set titlestring=Firefox
@buty4649
buty4649 / stylish_compact_tweetdeck.css
Last active January 4, 2016 05:59
TweetDeckブラウザ版のコンパクト化
@namespace url(http://www.w3.org/1999/xhtml);
@-moz-document domain("tweetdeck.twitter.com") {
/* Sidebar */
.app-header.is-condensed {
width : 24px !important;
}
.app-header.is-condensed .app-header-inner {
width : 24px !important;
padding : 5px 0 0 !important;
" ---------------------------------------------------------
" GUI設定
" ---------------------------------------------------------
" メニューの文字化け対策
source $VIMRUNTIME/delmenu.vim
set langmenu=ja_JP.utf-8
source $VIMRUNTIME/menu.vim
" カラースキーム設定
set t_Co=256
@buty4649
buty4649 / sakura.vim
Last active November 1, 2018 05:34
サクラエディタ風のカラースキーム
" Vim color file
" Maintainer: Your name <youremail@something.com>
" Last Change:
" URL:
" cool help screens
" :he group-name
" :he highlight-groups
" :he cterm-colors
@buty4649
buty4649 / keymap.txt
Created June 6, 2013 08:48
Google日本語入力のキーバインド
status key command
Conversion Backspace Cancel
Composition Backspace Backspace
Precomposition Backspace Revert
Conversion Ctrl Backspace Cancel
Composition Ctrl Backspace Backspace
Precomposition Ctrl Backspace Undo
Prediction Ctrl Delete DeleteSelectedCandidate
Composition Ctrl Down MoveCursorToEnd
Conversion Ctrl Down CommitOnlyFirstSegment
@buty4649
buty4649 / gist:5703264
Created June 4, 2013 02:55
Vimwikiでmarkdownを使う設定
" vimwikiをmarkdownにする
let g:vimwiki_list = [{'syntax': 'markdown', 'ext': '.md'}]
" アンダーライン見出しのシンタクスを追加
" 見出し1
" =======
"
" 見出し2
" -------
let s:bundle = neobundle#get("vimwiki")