Skip to content

Instantly share code, notes, and snippets.

View sgykfjsm's full-sized avatar

shigeyuki fujishima sgykfjsm

View GitHub Profile
package main
import (
"crypto/tls"
"fmt"
"sync"
"sync/atomic"
"unsafe"
)
@sgykfjsm
sgykfjsm / install-1.9.1.sh
Last active April 10, 2022 03:57
install subversion-1.9.1+apache serf
#!/usr/bin/env bash
set -eu
_OLDPWD=$(pwd)
test -d "${BASH_SOURCE[0]%/*}" && { cd "${BASH_SOURCE[0]%/*}" || exit 1; }
SCRIPT_DIR="$(pwd)"
SVN_URL=http://ftp.kddilabs.jp/infosystems/apache/subversion/subversion-1.9.1.tar.gz
@sgykfjsm
sgykfjsm / install-1.7.9.sh
Last active September 12, 2015 22:53
Install subversion-1.7.9
#!/usr/bin/env bash
set -eu
_OLDPWD=$(pwd)
test -d "${BASH_SOURCE[0]%/*}" && { cd "${BASH_SOURCE[0]%/*}" || exit 1; }
SCRIPT_DIR="$(pwd)"
SVN_URL=http://archive.apache.org/dist/subversion/subversion-1.7.9.tar.gz
source ${HOME}/.zsh_tools/zaw/zaw.zsh
bindkey '^R' zaw-history
bindkey -M filterselect '^R' down-line-or-history
bindkey -M filterselect '^S' up-line-or-history
bindkey -M filterselect '^E' accept-search
zstyle ':filter-select:highlight' matched fg=green
zstyle ':filter-select' max-lines 10
zstyle ':filter-select' rotate-list yes # enable rotation for filter-select
zstyle ':filter-select' case-insensitive yes # enable case-insensitive
@sgykfjsm
sgykfjsm / sample-docker-with-custom-ami.template
Last active August 29, 2015 14:17
BeanstalkでカスタムAMIを使ったDocker環境を構築するCloudFormationテンプレート
{
"AWSTemplateFormatVersion": "2010-09-09",
"Description": "ApparelCloud MediaAPI Template on elastic beanstalk for Non-VPC",
"Parameters": {
"ApplicationName": {
"Description": "Beanstalk Application Name",
"Type": "String"
},
"BeanstalkInstanceType": {
"AllowedValues": [
@sgykfjsm
sgykfjsm / Dockerfile
Created March 15, 2015 11:46
BeanstalkのDockerプラットフォーム向けのダミーアプリケーション
FROM dockerfile/python
ADD application.py /usr/local/share/application.py
EXPOSE 8000
ENTRYPOINT ["python", "/usr/local/share/application.py"]
@sgykfjsm
sgykfjsm / 00-preinit.config
Last active August 29, 2015 14:17
Docker用のカスタムAMIを使うためにダミーのアプリケーションに仕込んでおく.ebextensions
---
commands:
01-yum-security-update:
command: /usr/bin/yum update -y --security --bugfix --skip-broken
ignoreErrors: true
02-backup-original-hooks:
command: /bin/cp -vpRP /opt/elasticbeanstalk/hooks /opt/elasticbeanstalk/hooks.org
ignoreErrors: true
@sgykfjsm
sgykfjsm / initial_setup_for_custom_ami.sh
Created March 15, 2015 10:26
カスタムAMIを作るときに最低限しておくこと
# ファイルディスクリプタの調整
$ sudo cp -p /etc/security/limits.conf /etc/security/limits.conf.org
$ echo "include limits.d/fd.conf" | sudo tee -a /etc/security/limits.conf
include limits.d/fd.conf
$ cat <<EOF | sudo tee /etc/security/limits.d/fd.conf
> root soft nofile 65536
> root hard nofile 65536
> * soft nofile 65536
> * hard nofile 65536
EOF
@sgykfjsm
sgykfjsm / custom-ami-mold.template
Created March 14, 2015 15:27
cutstom-ami-mold.template for elastic beanstalk docker in us-west-2
{
"AWSTemplateFormatVersion": "2010-09-09",
"Description": "custom-ami-mold.template: This template creating a simple instance in a VPC in order to create custom ami image for elastic beanstalk.",
"Mappings": {
"Tags": {
"SSHSecurityGroup": {
"Name": "Mold-SSHSecurityGroup"
}
}
},
@sgykfjsm
sgykfjsm / OOM1.java
Last active August 29, 2015 14:16
JVMのパラメータチューニングのために"java.lang.OutOfMemoryError"を発生させたい
import java.lang.management.ManagementFactory;
import java.lang.management.MemoryPoolMXBean;
import java.lang.management.MemoryUsage;
public class OOM1 {
private static void output() {
java.util.List<MemoryPoolMXBean> beans =
ManagementFactory.getMemoryPoolMXBeans();
for(MemoryPoolMXBean bean : beans) {