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 / mirror.list
Last active December 15, 2020 16:01
Creating a Debian Repository with apt-mirror
It's very handy to have a local mirror of the Debian stable repository, especially if you want to do fast network installs and updates for multiple systems. By default, the Debian utility apt-mirror does a great job of pulling over packages, but to be able to use PXE netbooting and other cool tricks you need to do a few tweaks to its basic configuration.
#### START /etc/apt/mirror.list ####
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
@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
以 Debian 的方式(IN THE DEBIAN WAY): aptitude 參考手冊 v 0.2.0
aptitude 參考手冊
eTony etony@tom.com debian.linuxsir.org
dec 15, 2005
Abstract:
本文是對初學者的一個簡短的指南, aptitude 是用於 Debian GNU/Linux 套件操作的一個控制台前端. 希望本文對進入 Debian GNU/Linux 殿堂的初學者有所裨益.
// 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 / grub.cfg
Last active December 8, 2020 16:09
grub.cfg of multi-bootable disk.
# ============================================================
# Author: 凍仁翔 / chusiang.lai (at) gmail.com
# Blog: http://note.drx.tw
# Filename: grub.cfg
# Modified: 2015-01-14 23:05
# Description: grub configure of multi-bootable disk.
#
# Now, we can boot with:
# * Try Ubuntu 14.04.1 Desktop (EFI)
# * Try Ubuntu 12.04.5 Desktop (EFI)
@chusiang
chusiang / grub.cfg
Last active May 8, 2021 17:09
grub config of the Clonezilla and Debian.
# ============================================================
# Author: 凍仁翔 / chusiang.lai (at) gmail.com
# Blog: http://note.drx.tw
# Filename: grub.cfg
# Modified: 2015-01-15 10:21
# Description: grub config of mix disk for the Clonezilla and Debian.
#
# Now, we can boot with:
# * Clonezilla Live
# * Install Debian 7.7