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 | |
set -ex | |
if [ -f /var/lib/mysql/mysqld-slow.log ]; then | |
sudo mv /var/lib/mysql/mysqld-slow.log /var/lib/mysql/mysqld-slow.log.$(date "+%Y%m%d_%H%M%S") | |
fi | |
if [ -f /var/log/nginx/isucon5.access_log.tsv ]; then | |
sudo mv /var/log/nginx/isucon5.access_log.tsv /var/log/nginx/isucon5.access_log.tsv.$(date "+%Y%m%d_%H%M%S") | |
fi | |
sudo systemctl restart mysql |
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 | |
set -ex | |
IPADDR=$1 | |
USERNAME=$USER | |
ssh isucon@$IPADDR "/home/isucon/notify.sh $USERNAME 'deploying...' && cd /home/isucon/deploy && git pull && ~/.local/perl/bin/carton install && sudo systemctl restart mysql && sudo service memcached restart && sudo systemctl restart isuxi.perl && sudo systemctl restart nginx && sudo sysctl -p && /home/isucon/notify.sh $USERNAME 'deploy 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
yuukit@syscall01:~/perl$ ab -n 100000 -c 5 http://10.240.0.7:10020/ | |
This is ApacheBench, Version 2.3 <$Revision: 1604373 $> | |
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/ | |
Licensed to The Apache Software Foundation, http://www.apache.org/ | |
Benchmarking 10.240.0.7 (be patient) | |
Completed 10000 requests | |
Completed 20000 requests | |
Completed 30000 requests | |
Completed 40000 requests |
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
[y_uuki@ ~]$ ab -n 5000 -c 20 http://localhost:10020/ | |
This is ApacheBench, Version 2.3 <$Revision: 1604373 $> | |
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/ | |
Licensed to The Apache Software Foundation, http://www.apache.org/ | |
Benchmarking localhost (be patient) | |
Completed 500 requests | |
Completed 1000 requests | |
Completed 1500 requests | |
Completed 2000 requests |
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
$ telnet yuuki.hhh 10020 | |
Trying x.x.x.x... | |
Connected to yuuki.h.h. | |
Escape character is '^]'. | |
hoge | |
hoge | |
^] |
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 | |
for v in $(rbenv versions --bare); do | |
rbenv uninstall -f $v | |
rbenv install $v | |
rbenv global $v | |
rbenv exec gem install capistrano --no-ri --no-rdoc --version "=2.15.5" | |
rbenv exec gem install git-browse-remote --no-ri --no-rdoc | |
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/env python | |
# # Prepare test files. | |
# rm /tmp/test_*.wsp; for i in `seq 0 99`;do bin/whisper-create.py /tmp/test_$i.wsp 60s:25h 5m:21d 1h:90d 1d:2y; done | |
# Execute benchmark. | |
# sync; echo 3 | sudo tee /proc/sys/vm/drop_caches ; python bin/whisper-update-many-fadvice-test.py f | grep read | |
import random | |
import time |
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 ruby | |
# -*- coding: utf-8 -*- | |
require 'optparse' | |
require 'json' | |
require 'mackerel/client' | |
# Mackerel API Spec | |
## http://help-ja.mackerel.io/entry/spec/api/v0 |
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 utf8; | |
use strict; | |
use warnings; | |
my $logfile = $ARGV[0] or die "log file reuqire"; | |
my $taken_key = $ARGV[1] || 'taken'; | |
open(my $logfh, '<', $logfile); |
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
package main | |
import ( | |
"code.google.com/p/go-tour/tree" | |
"fmt" | |
) | |
// Walk walks the tree t sending all values | |
// from the tree to the channel ch. | |
func Walk(t *tree.Tree, ch chan int) { |