Skip to content

Instantly share code, notes, and snippets.

@timcrider
timcrider / jenkins-export-plugins.sh
Created November 16, 2018 15:32
Shell script to export Jenkins plugins/versions into an ansible friendly format
#!/bin/bash
# Requirements
PROGS=("xmlstarlet")
for PROG in "${PROGS[@]}" ; do
command -v $PROG >/dev/null 2>&1 || { echo >&2 "System requirement $PROG not met. Please install $PROG"; exit 1; }
done
# Sanity

Keybase proof

I hereby claim:

  • I am timcrider on github.
  • I am timcrider (https://keybase.io/timcrider) on keybase.
  • I have a public key ASCjFXfbAFgIVc1zgzfziRaVjeGn0f4va04zKbztc5xovAo

To claim this, I am signing this object:

#!/bin/bash
HOSTSFILE="/etc/hosts"
BAKFILE="$HOSTSFILE.bak"
DOMAINREGEX="^[a-zA-Z0-9]{1}[a-zA-Z0-9\.\-]+$"
IPREGEX="^[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}$"
URLREGEX="^https?:\/\/[a-zA-Z0-9]{1}[a-zA-Z0-9\/\.\-]+$"
backup()
{
@timcrider
timcrider / Base.php
Created April 13, 2012 15:37
PHP Base Class with simple custom extensions.
<?php
/**
* Base class
*
* Quick and easy generic object that is more E_NOTICE friendly than normal.
* - Variables that do not exist return NULL instead of E_NOTICE errors
* - Adding of anonymous functions
*
* #############################################################################
* # Example 1 - Adding variables and cycling through them
@timcrider
timcrider / virtualhost.conf
Created November 23, 2011 20:54
Apache 'no reboot needed' virtual host configuration for development sites.
###############################################################################
#
# Apache virtual host 'no reboot needed' template.
#
# This apache virtualhost configuration allows a user to create development
# sites on the fly. This will not work out of the box however, you will need
# to replace the {variables} in this conf with values explained below. This
# can be done with a script, or a simple find and replace in your favorite
# editor.
#