This file contains hidden or 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
#! /usr/bin/env ruby | |
require 'benchmark' | |
require 'net/http' | |
REQUEST_URI_BASE = URI.parse('http://www.yahoo.co.jp/') | |
def http_request(uri) | |
http = Net::HTTP.new(uri.host, uri.port) | |
http.start do |request| |
This file contains hidden or 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
#! /usr/bin/env ruby | |
# NIFTY Cloud API - DescribeInstances | |
# Author:: Kei HAMANAKA <kei.hamanaka (at) gmail.com> | |
# License:: Distributes under the same terms as Ruby | |
require 'uri' | |
require 'time' | |
require 'net/https' | |
require 'cgi' | |
require 'openssl' |
This file contains hidden or 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
bash < <( curl http://rvm.beginrescueend.com/releases/rvm-install-latest ) | |
rvm install 1.8.7 | |
rvm use 1.8.7 --default | |
yum install gcc-c++ | |
gem install passenger | |
cd /usr/local/rvm/gems/ruby-1.8.7-p302/gems/passenger-2.2.15/bin | |
./passenger-install-apache2-module --apxs2-path=/usr/local/apache2.2.16/bin/apxs --apr-config-path=/usr/local/apache2.2.16/bin/apr-1-config | |
LoadModule passenger_module /usr/local/rvm/gems/ruby-1.8.7-p302/gems/passenger-2.2.15/ext/apache2/mod_passenger.so |
This file contains hidden or 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
cd /usr/local/src/ | |
wget http://ftp.kddilabs.jp/infosystems/apache/httpd/httpd-2.2.17.tar.gz | |
tar xzvf httpd-2.2.17.tar.gz | |
cd httpd-2.2.17 | |
./configure --prefix=/usr/local/apache2.2.16 --enable-mods-shared=all --enable-module=all --with-mpm=worker --enable-module=all --enable-ssl --enable-deflate | |
make | |
make install | |
mkdir /service |
This file contains hidden or 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
# Firewall configuration written by system-config-securitylevel | |
# Manual customization of this file is not recommended. | |
*filter | |
:INPUT DROP [0:0] | |
:FORWARD DROP [0:0] | |
:OUTPUT ACCEPT [0:0] | |
:RH-Firewall-1-INPUT - [0:0] | |
-A INPUT -j RH-Firewall-1-INPUT | |
-A FORWARD -j DROP | |
-A RH-Firewall-1-INPUT -i lo -j ACCEPT |
This file contains hidden or 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/bash | |
cd $1 | |
ls=`ls` | |
for f in $ls | |
do | |
cat $f >> $2 | |
done |
This file contains hidden or 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
cat hogehoge.txt |sort |uniq -c |sort -r |
This file contains hidden or 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
alias la='ls -ah' | |
alias ll='ls -lhG' | |
alias lla='ls -alh' |
This file contains hidden or 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
# USAGE: | |
# echo "ほげ" | ruby send-gmail.rb | |
# | |
require 'rubygems' | |
require 'kconv' | |
require 'tmail' | |
require "tlsmail" | |
mail = TMail::Mail.new | |
mail.to = '[email protected]' |
This file contains hidden or 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 | |
USER="user" | |
PASSWD="password" | |
HOST="ipadress" | |
PORT=123456 | |
X_CMD(){ | |
local U=$1 ; shift | |
local PW=$1 ; shift |
NewerOlder