看了《學徒模式》一書後,凍仁試著用 Gist 管理自己的待讀書單,並不時修改其閱讀順序。您可以在 revisions 找到編修記錄。
目錄:
# This is how you add a Jenkins slave | |
# On master: | |
sudo -u jenkins -H ssh-keygen | |
# On slave | |
adduser --system --group --home=/var/lib/jenkins-slave --no-create-home --disabled-password --quiet --shell /bin/bash jenkins-slave | |
install -d -o jenkins-slave -g jenkins-slave /var/lib/jenkins-slave |
#!/bin/sh | |
parse_yaml() { | |
local prefix=$2 | |
local s='[[:space:]]*' w='[a-zA-Z0-9_]*' fs=$(echo @|tr @ '\034') | |
sed -ne "s|^\($s\)\($w\)$s:$s\"\(.*\)\"$s\$|\1$fs\2$fs\3|p" \ | |
-e "s|^\($s\)\($w\)$s:$s\(.*\)$s\$|\1$fs\2$fs\3|p" $1 | | |
awk -F$fs '{ | |
indent = length($1)/2; | |
vname[indent] = $2; | |
for (i in vname) {if (i > indent) {delete vname[i]}} |
@echo off | |
:: Path to Sublime Text installation dir. | |
SET stPath=%~dp0sublime_text.exe | |
SET stPathOnly=%~dp0 | |
:: Key name for the registry entries. | |
SET UserEntry=Sublime Text | |
SET AdminEntry=Sublime Text As Admin | |
:: Context menu texts. | |
SET "UserMenuText=Open with Sublime(&-)" | |
SET "AdminMenuText=Open with Sublime As Admin(&+)" |
# Add the following 'help' target to your Makefile | |
# And add help text after each target name starting with '\#\#' | |
help: ## Show this help. | |
@fgrep -h "##" $(MAKEFILE_LIST) | fgrep -v fgrep | sed -e 's/\\$$//' | sed -e 's/##//' | |
# Everything below is an example | |
target00: ## This message will show up when typing 'make help' | |
@echo does nothing |
function errexit() { | |
local err=$? | |
set +o xtrace | |
local code="${1:-1}" | |
echo "Error in ${BASH_SOURCE[1]}:${BASH_LINENO[0]}. '${BASH_COMMAND}' exited with status $err" | |
# Print out the stack trace described by $function_stack | |
if [ ${#FUNCNAME[@]} -gt 2 ] | |
then | |
echo "Call tree:" | |
for ((i=1;i<${#FUNCNAME[@]}-1;i++)) |