Skip to content

Instantly share code, notes, and snippets.

@orita
orita / fig.yml
Last active August 29, 2015 14:12
sameersbn/docker-gitlab fig
# mkdir -p /data/docker-gitlab
# cd /data/docker-gitlab
# wget https://gist.githubusercontent.com/orita/6d557d9a0fcc82615f98/raw/c32ec427149c81902bd100434fc1bc6be54eb34a/fig.yml
# # edit GITLAB_HOST
# mkdir -p data/certs
# cd data/certs
# openssl genrsa -out gitlab.key 2048
# openssl req -new -key gitlab.key -out gitlab.csr
# openssl x509 -req -days 365 -in gitlab.csr -signkey gitlab.key -out gitlab.crt
# chmod 400 gitlab.key
@orita
orita / mkpasswd512_test.py
Created November 24, 2014 15:38
mkpasswd512_test.py
import sys, string, crypt
from random import *
argvs = sys.argv
chars = string.ascii_letters + string.digits
salt = "$6$" + "".join(choice(chars) for i in range(16))
print crypt.crypt(argvs[0], salt)
@orita
orita / opensocial_owner_id_urlencode.awk
Created March 24, 2014 09:00
URL encode opensocial_owner_id
BEGIN {
for (i = 0; i <= 255; i++)
ord[sprintf("%c", i)] = i
}
# Encode string with application/x-www-form-urlencoded escapes.
function escape(str, c, len, res) {
len = length(str)
res = ""
for (i = 1; i <= len; i++) {
@orita
orita / gist:9383986
Created March 6, 2014 07:10
mysql 5.5 with mysql community yum repository EL6
rpm -ivh http://dev.mysql.com/get/mysql-community-release-el6-5.noarch.rpm
yum --enablerepo=mysql55-community --disablerepo=mysql56-community
install mysql-community-server
@orita
orita / gist:9168282
Created February 23, 2014 07:23
Docker image and yum clean all
  • CentOS 6.5
  • Linux 2.6.32-431.5.1.el6.x86_64
  • Docker version 0.7.6, build bc3b2ec/0.7.6 (via epel)

without yum clean all

REPOSITORY          TAG                 IMAGE ID            CREATED             VIRTUAL SIZE
mission-redis       latest              629e9e638282        12 seconds ago      368.2 MB
@orita
orita / Dockerfile
Created February 22, 2014 15:58
Dockerfile centos-ja
FROM centos
MAINTAINER Naohisa Orita
RUN echo 'LANG="ja_JP.UTF-8"' > /etc/sysconfig/i18n ;echo 'ZONE="Asia/Tokyo"' > /etc/sysconfig/clock ;cp -a /usr/share/zoneinfo/Asia/Tokyo /etc/localtime
@orita
orita / gist:3148887
Created July 20, 2012 05:37
ssh-agent for bash_profile and bash_logout
cp ~/.bash_profile ~/dot.bash_profile.$$
cat <<'EOF'>> ~/.bash_profile
# ssh-agent
SSH_AUTH_SOCK=~/.ssh/agent.sock
SSH_AUTH_INFO=~/.ssh/ssh-agent-info
#if [ ! -f ${SSH_AUTH_SOCK} ] ; then
# mksock ${SSH_AUTH_SOCK}
#fi
@orita
orita / virt-install_ubuntu12
Created June 27, 2012 02:01
virt-install ubuntu 12.04 with virtio
mkdir -p /data/kvm/images/ubuntu12/
qemu-img create -f qcow2 /data/kvm/images/ubuntu12/boot.img 10G
virt-install --connect qemu:///system \
--arch=x86_64 \
--accelerate \
--name ubuntu12 \
--ram=1024 \
--vcpus=2 \
--hvm \