Skip to content

Instantly share code, notes, and snippets.

View chusiang's full-sized avatar
🐧
Improving the world via Ansible and DevOps.

Chu-Siang Lai chusiang

🐧
Improving the world via Ansible and DevOps.
View GitHub Profile
@chusiang
chusiang / _etc_init.d_mongodb
Last active August 29, 2015 14:00
解決 MongoDB Daemon 在清空 /var 後無法正常啟動問題
#!/bin/sh
#
# init.d script with LSB support.
#
# Copyright (c) 2007 Javier Fernandez-Sanguino <jfs@debian.org>
#
# This is free software; you may redistribute it and/or modify
# it under the terms of the GNU General Public License as
# published by the Free Software Foundation; either version 2,
# or (at your option) any later version.
@chusiang
chusiang / _etc_init.d_php5-fpm
Last active August 29, 2015 14:04
Auto modify permission php5-fpm.sock with start the Nginx service
#!/bin/sh
### BEGIN INIT INFO
# Provides: php-fpm php5-fpm
# Required-Start: $remote_fs $network
# Required-Stop: $remote_fs $network
# Default-Start: 2 3 4 5
# Default-Stop:
# Short-Description: starts php5-fpm
# Description: Starts PHP5 FastCGI Process Manager Daemon
### END INIT INFO
@chusiang
chusiang / _etc_init.d_nginx
Created July 25, 2014 01:38
解決 Nginx Daemon 在清空 /var 後無法正常啟動問題
#!/bin/sh
### BEGIN INIT INFO
# Provides: nginx
# Required-Start: $local_fs $remote_fs $network $syslog $named
# Required-Stop: $local_fs $remote_fs $network $syslog $named
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: starts the nginx web server
# Description: starts nginx using start-stop-daemon
[jonny@thinkpad-t410 ~/vcs/repo_gerrit/droid ] -17:57
$ repo --trace upload manifest/
[......]
Upload project manifest/ to remote branch master:
branch master ( 2 commits, Tue Jul 29 17:59:15 2014 +0800):
f49866f5 Doing the lab of link repo and gerrit.
2fd92a4a testing the repo x gerrit #2.
to 192.168.1.218:8081/ (y/N)? y
# mdadm.conf
#
# Please refer to mdadm.conf(5) for information about this file.
#
# by default (built-in), scan all partitions (/proc/partitions) and all
# containers for MD superblocks. alternatively, specify devices to scan, using
# wildcards if desired.
#DEVICE partitions containers
DEVICE /dev/sdb1 /dev/sdc1 /dev/sdd1
// Includes functions for exporting active sheet or all sheets as JSON object (also Python object syntax compatible).
// Tweak the makePrettyJSON_ function to customize what kind of JSON to export.
var FORMAT_ONELINE = 'One-line';
var FORMAT_MULTILINE = 'Multi-line';
var FORMAT_PRETTY = 'Pretty';
var LANGUAGE_JS = 'JavaScript';
var LANGUAGE_PYTHON = 'Python';
@chusiang
chusiang / mirror.list
Created January 30, 2015 06:05
apt-mirror for Debian 7 / Ubuntu 12.04, 14.04 and other.
############# config ##################
#
set base_path /var/spool/apt-mirror
#
set mirror_path $base_path/mirror
set skel_path $base_path/skel
set var_path $base_path/var
# set cleanscript $var_path/clean.sh
# set defaultarch <running host architecture>
# set postmirror_script $var_path/postmirror.sh
@chusiang
chusiang / ks.cfg.precise
Last active August 29, 2015 14:16
Kickstart script for Ubuntu 12.04
# ====================================================================
# Author: 凍仁翔 / chusiang.lai (at) gmail.com
# Blog: http://note.drx.tw
# Filename: ks.cfg.
# Modified: 2015-02-25 10:30
# Description: Kickstart Configurator for Ubuntu 12.04.5 LTS server (amd64)
# Reference:
#
# 1. 作業系統自動安裝應答 CD 製作 - kickstart | iThome Download
# - http://download.ithome.com.tw/article/index/id/1792
@chusiang
chusiang / sources.list
Created March 7, 2015 13:10
sources.list for Debian 7 (wheezy)
# deb cdrom:[Debian GNU/Linux testing _Wheezy_ - Official Snapshot amd64 CD Binary-1 20130121-05:03]/ wheezy main
deb http://opensource.nchc.org.tw/debian/ wheezy main contrib non-free
deb-src http://opensource.nchc.org.tw/debian/ wheezy main contrib non-free
deb http://opensource.nchc.org.tw/debian/ wheezy-updates main contrib non-free
deb-src http://opensource.nchc.org.tw/debian/ wheezy-updates main contrib non-free
# backports for docker
deb http://opensource.nchc.org.tw/debian/ wheezy-backports main
@chusiang
chusiang / change-timezone-centos.sh
Created March 25, 2015 03:36
Change Timezone to Taipei, Asia on CentOS.
#!/bin/bash
# ============================================================
# Author: 凍仁翔 / chusiang.lai (at) gmail.com
# Blog: http://note.drx.tw
# Filename: change-timezone-centos.sh
# Modified: 2015-03-25 11:31
# Description: Change Timezone to Taipei, Asia on CentOS.
# Reference:
#
# 1. Change Timezone in CentOS | Chris Jean