Skip to content

Instantly share code, notes, and snippets.

keywords = %W(
穀物
野菜
乳製品
)
double = keywords.repeated_combination(2)
puts double.collect {|arr| arr.join("+") }.join("\n")
require 'mechanize'
require 'zip/zip'
agent = Mechanize.new
page = agent.get('http://mh.websimu.mydns.jp/4g_csv/')
filename = page.links[0].uri.to_s
puts "saved #{filename}"
File.write(filename, page.links[0].click.body)
@kanetann
kanetann / gist:4378160
Created December 26, 2012 05:31
get the misawa images.
wget -r l 1 -Agif -H -Djigokuno.com,img.jigokuno.com -w 1 http://jigokuno.com/
@kanetann
kanetann / gist:4378156
Created December 26, 2012 05:30
git patch command
git diff > patchfile
patch --dry-run -p1 < patchfile
patch -p1 < patchfile
" vundle settings
set nocompatible
filetype plugin indent off
if has('vim_starting')
set runtimepath+=~/.vim/bundle/neobundle.vim/
call neobundle#rc(expand('~/.vim/bundle'))
endif
NeoBundle 'git://github.com/Shougo/neobundle.vim'
%w{ apache2 supervisor postfix runit tmux sudo pxe_dust aws keystone horizon glance nova varnish tomcat sqlite samba python postgresql openldap ntp nagios nginx mysql cloudkick gecode chef-client build-essential windows logrotate partial_search php erlang apt database chef_handler yum users rabbitmq java logwatch openssh homebrew cron djbdns zsh webpi heartbeat rsyslog keepalived iis git freebsd maven chef-server application_ruby munin bluepill getting-started lvm ark application_nginx application motd-tail haproxy emacs firewall unicorn perl resolver subversion daemontools ossec openvpn passenger_apache2 ohai gunicorn wix application_python application_php couchdb memcached wordpress tftp swift whitelist-node-attrs mercurial xml dmg application_java powershell zenoss xfs vim ufw ucspi-tcp ubuntu transmission trac stompserver ssh_known_hosts snort sbuild reprepro radiant pdns pacman openssl maradns man kickstart jpackage jira jetty iptables imagemagick hadoop gnu_parallel gems dynect drbd chef apparmor ant th
execute "aptitude -y update" do
action :run
end
node['rbenv']['user_installs'] = [
{
'user' => 'vagrant',
'rubies' => ['1.9.3-p286'],
'global' => '1.9.3-p286',
}
cat ~/.ssh/id_rsa.pub | ssh user@xxx.xxx.xxx.xxx "mkdir -p ~/.ssh; cat - > ~/.ssh/authorized_keys"
@kanetann
kanetann / gist:3434589
Created August 23, 2012 09:23
preceed.cfg
#### Contents of the preconfiguration file (for squeeze)
### Localization
# Preseeding only locale sets language, country and locale.
d-i debian-installer/locale string en_US.UTF-8
d-i debian-installer/splash boolean false
# The values can also be preseeded individually for greater flexibility.
#d-i debian-installer/language string en
#d-i debian-installer/country string NL
#d-i debian-installer/locale string en_GB.UTF-8
codeigniterメモ
ディレクトリ構成
コードはCodeIgniter/system/application/controllersに書けばいい
views modelsもある
ログはCodeIgniter/logsを見る
config.php database.phpにいろいろ設定する
.htaccessにURLのindex.phpを除去する記述を追加する
MVC