This file contains 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 -ex | |
exec > >(tee /var/log/user-data.log|logger -t user-data -s 2>/dev/console) 2>&1 | |
while [ ! -e /dev/sdb ]; do echo Waiting for Ephemeral Disk to attach; sleep 5; done | |
if ! `df | grep -q /media/ephemeral0` ; then | |
mkfs.ext3 /dev/sdb | |
mount -t ext3 /dev/sdb /media/ephemeral0 | |
fi | |
# snip... |
This file contains 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 | |
# BSD sed | |
for keg in /usr/local/Library/LinkedKegs/*; do kegname="$(basename $keg)"; dir="$(find $keg/ -maxdepth 1 -type d | grep '\/\(sbin\|bin\|etc\|var\|lib\|include\|libexec\|share\)$' | head -n1)"; [ -z "${dir}" ] && continue; testee="$(find $dir -type f | head -n1 | sed -e "s|${keg}||")"; test -f /usr/local/$testee || (echo $keg && brew unlink $kegname; brew link --force $kegname); done |
This file contains 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 -l | |
use strict; | |
use warnings; | |
$ENV{LANG} = "C"; | |
$ENV{PATH} ||= "/usr/local/bin:/usr/bin/:/bin"; | |
my $eth = shift || "eth0"; | |
`ip addr list dev $eth|grep 'inet '` =~ m{\.(\d+?)\.(\d+?)\/}; |
This file contains 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
{ | |
"checks": { | |
"graphite_test1": { | |
"type": "metric", | |
"command": "/etc/sensu/plugins/graphite_test1.rb", | |
"subscribers": [ "role_sensu_server" ], | |
"interval": 10, | |
"handlers": ["graphite"] | |
} | |
} |
This file contains 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
### helper shell function | |
daemonup() { | |
[ -z "$1" ] && return | |
case $1 in | |
*/*) | |
DAEMONDIR=$1 | |
;; | |
*) | |
if [ -d "$SYS_HOME" ]; then |
This file contains 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 perl | |
use strict; | |
use warnings; | |
my $file = './test.txt'; | |
if ( -e $file ) { | |
print "allow overrite ok ? [y/n] : "; |
This file contains 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
FROM yoku0825/cent66:init | |
RUN echo "NETWORKING=yes" > /etc/sysconfig/network | |
RUN yum install -y which | |
RUN rpm -ivh http://packages.groonga.org/centos/groonga-release-1.1.0-1.noarch.rpm | |
RUN rpm -ivh http://dev.mysql.com/get/mysql-community-release-el6-5.noarch.rpm | |
RUN yum install -y mysql-community-mroonga groonga-tokenizer-mecab | |
RUN service mysqld start && mysql -e "GRANT ALL ON *.* TO root@'%' WITH GRANT OPTION" | |
EXPOSE 3306 |
This file contains 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
9/25にGoogle+に書いたものの転載、脅威の度合いは各々判断してください | |
---- | |
補足 | |
DNS Rebinding対策として、DNSキャッシュサーバーがプライベートアドレスを返さないようにフィルタしている、というのは | |
http://labs.cybozu.co.jp/blog/kazuho/archives/2007/11/djbdns_and_anti-dns_pinning.php で書かれているような対策のこと | |
要点は | |
1.別途DNSリバインディング対策をしている場合に、その穴を自分で復活させてしまうことになる |
This file contains 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
#!perl | |
use utf8; | |
use strict; | |
use warnings; | |
use WWW::Mechanize; | |
use Encode; | |
use Config::Pit; | |
use HTML::TreeBuilder::XPath; |
This file contains 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; | |
my (%sequential, %random); | |
my ($type, $blocksize, $ratio, $iodepth, $header); | |
while (my $line = <STDIN>) { |
OlderNewer