Skip to content

Instantly share code, notes, and snippets.

@yujiod
yujiod / nginx
Created June 2, 2013 23:54
nginx init.d script on rackhub.net
#! /bin/sh
### BEGIN INIT INFO
# Provides: nginx
# Required-Start: $remote_fs $syslog
# Required-Stop: $remote_fs $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: nginx init.d dash script for Ubuntu <=9.10.
# Description: nginx init.d dash script for Ubuntu <=9.10.
### END INIT INFO
@yujiod
yujiod / crontab
Last active August 29, 2015 13:56
Keen IO data collector for Elasticsearch
*/10 * * * * /usr/local/bin/keenio_collector.rb
@yujiod
yujiod / monokai-ricty.css
Last active August 29, 2015 13:57
MonokaiRicty theme for Brackets of Themes addon
/* Based on Sublime Text's Monokai theme */
.cm-s-monokai-ricty.CodeMirror {font-family: 'Ricty'; font-weight: 600; background: #272822 !important; color: #f5f5f5;}
.cm-s-monokai-ricty div.CodeMirror-selected {background: #925728 !important;}
.cm-s-monokai-ricty .CodeMirror-gutters {background: #272822; border-right: 0px;}
.cm-s-monokai-ricty .CodeMirror-linenumber {color: #d0d0d0;}
.cm-s-monokai-ricty .CodeMirror-cursor {border-left: 1px solid #ffffff !important;}
.cm-s-monokai-ricty span.cm-comment {color: #75715e;}
.cm-s-monokai-ricty span.cm-atom {color: #ae81ff;}
@yujiod
yujiod / keenio_collector.rb
Created March 9, 2014 01:18
Clone Keen IO data to Elasticsearch
#!/usr/bin/env ruby
# -*- coding: utf-8 -*-
require "net/https"
require "uri"
require "json"
require "time"
KEENIO_PROJECT_ID = "XXXXXXXX"
KEENIO_READ_KEY = "YYYYYYYY"
@yujiod
yujiod / DefaultKeyBinding.dict
Last active April 16, 2023 04:08
Macの英数入力で円記号とバックスラッシュを入れ替える(ATOKにも対応) ~/Library/KeyBindings/DefaultKeyBinding.dict
{
"¥" = ("insertText:", "\\");
"~\\" = ("insertText:", "¥");
}
@yujiod
yujiod / mackerel.py
Last active August 29, 2015 14:02
Ansible Dynamic Inventory for Mackerel
#!/usr/bin/python
import urllib
import urllib2
import sys
try:
import json
except ImportError:
import simplejson as json
apiKey = 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'
@yujiod
yujiod / .zshrc
Last active August 29, 2015 14:04
Config for zsh
# Path to your oh-my-zsh installation.
export ZSH=$HOME/.oh-my-zsh
# Set name of the theme to load.
# Look in ~/.oh-my-zsh/themes/
# Optionally, if you set this to "random", it'll load a random theme each
# time that oh-my-zsh is loaded.
ZSH_THEME="gallois"
# Uncomment the following line to use case-sensitive completion.
@yujiod
yujiod / insert_data.sh
Created December 23, 2014 23:12
ダミーデータを挿入するシェルスクリプト
#!/bin/sh
# MySQLの接続先
MYSQL_ID='root'
MYSQL_HOST='localhost'
MYSQL_SCHEMA='redmine'
# ユーザーのテーブル定義
TABLE_USER_FROM='users'
TABLE_USER_FROM_ID='id'
@yujiod
yujiod / playbook.yml
Created January 21, 2015 08:04
Ansible Playbook
- hosts: 127.0.0.1
connection: local
tasks:
- yum: name={{item}}
with_items:
- httpd
- php
- mysql
@yujiod
yujiod / rpi2-build-image.sh
Created March 9, 2015 01:46
Build Ubuntu 14.04 (Trusty Tahr) image for Raspberry Pi 2
#!/bin/sh
########################################################################
# rpi2-build-image
# Copyright (C) 2015 Ryan Finnie <ryan@finnie.org>
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.