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/local/bin/perl | |
use Getopt::Std; | |
use File::Basename; | |
getopts('f'); | |
die "Usage: $0 ref-dirs.. new-dir\n" if ($#ARGV < 1); | |
my $newdir = pop(ARGV); | |
if (! -e "$newdir") { | |
mkdir($newdir) || die "cannot mkdir $newdir\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
#! /usr/local/bin/perl | |
use File::stat; | |
die "Usage: $0 from to\n" if ($#ARGV != 1); | |
my $from = shift @ARGV; | |
my $to = shift @ARGV; | |
my $stat = stat($from); | |
my $atime = $stat->atime; | |
my $mtime = $stat->mtime; |
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
--- s3sync.rb- 2010-05-22 17:39:32.000000000 +0900 | |
+++ s3sync.rb 2010-05-22 17:40:59.000000000 +0900 | |
@@ -505,6 +505,7 @@ | |
headers['x-amz-acl'] = 'public-read' if $S3syncOptions['--public-read'] | |
headers['Expires'] = $S3syncOptions['--expires'] if $S3syncOptions['--expires'] | |
headers['Cache-Control'] = $S3syncOptions['--cache-control'] if $S3syncOptions['--cache-control'] | |
+ headers['x-amz-storage-class'] = 'REDUCED_REDUNDANCY' | |
fType = @path.split('.').last | |
debug("File extension: #{fType}") | |
if defined?($mimeTypes) and fType != '' and (mType = $mimeTypes[fType]) and mType != '' |
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/local/bin/ruby18 | |
# | |
# snapshot-clean: cleanup old snapshot for zfs | |
# | |
# Usage: | |
# snapshot-clean | |
# | |
# Copyright(C) 2010 Munechika Sumikawa <[email protected]>, All rights reserved. | |
# This is free software with ABSOLUTELY NO WARRANTY. | |
# |
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
% uname -a | |
Darwin prince.local 11.0.0 Darwin Kernel Version 11.0.0: Sat Jun 18 12:56:35 PDT 2011; root:xnu-1699.22.73~1/RELEASE_X86_64 x86_64 | |
% curl -o ip6addrctl.c 'http://www.freebsd.org/cgi/cvsweb.cgi/~checkout~/src/usr.sbin/ip6addrctl/ip6addrctl.c?rev=1.3.32.1;content-type=text%2Fplain' | |
% gcc -o ip6addrctl ip6addrctl.c | |
% ./ip6addrctl | |
Prefix Prec Label Use | |
::1/128 60 0 18 | |
fc00::/7 50 1 0 | |
::/0 40 2 2953 | |
::ffff:0.0.0.0/96 30 3 1043 |
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 | |
for $i (1..$ARGV[0]) { | |
$r = ""; | |
$r .= ((Fizz)[$i % 3]); | |
$r .= ((Buzz)[$i % 5]); | |
print $r || $i; | |
print "\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
sed '{ | |
:a | |
/\\$/N | |
/\\$/b a | |
s/\\\n//g | |
}' Makefile |
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
javascript:var i = 0;for (i = 0; i < document.main.check.length; i++) {document.main.check[i].checked=1;};checkInput(); |
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
<?xml version="1.0"?> | |
<root> | |
<symbol_map type="KeyCode" name="META_L" value="0xff" /> | |
<devicevendordef> | |
<vendorname>OCTI</vendorname> | |
<vendorid>0x0b39</vendorid> | |
</devicevendordef> | |
<deviceproductdef> | |
<productname>OCTI_PS2_TO_USB</productname> | |
<productid>0x0001</productid> |
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/env ruby | |
require 'prime' | |
days = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31] | |
(201301..201312).each do |m| | |
sd = (m.to_s + "01").to_i | |
ed = (m.to_s + days[m % 12].to_s).to_i | |
(sd..ed).each do |n| |
OlderNewer