Skip to content

Instantly share code, notes, and snippets.

@saboyutaka
saboyutaka / score
Created October 8, 2017 01:03
ISUCON模試スコア post script ./score.sh team名 score
#!/bin/sh
TEAM=$2
SCORE=$1
echo $TEAM
echo $SCORE
JSON="{ \"score\": ${SCORE}, \"timestamp\":{ \".sv\":\"timestamp\" } }"
echo $JSON
@saboyutaka
saboyutaka / benchmark.sh
Created October 7, 2017 15:59
benchmark for ishocon portal
#!/bin/sh
WORKLOAD=$1
TEAM=$2
echo $WORKLOAD
SCORE=`./benchmark --workload $1 | awk '$0 ~ /Score: /{print $4}'`
JSON="{ \"score\": ${SCORE}, \"timestamp\":{ \".sv\":\"timestamp\" } }"
if [ -n $SCORE ]; then
curl -X POST -d "${JSON}" "https://ishocon-a9d93.firebaseio.com/teams/${TEAM}.json"
{
"global": {
"check_for_updates_on_startup": true,
"show_in_menu_bar": false,
"show_profile_name_in_menu_bar": false
},
"profiles": [
{
"complex_modifications": {
"parameters": {
@saboyutaka
saboyutaka / Vagrantfile
Created August 31, 2017 03:19
vagrant for AmazonLinux, php71, laravel, nginx, mysql, redis
# -*- mode: ruby -*-
# vi: set ft=ruby :
VAGRANTFILE_API_VERSION = "2".freeze
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
config.vm.box = "mvbcoding/awslinux"
# Mount shared folder
config.vm.synced_folder ".", "/vagrant/www"
{
"$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"sshPublicKey": {
"type": "String",
"metadata": {
"description": "ssh public key for isucon user"
}
},
@saboyutaka
saboyutaka / my.cnf
Last active September 6, 2018 09:12
my.cnf for mysql.server
[mysqld]
socket=/tmp/mysql.sock
bind-address = 127.0.0.1
port=13306
user=root
#[mysqld_safe]
#socket=/usr/tmp/mysql.sock
#pid-file=/usr/local/var/mysql/mysql.pid
#log-error=/usr/local/var/log/mysql.log
[mysqld]
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
[mysqld_safe]
#log-error=/var/log/mysqld.log
#pid-file=/var/run/mysqld/mysqld.pid
[client]
port=3306
server {
server_name isucon.com;
listen 80;
client_max_body_size 10m;
root /home/isucon/private_isu/webapp/public;
location ~ .*\.(html?|jpe?g|gif|png|css|js|ico|swf|inc) {
expires 1d;
# access_log off;
.DEFAULT_GOAL := help
config: ## copy configs from repository to conf
@sudo cp ~/private_isu/webapp/conf/systemd/isu-ruby.service /etc/systemd/system/
@sudo cp ~/private_isu/webapp/conf/nginx/nginx.conf /etc/nginx/
@sudo cp ~/private_isu/webapp/conf/nginx/isucon.conf /etc/nginx/conf.d/
@sudo cp ~/private_isu/webapp/conf/mysql/my.cnf /etc/mysql/
@make -s nginx-restart
@make -s mysql-restart
@make -s ruby-restart
# #!/usr/bin/env bash
yum update
yum install -y git
# ssh passwordでログイン
sed -i -e 's/^PasswordAuthentication no/PasswordAuthentication yes/' /etc/ssh/sshd_config
/etc/init.d/sshd restart
# install nginx