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/expect | |
set timeout 10 | |
spawn telnet mail.example.com 25 | |
expect { | |
default {exit 2} | |
"ESMTP Postfix" | |
} | |
# helo | |
send "HELO sender.example.com\n" |
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
if [ "$SHLVL" = "1" ] && [ ! -z "$PS1" ] ; then | |
[ -d ~/oplog/ ] || mkdir ~/oplog | |
find ~/oplog/ -type f -mtime +60 -delete | |
script ~/oplog/"typescript_$(date '+%Y%M_%H:%M:%S')" | |
fi |
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/perl | |
my (@row,@columns); | |
{ | |
my $line=<STDIN>; | |
my ($height,$width)=split(/\s+/,$line); | |
for (1..$height){ | |
$line=<STDIN>; | |
chomp $line; | |
$row[$_-1]=$line; |
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/perl | |
use File::Temp; | |
use strict; | |
use warnings; | |
# grep | |
my $temp_grep_log=File::Temp->new(DIR=>"/tmp",SUFFIX=>".tmp"); | |
my $temp_grep_log_name=$temp_grep_log->filename; | |
system "cat /var/log/syslog | grep '°' > $temp_grep_log_name "; | |
# make gnuplot data |
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/perl | |
use strict; | |
use warnings; | |
open (FH,"blog-05-10-2014_2.xml") or die $!; | |
while (<FH>){ | |
if (/^<entry>/){ | |
open (WR,">/tmp/out/${.}.erb") or die $!; | |
} | |
if (/^<entry>/../^<\/entry>/){ |
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 | |
DISPLAY=:0 | |
function previous { | |
sleep $1 | |
eval $(xdotool getmouselocation --shell) | |
echo "$X,$Y" | |
} | |
while :;do |
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 | |
set -e | |
#rbenv | |
HOME=/home/hogeuser | |
export PATH="$HOME/.rbenv/bin:$PATH" | |
eval "$(rbenv init -)" | |
cd ~/middleman |
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
- name: ユーザの作成 | |
- user: name={{ item }} shell=/bin/bash password={{ password }} home=/home/{{ item }} | |
with_items: | |
- yamasita | |
- yamada | |
- suzuki | |
- name: パッケージインストール | |
apt: pkg=tmpreaper state=installed |
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
| インスタンスタイプ | 仮想コア数 | RAM(GiB) | 年契約 | 初期費用 | 月額費用 | 1年間合計費用( 初期費用 + 月額費用 x 12 ) | | |
|--------------------|------------|-----------|----------|----------|----------|-------------------------------------------| | |
| m1.medium | 1 | 3.7 | なし | $0 | $91.12 | | | |
| m1.medium | 1 | 3.7 | 1年 | $270.00 | $27.43 | | | |
| c3.large | 2 | 3.7 | なし | $0 | $95.51 | | | |
| c3.large | 2 | 3.7 | 1年 | $357.00 | $36.22 | | | |
| r3.large | 2 | 15.0 | なし | $0 | $155.53 | |
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
if type percol &>/dev/null | |
then | |
[ ! -e ~/.cd_history ] && pwd > ~/.cd_history | |
function _percol_log_delete { | |
local log=/tmp/percol-log | |
if [ -e $log ];then | |
\rm $log | |
fi | |
} | |
_replace_by_history() { |