Skip to content

Instantly share code, notes, and snippets.

View netmarkjp's full-sized avatar

BABA Toshiaki netmarkjp

View GitHub Profile
@netmarkjp
netmarkjp / playbook.yml
Last active August 29, 2015 14:04
install docker(latest) + nsenter(2.24.2) with ansible
- hosts: all
sudo: yes
tasks:
- apt: upgrade=yes update_cache=yes cache_valid_time=86400
- apt: name={{ item }} state=installed
with_items:
- git
- etckeeper
- apt: name={{ item }} state=installed
with_items:
@netmarkjp
netmarkjp / enable_rps.sh
Last active February 24, 2016 08:21
enable rps/rfs on centos6
#!/bin/bash
VAL_RPS_FLOW_CNT="32768"
VAL_RPS_SOCK_FLOW_ENTRIES="32768"
PROC_NUM=$(cat /proc/cpuinfo | grep -c ^processor)
VAL_RPS_CPUS=0
if [ ${PROC_NUM:?} -eq 1 ]
then
@netmarkjp
netmarkjp / install_kvm.sh
Created May 26, 2014 09:10
install_kvn(provosioning script)
#!/bin/bash
yum -y groupinstall "Virtualization" "Virtualization Client" "Virtualization Platform" "Virtualization Tools"
@netmarkjp
netmarkjp / 71.go
Created May 22, 2014 06:50
go-tour 71 web crawler
package main
import (
"errors"
"fmt"
"log"
"math/rand"
"time"
)
@netmarkjp
netmarkjp / selinux_stat.sh
Created May 15, 2014 09:40
SELinuxの設定って /etc/sysconfig/selinux 優先なんだっけ…@amazon Linux
[root@wweb ~]# cat /etc/*release
Amazon Linux AMI release 2014.03
[root@web ~]# grep ^SE /etc/selinux/config /etc/sysconfig/selinux
/etc/selinux/config:SELINUX=enforcing
/etc/selinux/config:SELINUXTYPE=targeted
/etc/sysconfig/selinux:SELINUX=disabled
/etc/sysconfig/selinux:SELINUXTYPE=targeted
[root@web ~]# getenforce
Disabled
@netmarkjp
netmarkjp / gentoo modules
Created May 11, 2014 10:31
gentoo modules
baba@localhost ~ $ sudo grep CONFIG_MODULES /usr/src/linux/.config
CONFIG_MODULES_USE_ELF_RELA=y
CONFIG_MODULES=y
baba@localhost ~ $ sudo grep =m /usr/src/linux/.config
CONFIG_NF_NAT=m
CONFIG_NF_NAT_FTP=m
CONFIG_NF_NAT_IRC=m
CONFIG_NF_NAT_SIP=m
CONFIG_NETFILTER_XT_MARK=m
CONFIG_NETFILTER_XT_TARGET_LOG=m
@netmarkjp
netmarkjp / fdisk -l
Created May 5, 2014 05:10
fdisk -l on Azure + Ubuntu 14.04
$ sudo fdisk -l
Disk /dev/sda: 31.5 GB, 31457280000 bytes
4 heads, 32 sectors/track, 480000 cylinders, total 61440000 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00013818
Device Boot Start End Blocks Id System
#!/bin/bash
## Usage:
## sudo bash run_jmeter.sh test.jmx
JMETER="`dirname $0`/apache-jmeter-2.11/bin/jmeter"
NOW=$(date +%Y%m%d_%H%M)
export JVM_ARGS="-Xloggc:${NOW}/gc.log -XX:+PrintGCDetails -XX:+PrintGCTimeStamps -XX:+PrintGCDateStamps -XX:+UseConcMarkSweepGC -XX:+CMSClassUnloadingEnabled"
FROM centos
RUN yum -y update
RUN yum -y groupinstall core
RUN yum -y groupinstall base
RUN echo 'p@ssw0rd' | passwd --stdin root
RUN service sshd start
RUN service sshd stop
RUN touch /etc/sysconfig/network
RUN rm -f /etc/localtime ; ln -s /usr/share/zoneinfo/Asia/Tokyo /etc/localtime
RUN yum -y install gcc-c++
# basic setup
sudo apt-get -y install ibus-mozc nautilus-dropbox curl tmux vim vim-gnome compizconfig-settings-manager git mercurial build-essential clipit docker.io virtualbox vagrant gimp keepassx
sudo usermod -G docker -a `whoami`
sudo docker.io pull ubuntu
sudo docker.io pull centos
sudo apt-get -y install wine
# google chrome
firefox http://www.google.co.jp/intl/ja/chrome/browser/