This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require "rubygems" | |
require "amqp" | |
EventMachine.run do | |
AMQP.connect(host: 'localhost', user: 'guest') do |connection| | |
puts "Connected to AMQP broker. Running #{AMQP::VERSION} version of the gem..." | |
channel = AMQP::Channel.new(connection) | |
channel.queue("test1", :auto_delete => true).subscribe do |payload| |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'rubygems' | |
require 'amqp' | |
ROUTING_KEY = "test1" | |
AMQP.start(:host => 'localhost') do | |
MQ.queue(ROUTING_KEY).publish("hello world") | |
# AMQP.stop { EM.stop } | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
[[ -e ~/.dotfiles ]] || git clone [email protected]:sonots/.dotfiles.git ~/.dotfiles | |
pushd ~/.dotfiles | |
git submodule init | |
git submodule update | |
for i in `ls -a` | |
do | |
[ $i = "." ] && continue |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# rvm-install.sh の中で curl: (60) SSL certificate problem, エラーが出るので crt ファイルを置き換える | |
sudo cp /etc/pki/tls/certs/ca-bundle.crt /etc/pki/tls/certs/ca-bundle.crt.bak | |
sudo curl http://curl.haxx.se/ca/cacert.pem -o /etc/pki/tls/certs/ca-bundle.crt | |
# Install rvm | |
sudo yum -y install readline readline-devel | |
wget https://raw.github.com/wayneeseguin/rvm/stable/binscripts/rvm-installer -O /tmp/rvm-install.sh | |
sudo zsh /tmp/rvm-install.sh | |
rvm get 1.10.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
[ -z "$version" ] && version="4.3.10" | |
mkdir -p ~/.src | |
cd ~/.src | |
curl -O -L --create-dirs -C - http://downloads.sourceforge.net/project/zsh/zsh-dev/$version/zsh-$version.tar.bz2?use_mirror=jaist | |
tar jxf zsh-$version.tar.bz2* | |
cd zsh-$version | |
./configure --prefix=/ | |
make | |
sudo make install |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- lib/bundler/vendor/net/http/persistent.rb.orig212012-05-07 06:19:19.629713946 -0700 | |
+++ lib/bundler/vendor/net/http/persistent.rb 2012-05-07 06:38:32.601764475 -0700 | |
@@ -2,6 +2,7 @@ | |
require 'net/http/faster' | |
require 'uri' | |
require 'cgi' # for escaping | |
+require 'http_configuration' | |
## | |
# Persistent connections for Net::HTTP |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
git clone https://github.com/sstephenson/rbenv.git ~/.rbenv | |
echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.bash_profile | |
echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.zshrc | |
exec $SHELL -l | |
git clone https://github.com/sstephenson/ruby-build.git ~/.rbenv/plugins/ruby-build | |
CONFIGURE_OPTS="--with-readline-dir=/usr/local/opt/readline --with-openssl-dir=/usr/local/opt/openssl" rbenv install 1.9.3-p194 | |
rbenv rehash | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
curl -kL http://install.perlbrew.pl | bash | |
echo '[[ -s "$HOME/perl5/perlbrew/etc/bashrc" ]] && source "$HOME/perl5/perlbrew/etc/bashrc"' >> .bashrc | |
source "$HOME/perl5/perlbrew/etc/bashrc" | |
perlbrew install perl-5.16.0 | |
perlbrew switch perl-5.16.0 | |
perlbrew install-cpanm |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
curl -kL https://gist.github.com/raw/4664437/perlbrew-install.sh | sh | |
sudo yum groupinstall "Development Tools" | |
sudo yum install pkgconfig glib2-devel gettext libxml2-devel pango-devel cairo-devel | |
git clone https://github.com/kazeburo/GrowthForecast.git | |
cd GrowthForecast | |
cpanm --installdeps . | |
# try like |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
PATH="/bin:/usr/bin:/usr/local/bin" | |
export PATH | |
FILE="/var/log/syslog" | |
PATTERN="warn" | |
SUBJECT="ALERT-LOGWATCH" | |
MAIL_TO="[email protected]" | |
tail -n 1 --follow=name $FILE | while read INPUT; do | |
echo "$INPUT" | grep "$PATTERN" > /dev/null |
OlderNewer