Skip to content

Instantly share code, notes, and snippets.

View motchang's full-sized avatar
👺
hmmmmmm

Kouji OKAMOTO motchang

👺
hmmmmmm
View GitHub Profile
@motchang
motchang / xvfb.sh
Last active June 17, 2016 07:29
/etc/init.d/xvfb
#!/bin/bash
#
# Xvfb
#
# chkconfig: - 90 30
# description: Xvfb
# Source function library.
. /etc/init.d/functions
lockfile="/var/lock/subsys/xvfb"
@motchang
motchang / crontab
Last active June 17, 2016 07:29
mkswap
5 9 * * * root /sbin/swapoff -a && /root/bin/mkswap.sh
@motchang
motchang / file0.txt
Created July 5, 2015 09:45
sakura に入れてるやつの configure オプション ref: http://qiita.com/motchang/items/ea9eb8149dec11e3096a
./configure --prefix=/usr/local/etc/nginx --sbin-path=/usr/local/sbin/nginx --conf-path=/usr/local/etc/nginx/nginx.conf --error-log-path=/var/log/nginx/error.log --http-log-path=/var/log/nginx/access.log --pid-path=/var/run/nginx.pid --lock-path=/var/run/nginx.lock --http-client-body-temp-path=/var/cache/nginx/client_temp --http-proxy-temp-path=/var/cache/nginx/proxy_temp --http-fastcgi-temp-path=/var/cache/nginx/fastcgi_temp --http-uwsgi-temp-path=/var/cache/nginx/uwsgi_temp --http-scgi-temp-path=/var/cache/nginx/scgi_temp --user=nginx --group=nginx --with-http_ssl_module --with-http_realip_module --with-http_addition_module --with-http_sub_module --with-http_dav_module --with-http_flv_module --with-http_mp4_module --with-http_gzip_static_module --with-http_random_index_module --with-http_secure_link_module --with-http_stub_status_module --with-mail --with-mail_ssl_module --with-file-aio --with-cc-opt='-O2 -g -m64 -mtune=generic' --with-http_stub_status_module
@motchang
motchang / file0.txt
Created April 14, 2015 02:41
ユーザーの公開鍵の一覧をつくる ref: http://qiita.com/motchang/items/cc1e979a2d1c712bc741
ls -nd /home/* | sort -n -k 3,3 | awk '{ print $NF }' | while read user
do
echo ${user}
cat ${user}/.ssh/authorized_keys
done
@motchang
motchang / file0.txt
Last active August 29, 2015 14:18
aws cli で iam の group に紐づく user, policy を見る ref: http://qiita.com/motchang/items/aee024fad5e49ce872d1
#!/bin/bash
aws iam list-groups | jq '.Groups[].GroupName' | xargs -I{} echo {} | \
while read g
do
echo ${g} "-------------------------------------------------------------";
aws iam get-group --group-name ${g} | jq '(.Group | {GroupName, Arn}), (.Users[] | {UserName, Arn})'
aws iam list-group-policies --group-name ${g} | jq '.PolicyNames[]' | xargs -I{} echo {} | \
while read p