Skip to content

Instantly share code, notes, and snippets.

View buty4649's full-sized avatar

buty4649 buty4649

View GitHub Profile
@buty4649
buty4649 / mackerel-snmp-agent.sh
Created December 22, 2015 14:53
Ciscoスイッチ向けmackerel agentスクリプト
#!/bin/bash
if [ -z "$1" ];
then
echo "Usage $(basename $0) <host>"
exit 1
fi
TARGET="$1"
MACKEREL_APIKEY="API Key"
{
init: function(elevators, floors) {
var FLOOR_NUM = floors.floorNum;
var elevator1 = elevators[0]; // 初号機
var elevator2 = elevators[1]; // 弐号機
elevator1
.on("idle", function() {
elevator1.goToFloor(0);
});
@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