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 / slackpost.sh
Last active March 28, 2018 07:58 — forked from dopiaza/slackpost
Post a message to a Slack channel
#!/bin/bash
# ============================================================
# Author: Chu-Siang Lai / chusiang (at) drx.tw
# Blog: http://note.drx.tw
# Filename: slackpost.sh
# Modified: 2018-03-28 15:58
# Description: Post a message to a Slack channel.
# Reference:
#
# - https://gist.github.com/dopiaza/6449505#gistcomment-1627214
# -*- mode: ruby -*-
# vi: set ft=ruby :
=begin
The Vagrantfile template is fork from https://gist.github.com/joepurdy/28b894574cee15344918.
# Ansible (Windows) VMs
config.vm.box = "chusiang/win10-x64-ansible"
# System Account Credentials
@chusiang
chusiang / laravel.logrotate
Last active December 23, 2015 09:55 — forked from Repox/laravel
Laravel logrotate configuration (1 daily rotation, 7 days retention) on Ubuntu 14.04
/home/USERNAME/workspace/laravel/storage/logs/laravel.log {
daily
missingok
rotate 7
maxage 7
compress
notifempty
create 644 www-data www-data
su www-data www-data
}
@chusiang
chusiang / com.docker.docker-machine.plist
Last active March 18, 2016 08:32 — forked from johnantoni/com.docker.boot2docker.plist
run docker-machine on system startup - Mac OSX - El Capitan
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>com.docker.docker-machine</string>
<key>ProgramArguments</key>
<array>
<string>/usr/local/bin/docker-machine</string>
<string>start</string>
@chusiang
chusiang / virtualenv-auto-activate.sh
Created November 27, 2015 05:15 — forked from Willyfrog/virtualenv-auto-activate.sh
virtualenv-auto-activate-auto-deactivate
#!/bin/bash
# virtualenv-auto-activate.sh
#
# Installation:
# Add this line to your .bashrc or .bash-profile:
#
# source /path/to/virtualenv-auto-activate.sh
#
# Go to your project folder, run "virtualenv .venv", so your project folder
# has a .venv folder at the top level, next to your version control directory.
// 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
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