Skip to content

Instantly share code, notes, and snippets.

View hrysd's full-sized avatar
🤔
hoi

Hiroshi Yoshida hrysd

🤔
hoi
View GitHub Profile
sed -e '/childprocess\|erubis\|log4r\|net-scp/s/~>/>=/' \
-e '/net-ssh/s:, "< 2.8.0"::' \
@hrysd
hrysd / 4.1.diff
Created April 12, 2014 15:51
config の diff。 `rails new hoge`
diff --git a/config/database.yml b/config/database.yml
index 51a4dd4..1c1a37c 100644
--- a/config/database.yml
+++ b/config/database.yml
@@ -3,23 +3,23 @@
#
# Ensure the SQLite 3 gem is defined in your Gemfile
# gem 'sqlite3'
-development:
+#
#! /bin/sh
### BEGIN INIT INFO
# Provides: skeleton
# Required-Start: $remote_fs $syslog
# Required-Stop: $remote_fs $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Example initscript
# Description: This file should be used to construct scripts to be
# placed in /etc/init.d.
@hrysd
hrysd / README.md
Last active August 29, 2015 14:08
Ansible module. Send notifcation to Idobata

Usage

$ wget https://gist.githubusercontent.com/hrysd/d10269472a2a62b6fb18/raw/c11247e6ea96305d68f3c1854912c216760c2d69/idobata
$ mv idobata /path/to/playbook/library

Refs

@hrysd
hrysd / 255.sh
Created April 23, 2012 15:32
Terminalで255色をだす。
for i in {0..255} ; do
printf "¥x1b[38;5;${i}mcolour${i}\n"
done
@hrysd
hrysd / fav.rb
Created April 26, 2012 16:54
RubyでFavoriteしましょう!!
#coding: utf-8
require 'twitter'
Twitter.configure do |config|
config.consumer_key = 'CONSUMER_KEY'
config.consumer_secret = 'CONSUMER_SECRET'
config.oauth_token = 'OAUTH_TOKEN'
config.oauth_token_secret = 'OAUTH_TOKEN_SECRET'
end
@hrysd
hrysd / varidation.rb
Created August 1, 2012 14:32
どっちがいいのかな。
validates_presence_of :name
validates :name, :presence => true
@hrysd
hrysd / iptables
Created August 11, 2012 05:02
debianのiptables設定。
*filter
# Allows all loopback (lo0) traffic and drop all traffic to 127/8 that doesn't use lo0
-A INPUT -i lo -j ACCEPT
-A INPUT ! -i lo -d 127.0.0.0/8 -j REJECT
# Accepts all established inbound connections
-A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
# Allows all outbound traffic
@hrysd
hrysd / unicorn.rb
Created August 19, 2012 09:09
unicorn
# Sample verbose configuration file for Unicorn (not Rack)
#
# This configuration file documents many features of Unicorn
# that may not be needed for some applications. See
# http://unicorn.bogomips.org/examples/unicorn.conf.minimal.rb
# for a much simpler configuration file.
#
# See http://unicorn.bogomips.org/Unicorn/Configurator.html for complete
# documentation.
@hrysd
hrysd / deploy.rb
Created August 21, 2012 05:53
deploy時にLingrに通知をおくる。
require 'open-uri'
require 'digest/sha1'
ROOM = '部屋の id'
ID = 'bot の id'
SECRET = 'bot の secret'
VERIFIER = Digest::SHA1.hexdigest(ID + SECRET)
TEXT = "deployしました"
namespace :notification do