Skip to content

Instantly share code, notes, and snippets.

@azurestone
azurestone / fuck
Created May 14, 2012 06:25
MacOSX Lion rsync ファイル名文字化け対応
# http://www.behindtherack.com/?p=308
# MacOSX Lion HFS(UTF-8-MAC)対応
curl -O http://rsync.samba.org/ftp/rsync/src/rsync-3.0.9.tar.gz
tar zxvf rsync-3.0.9.tar.gz
curl -O http://rsync.samba.org/ftp/rsync/src/rsync-patches-3.0.9.tar.gz
tar zxvf rsync-patches-3.0.9.tar.gz
cd rsync-3.0.9/
patch -p1 <patches/fileflags.diff
[vkgtaro@mastersparc.local] $ dig A www.facebook.com [~]
; <<>> DiG 9.6.0-APPLE-P2 <<>> A www.facebook.com
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 48714
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 5, ADDITIONAL: 4
;; QUESTION SECTION:
;www.facebook.com. IN A
azurestone@yorozuya:~$ dig A www.facebook.com
; <<>> DiG 9.7.3 <<>> A www.facebook.com
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 33691
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 2, ADDITIONAL: 2
;; QUESTION SECTION:
;www.facebook.com. IN A
@azurestone
azurestone / gist:1046634
Created June 25, 2011 16:24
cat /etc/shorewall/zones
#ZONE TYPE OPTIONS IN OUT
# OPTIONS OPTIONS
fw firewall
net ipv4
@azurestone
azurestone / gist:1046632
Created June 25, 2011 16:24
cat /etc/shorewall/rules
#ACTION SOURCE DEST PROTO DEST
# PORT(S)
ACCEPT net $FW tcp 22
ACCEPT net $FW tcp 80
ACCEPT net $FW tcp 3000
ACCEPT $FW net tcp 22
ACCEPT $FW net tcp 80
ACCEPT $FW net tcp 443
ACCEPT $FW net tcp 6667
@azurestone
azurestone / gist:1046630
Created June 25, 2011 16:23
cat /etc/shorewall/policy
#SOURCE DEST POLICY LOG LEVEL LIMIT:BURST
net all DROP info
all all DROP info
@azurestone
azurestone / gist:1046628
Created June 25, 2011 16:23
cat /etc/shorewall/interfaces
#ZONE INTERFACE BROADCAST OPTIONS
net eth0 detect
//サニタイズ処理
if( $("#q").val().match( /[\"\']+ *\>.*\<(script|iframe|s|xmp|b|img|object)[^a-zA-Z0-9]/i ) ){
alert( "(;´Д`) XSS Not Found" );
}else if( $("#q").val().match( /[\"\']+ *on[a-zA-Z]{3,} *=/i ) ){
alert( "通報しますた" );
}
use strict;
my $name = 'hoge';
my $value = 'xxxxxxx';
my $json = { name => $name, value => $value };
# ただのhashref
my $yaml = { name => $name, value => $value };
my $html = { name => $name, value => $value };
use strict;
my $name = 'hoge';
my $value = 'xxxxxxx';
my $json = new TestJSON( name => $name, value => $value );
# $json の中身は { name => 'hoge', value => 'xxxxxxx' }
# $json は 'TestJSON' というpackage nameと関連付け(blessされてる)
# 以下同様