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
<main class="content" role="main"> | |
<article class="post post-section {{ .Section }}"> | |
{{ range .Data.Pages.GroupByDate "Jan 2006" }} | |
<h3>{{ .Key }}</h3> | |
<ul> | |
{{ range .Pages }} | |
<li> | |
<a href="{{ .Permalink }}">{{ .Title }}</a> | |
</li> | |
{{ end }} |
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
aws_s3_sync = "aws --region us-west-2 s3 sync public s3://blog.riywo.com --delete --storage-class=REDUCED_REDUNDANCY" | |
task :default => :server | |
task :server do | |
sh 'rm -fr public' | |
exec 'hugo server -b http://blog.riywo.com --appendPort=false -w --disableLiveReload' | |
end | |
task :test do | |
sh %Q{#{aws_s3_sync} --dryrun --size-only} |
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
<VirtualHost *> | |
ServerName blog.riywo.com | |
ProxyPreserveHost On | |
ProxyRequests off | |
<Proxy balancer://blog> | |
BalancerMember http://localhost:1313 | |
BalancerMember http://blog.riywo.com.s3-website-us-west-2.amazonaws.com status=+H | |
</Proxy> | |
ProxyPass / balancer://blog/ | |
</VirtualHost> |
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
my $dbh = DBI->connect('dbi:mysql:test','test','test', { | |
RaiseError => 1, | |
Callbacks => { | |
ChildCallbacks => { | |
execute => sub { | |
my ($obj, @binds) = @_; | |
my ($package, $file, $line) = caller; | |
$obj->{Database}->{Statement} .= "/* $package:$file:$line */"; | |
return; | |
}, |
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; | |
exit if(@ARGV != 2); | |
my $file1 = $ARGV[0]; | |
my $file2 = $ARGV[1]; | |
my %data1; |
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
source('Rworker.r') | |
file <- rworker_download(args$data) | |
rworker_log(paste("Download finished:", file)) | |
d <- read.csv(file, header = T) | |
rworker_log("read.csv finished:") | |
png(args$img) | |
plot(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
speed | dist | |
---|---|---|
4 | 2 | |
4 | 10 | |
7 | 4 | |
7 | 22 | |
8 | 16 | |
9 | 10 | |
10 | 18 | |
10 | 26 | |
10 | 34 |
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
# ifstat -b -t -i bond0,eth0,eth1 1 5 | |
Time bond0 eth0 eth1 | |
HH:MM:SS Kbps in Kbps out Kbps in Kbps out Kbps in Kbps out | |
18:46:33 11248.00 19186.19 11166.92 19186.19 81.08 0.00 | |
18:46:34 10672.05 17935.01 10589.01 17935.01 83.04 0.00 | |
18:46:35 10908.38 21413.09 10837.35 21413.09 71.03 0.00 | |
18:46:36 10786.80 18413.89 10739.27 18413.89 47.53 0.00 | |
18:46:37 11408.11 18082.65 11339.09 18082.65 69.02 0.00 |
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/sh | |
SEC=$1 | |
tcpdump -s 65535 -nn -q -tttt -x port 3306 -l > /tmp/tcpdump.3306 2> /dev/null & | |
PID_3306=$! | |
tcpdump -s 65535 -nn -q -tttt -x port 11211 -l > /tmp/tcpdump.11211 2> /dev/null & | |
PID_11211=$! |
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/sh | |
exec mk-slave-delay --delay 3s --interval 1s h=localhost,u=root,p=password &>/dev/null |
OlderNewer