Skip to content

Instantly share code, notes, and snippets.

@steve-jansen
steve-jansen / docker-inspect.sh
Created August 19, 2016 01:55
List labels for a docker container
docker inspect -f '{{ range $k, $v := .ContainerConfig.Labels -}}
{{ $k }}={{ $v }}
{{ end -}}' $cid
@steve-jansen
steve-jansen / README.md
Last active September 9, 2024 14:02
Stop and start Symantec Endpoint Protection on OS X

This script enables you stop and start Symantec Endpoint Protection on OS X

Installation

sudo curl https://gist.githubusercontent.com/steve-jansen/61a189b6ab961a517f68/raw/sep -o /usr/local/bin/sep
sudo chmod 755 /usr/local/bin/sep
sudo chown root:staff /usr/local/bin/sep
@steve-jansen
steve-jansen / .vault
Last active June 7, 2024 03:30
HashiCorp Vault Token Helper using the OS X Keychain
token_helper = "/Users/me/.vault-helper"
@steve-jansen
steve-jansen / Startup.Cmd.cmd
Created March 8, 2013 17:22
A Command Prompt auto-run script to injet DOSKEY macros into the shell from a text file, change the initial working directory to a SUBST'd drive letter, update the PATH to include SysInternal utilities, and log all Command Prompt launches to a history file
:: Name: Startup.Cmd.cmd
:: Purpose: Initializes a Windows command prompt shell
:: Author: stevejansen_github@mac.com
:: Revision: April 2012
@ECHO OFF
SETLOCAL ENABLEEXTENSIONS
:: self-install this script, but, don't force an overwrite if an auto run script is already configured
IF /I "%~1"=="/install" (
@steve-jansen
steve-jansen / ExportVisualBasicCode.bas.vb
Created November 21, 2013 20:56
Excel macro to export all VBA source code in this project to text files for proper source control versioning
' Excel macro to export all VBA source code in this project to text files for proper source control versioning
' Requires enabling the Excel setting in Options/Trust Center/Trust Center Settings/Macro Settings/Trust access to the VBA project object model
Public Sub ExportVisualBasicCode()
Const Module = 1
Const ClassModule = 2
Const Form = 3
Const Document = 100
Const Padding = 24
Dim VBComponent As Object
@steve-jansen
steve-jansen / git-update
Created March 8, 2013 16:29
A custom script for git to stash any working changes, checkout master, pull origin master, checkout your working branch, rebase master, and unstash your working changes
#!/bin/bash
stash() {
# check if we have uncommited changes to stash
git status --porcelain | grep "^." >/dev/null;
if [ $? -eq 0 ]
then
if git stash save -u "git-update on `date`";
then
@steve-jansen
steve-jansen / Startup.Windows.cmd
Created March 8, 2013 17:18
A Windows batch file designed to run at logon from the Start / Programs / Startup to do the following: SUBST drive letters, wipe the %TEMP% folder, and run the disk defragmenter
:: Name: Windows Startup.cmd
:: Purpose: A logon script to SUBST drive letters, wipe %TEMP%, and run defrag
:: Author: stevejansen_github@mac.com
:: Revision: April 2012
@ECHO OFF
SETLOCAL
:: map local folders to drive letters
CALL :MAPDRIVE P: "%USERPROFILE%\Documents\Visual Studio 2010\Projects"
@steve-jansen
steve-jansen / export-zone.sh
Created December 15, 2014 19:11
Export DNS records from Rackspace Cloud DNS to zone files on disk
#!/bin/bash
# exports DNS records from Rackspace Cloud DNS to text files
# Depends on https://github.com/wichert/clouddns/blob/master/src/clouddns.py
set -e
me=export-zone
base_domain=
rackspace_region=
rackspace_rate_limit_delay=3
@steve-jansen
steve-jansen / MsDepSvc.Port.cmd
Created February 28, 2013 21:37
Windows batch script to modify the TCP/IP port binding for the Microsoft Web Deployment Agent Service
:: Name: MsDepSvc.Port.cmd
:: Purpose: Modifies the TCP/IP port that the Web Deployment Agent Service
:: (MsDepSvc) listens on. Tested on Win7 Enterprise 32-bit.
:: Author: stevejansen_github@icloud.com
:: Revision: January 2013
@ECHO OFF
SETLOCAL ENABLEEXTENSIONS
SETLOCAL ENABLEDELAYEDEXPANSION
@steve-jansen
steve-jansen / mirror-docker-registries.sh
Last active February 11, 2021 10:44
Mirror a Docker Trusted Registry (DTR) to another registry
#!/bin/bash
read -p "Registry to clone from: " pull_registry
read -p "Username for $pull_registry: " user
read -s -p "Password for $pull_registry: " password
echo
read -p "Registry to clone onto: " push_registry
echo Querying $pull_registry...