参加者(僕も含む)数人で講座は10回未満くらいのイメージ。 時間外で作ってくるのがメイン。
とりあえずPerlの場合
- Windowsの人はとりあえずMacを買いに行く
- cpanmの使い方
- スクリプト単体で or まずlocal::lib入れてから
| while : ; do echo -n "`date` "; mysql -e 'show global status like "Queries";' | grep Queries; sleep 1; done | tee queries.log |
| ssh host1 cat /path/to/file | diff -u /path/to/file - |
| [~]$ mkdir .ssh | |
| [~]$ chmod 600 .ssh | |
| [~]$ mv ~/Downloads/riywo-test.pem ~/.ssh | |
| [~]$ chmod 600 ~/.ssh/riywo-test.pem | |
| [~]$ vim ~/.ssh/config | |
| Host test-cf | |
| HostName ec2-XX-XX-XX-XX.compute-1.amazonaws.com | |
| User ec2-user | |
| Port 22 | |
| IdentityFile ~/.ssh/riywo-test.pem |
| [ec2-user@domU-11-11-11-11-11-11 ~]$ sudo su - | |
| [root@domU-11-11-11-11-11-11 ~]# vim /etc/ssh/sshd_config | |
| Port 2222 | |
| PermitRootLogin no | |
| [root@domU-11-11-11-11-11-11 ~]# service sshd restart | |
| [root@domU-11-11-11-11-11-11 ~]# netstat -taopn | |
| Active Internet connections (servers and established) | |
| Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name Timer | |
| tcp 0 0 0.0.0.0:2222 0.0.0.0:* LISTEN 1076/sshd off (0.00/0/0) |
| <Directory /> | |
| AuthUserFile /path/to/.htpasswd | |
| AuthName "f0ck you" | |
| AuthType Basic | |
| Require valid-user | |
| Satisfy Any | |
| # Require valid-user 別のディレクティブで指定する場合 | |
| Order deny,allow | |
| Deny from all |
| diff -u <(echo hoge) <(echo fuga) | |
| --- /dev/fd/63 2011-03-04 12:44:34.176435837 +0900 | |
| +++ /dev/fd/62 2011-03-04 12:44:34.176435837 +0900 | |
| @@ -1 +1 @@ | |
| -hoge | |
| +fuga |
| library('ggplot2') | |
| source('Rworker.r') | |
| rworker_log("Download start") | |
| file <- rworker_download(args$data) | |
| rworker_log(paste("Download finished:", file)) | |
| rworker_log("read.csv start") | |
| d <- read.csv(file, header = T) | |
| rworker_log("read.csv finished") |
| use strict; | |
| use warnings; | |
| use Plack::Builder; | |
| use Plack::Session; | |
| use Plack::Session::State::Cookie; | |
| use Plack::Session::Store::Cache; | |
| use Cache::Memcached::IronPlate; | |
| use Cache::Memcached::Fast; |
| my $pid = fork; | |
| if (!$pid){ | |
| local $SIG{TERM} = sub {exit 0}; | |
| for(1..5){ | |
| print "child process\n"; | |
| sleep 1; | |
| } | |
| exit; | |
| } else { |