Skip to content

Instantly share code, notes, and snippets.

@steve-jansen
steve-jansen / jenkins.portforwarding.sh
Last active August 29, 2015 13:57
`/etc/init.d/jenkins.portforwarding` script for SUSE Linux to forward port 80 traffic to the HTTP port for the Jenkins continuous build server
#!/bin/sh
#
# SUSE system statup script for port forwarding port 80 to the port
# for the Jenkins continuous build server.
#
# Jenkins normally does not run as root, thus /etc/init.d/jenkins cannot
# bind to ports < 1024 since SUSE does not support authbind (or similar).
#
# The MIT License (MIT)
#
@steve-jansen
steve-jansen / download.cmd
Created March 5, 2014 22:41
A Windows batch script to download multiple large binary files from an FTP server in parallel, with support for resuming interrupted downloads.
SETLOCAL
PUSHD "%USERPROFILE%\Downloads"
IF NOT EXIST "installers" MKDIR "installers"
CD "installers"
ECHO @ECHO OFF > curl.cmd
ECHO TITLE "%~1" >> curl.cmd
ECHO IF NOT ".%~p1"==".\" IF NOT EXIST ".%~p1" MKDIR ".%~p1" >> curl.cmd
ECHO PUSHD ".%~p1" >> curl.cmd
@steve-jansen
steve-jansen / README.md
Last active February 23, 2024 22:38
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
var express = require('express'),
proxy = require('./lib/proxy');
var app = express();
app.configure(function() {
app.use(express.favicon(false));
app.use(express.logger('dev'));
app.use(proxy.initialize({
proxy: {
@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 / 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...
@steve-jansen
steve-jansen / bookmarklet.js
Last active August 19, 2016 23:15
Bookmarklet to create a terraform.tfvars file from an Atlas Terraform environment variables page
javascript:var s='';for(i=0;;i++){k=document.forms[0]["runtime_configuration[tf_vars_attributes]["+i+"][key]"];v=document.forms[0]["runtime_configuration[tf_vars_attributes]["+i+"][value]"]; if(k && v){s+=[k.value,'=',v.value,'\n'].join('');}else{break};};window.location="data:text/plain;base64,"+btoa(s);
@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 / .vault
Last active November 11, 2022 05:24
HashiCorp Vault Token Helper using the OS X Keychain
token_helper = "/Users/me/.vault-helper"
@steve-jansen
steve-jansen / WINFILETIME.sh
Created September 28, 2016 15:56
Convert a Windows FILETIME value to a localized date string
# 131194047065676512 is an example FILETIME value
ruby -e 'puts Time.at((Integer(ARGV[0]) - 116444736000000000) / 10000000)' -- 131194047065676512