cat .ssh/id_rsa.pub | ssh user@ip "cat >>.ssh/authorized_keys && chmod 600 .ssh/authorized_keys"
作成
mkdir nyan
cd nyan
gem初期化
bundle init
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 | |
# メール送信設定 | |
_to="[email protected]" | |
_from="[email protected]" | |
# メール件名設定 | |
_hostname=`hostname` | |
_application="AppName" | |
_subject="Fatal error!!" |
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
<script> | |
function fizz(val) { | |
if (val % 3 == 0) { return "fizz" } | |
else { return "" } | |
} | |
function buzz(val) { | |
if (val % 5 == 0) { return "buzz" } | |
else { return "" } | |
} |
- 注意:EC2のマイクロインスタンスでやりました
http://piyopiyoducky.net/install-share-rbenv-ruby-build-in-ubuntu/ http://kujira16.hateblo.jp/entry/2012/09/04/144953
ついでにAPTパッケージのアップデートと、もろもろ欲しいものもインストール
cat /etc/sysconfig/iptables
*filter
:INPUT ACCEPT [0:0]
:FORWARD ACCEPT [0:0]
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
WITH | |
rowno AS ( | |
SELECT | |
rownum no, | |
mod(rownum, 3) mod3, | |
mod(rownum, 5) mod5 | |
FROM | |
dual | |
CONNECT BY | |
rownum < 16 |
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
def writetext(filename, item, n, lines) | |
open(filename, "w") do |f| | |
lines.times do | |
f.write item.shift * n | |
f.write "\n" | |
end | |
end | |
end | |
a = ("a".."z").to_a |
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
def makepassword (lengs) | |
value = ("a".."z").to_a + ("A".."Z").to_a + (0..9).to_a | |
return value.sample(lengs).join | |
end | |
puts makepassword(ARGV[0].to_i) |