Skip to content

Instantly share code, notes, and snippets.

Avatar
🚀

Scott E. Russell AmundsenJunior

🚀
View GitHub Profile
@jaketame
jaketame / logging_subprocess.py
Created Apr 28, 2017
Python subprocess logging to logger from stdout/stderr
View logging_subprocess.py
#!/usr/local/bin/python3
import logging, select, subprocess
LOG_FILE = "test.log"
logger = logging.getLogger(__name__)
logging.basicConfig(level=logging.INFO,filename=LOG_FILE,format='%(asctime)s - %(name)s - %(levelname)s - %(message)s')
def logging_call(popenargs, **kwargs):
process = subprocess.Popen(popenargs, stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
@Faheetah
Faheetah / Jenkinsfile.groovy
Last active Jun 30, 2021
Jenkinsfile idiosynchrasies with escaping and quotes
View Jenkinsfile.groovy
node {
echo 'Results included as an inline comment exactly how they are returned as of Jenkins 2.121, with $BUILD_NUMBER = 1'
echo 'No quotes, pipeline command in single quotes'
sh 'echo $BUILD_NUMBER' // 1
echo 'Double quotes are silently dropped'
sh 'echo "$BUILD_NUMBER"' // 1
echo 'Even escaped with a single backslash they are dropped'
sh 'echo \"$BUILD_NUMBER\"' // 1
echo 'Using two backslashes, the quotes are preserved'
sh 'echo \\"$BUILD_NUMBER\\"' // "1"
@chinshr
chinshr / Jenkinsfile
Last active May 22, 2021
Best of Jenkinsfile, a collection of useful workflow scripts ready to be copied into your Jenkinsfile on a per use basis.
View Jenkinsfile
#!groovy
# Best of Jenkinsfile
# `Jenkinsfile` is a groovy script DSL for defining CI/CD workflows for Jenkins
node {
}
View kibana-4.x-default
user="kibana"
group="root"
chroot="/"
chdir="/"
nice=""
@RomkeVdMeulen
RomkeVdMeulen / secure_expose_docker.sh
Last active Sep 4, 2019
Script for setting up secure public connection for a Docker daemon
View secure_expose_docker.sh
#!/bin/bash
if [ $# -lt 2 ]; then
echo "Usage: $0 [domain to connect] [password]"
exit 1
fi
set -e
red='\033[0;31m'
@kurokikaze
kurokikaze / gist:350fe1713591641b3b42
Created Oct 3, 2014
install chrome from powershell
View gist:350fe1713591641b3b42
(new-object System.Net.WebClient).DownloadFile('http://dl.google.com/chrome/install/375.126/chrome_installer.exe', 'c:/temp/chrome.exe');. c:/temp/chrome.exe /silent /install;rm c:/temp -rec
@rrosiek
rrosiek / install_mysql.sh
Last active Apr 10, 2021
Vagrant provision script for php, Apache, MySQL, phpMyAdmin, Laravel, and javascript helpers. Tested with Ubuntu 16.04.
View install_mysql.sh
#! /usr/bin/env bash
###
#
# install_mysql.sh
#
# This script assumes your Vagrantfile has been configured to map the root of
# your application to /vagrant and that your web root is the "public" folder
# (Laravel standard). Standard and error output is sent to
# /vagrant/vm_build.log during provisioning.
View tmux-cheatsheet.markdown

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
View tmux_cheatsheet.markdown

tmux cheatsheet

As configured in my dotfiles.

start new:

tmux

start new with session name: