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
# test for Threadstat - a tool for collecting metrics in high performance applications | |
# http://datadogpy.readthedocs.io/en/latest/#datadog-threadstats-module | |
import random, time, os, yaml | |
# Configure the module according to your needs | |
from datadog import initialize | |
from datadog.util.config import get_config | |
# initialize(api_key=None, app_key=None, host_name=None, api_host=None, statsd_host=None, statsd_port=None, statsd_use_default_route=False, **kwargs) | |
config = get_config() |
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
--- ./include/net/tcp.h-org 2016-10-18 18:14:54.051023657 +0900 | |
+++ ./include/net/tcp.h 2016-10-19 13:51:41.959816976 +0900 | |
@@ -111,8 +111,8 @@ | |
* initial RTO. | |
*/ | |
-#define TCP_TIMEWAIT_LEN (60*HZ) /* how long to wait to destroy TIME-WAIT | |
- * state, about 60 seconds */ | |
+#define TCP_TIMEWAIT_LEN (1*HZ) /* how long to wait to destroy TIME-WAIT | |
+ * state, about 1 second */ |
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
for r in $(aws ec2 --region us-east-1 describe-regions | jq -r ".Regions[] | .RegionName"); do for i in "instance" "reservation" "volume" "snapshot"; do aws --debug --region $r ec2 modify-id-format --resource $i --use-long-ids; done; 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
for r in $(aws --region us-east-1 ec2 describe-regions | jq -r ".Regions[] | .RegionName"); do aws --region $r ec2 describe-id-format; 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
#!/bin/bash | |
for c in $(brew cask list); do | |
info=$(brew cask info $c) | |
installed_ver=$(echo "$info" | cut -d$'\n' -f1 | tr -d ' ' | cut -d':' -f 2) | |
current_ver=$(echo "$info" | cut -d$'\n' -f3 | cut -d' ' -f 1 | rev | cut -d'/' -f 1 | rev) | |
if [ "$installed_ver" != "$current_ver" ]; then | |
echo "$c is installed '$installed_ver', current is '$current_ver'" | |
brew cask reinstall $c | |
fi |
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
IFS=$'\n' | |
for i in $(find . -type f -name '*.png'); do | |
dir=$(dirname "$i") | |
file=$(basename "$i" .png) | |
sips -s format jpeg $i --out "$dir/$file.jpg" | |
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
# | |
# iam-and-s3 | |
# | |
require 'aws-sdk' | |
$: << File.dirname(__FILE__) | |
### common local library | |
require 'meta' | |
require 'aws' |
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
https://www.dropbox.com/s/er3bofqrgnl6wue/Emacs-24.3.app.zip?dl=0 |
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
[alias] | |
rc = rebase --continue | |
ft = fetch | |
ftp = fetch --tags --prune | |
pr = pull --rebase | |
co = checkout | |
wd = diff --word-diff | |
br = branch | |
so = remote show origin | |
kc = commit |
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
$ brew install nginx-full --with-mruby-module --no-sandbox | |
==> Installing nginx-full from homebrew/nginx | |
==> Downloading https://nginx.org/download/nginx-1.12.1.tar.gz | |
######################################################################## 100.0% | |
==> git init | |
==> git submodule init | |
==> git submodule update | |
==> git add build_config.rb | |
==> git commit -m 'build_config.rb' | |
Last 15 lines from ~/Library/Logs/Homebrew/nginx-full/05.git: |