Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@mgedmin
mgedmin / gist:9547214
Created March 14, 2014 12:59
Setting up a Jenkins slave on Linux
# 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
@jcppkkk
jcppkkk / OpenWithSublime.bat
Last active June 25, 2023 22:07 — forked from FoxColdMetal/OpenWithSublimeText.bat
[[[ Move to https://github.com/jcppkkk/OpenWithSublime !!! ]]] Add context menu to allow user open file or folder with Sublime as User (or as Admin).
@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(&+)"
@ahendrix
ahendrix / gist:7030300
Created October 17, 2013 18:56
bash stacktrace
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++))
@chusiang
chusiang / myToReadBookLists.md
Last active March 27, 2024 08:49
凍仁的讀書清單

凍仁的讀書清單

Migrated to GitLab and GitHub.

看了《學徒模式》一書後,凍仁試著用 Gist 管理自己的待讀書單,並不時修改其閱讀順序。您可以在 revisions 找到編修記錄。

目錄:

  1. 待讀書單
  2. 已讀書單
@prwhite
prwhite / Makefile
Last active April 4, 2024 19:01
Add a help target to a Makefile that will allow all targets to be self documenting
# 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
@pkuczynski
pkuczynski / parse_yaml.sh
Last active April 9, 2024 18:36
Read YAML file from Bash script
#!/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]}}