Skip to content

Instantly share code, notes, and snippets.

@chrisnolet
chrisnolet / .zshrc
Last active October 15, 2024 01:10
Color-coded git branch for zsh prompt
autoload -Uz compinit && compinit
autoload -Uz add-zsh-hook
autoload -Uz vcs_info
add-zsh-hook precmd vcs_info
zstyle ':vcs_info:*' enable git
zstyle ':vcs_info:*' formats " %F{cyan}%c%u(%b)%f"
zstyle ':vcs_info:*' actionformats " %F{cyan}%c%u(%b)%f %a"
zstyle ':vcs_info:*' stagedstr "%F{green}"
@tariq-islam
tariq-islam / OCPLABNOTES.md
Last active April 17, 2017 18:50
OCP Lab Notes
@ctran
ctran / check-slave-jar-version.groovy
Last active May 9, 2023 12:21
Check slave.jar versions of slaves against expected version on Jenkins master
import jenkins.model.*
import hudson.remoting.Launcher
import hudson.slaves.SlaveComputer
def expectedVersion = Launcher.VERSION
for (computer in Jenkins.instance.getComputers()) {
if (! (computer instanceof SlaveComputer)) continue
if (!computer.getChannel()) continue
def version = computer.getSlaveVersion()
@hartfordfive
hartfordfive / pre-receive-puppet
Last active October 2, 2020 16:33
Server-side pre-receive hook to validate puppet files.
#!/bin/bash
COMMAND='puppet parser validate'
TEMPDIR=`mktemp -d`
echo "### Attempting to validate puppet files... ####"
# See https://www.kernel.org/pub/software/scm/git/docs/githooks.html#pre-receive
oldrev=$1
newrev=$2
@will-hart
will-hart / README.md
Last active January 28, 2016 03:15
An ember dice rolling application based on a tutorial at http://www.williamhart.info/an-emberjs-beginners-tutorial.html.
@florinel-chis
florinel-chis / centos-install-casperjs
Created August 7, 2013 11:21
install casperjs on centos (x64)
wget https://phantomjs.googlecode.com/files/phantomjs-1.9.1-linux-x86_64.tar.bz2
bunzip2 phantomjs-1.9.1-linux-x86_64.tar.bz2
tar xf phantomjs-1.9.1-linux-x86_64.tar
mv phantomjs-1.9.1-linux-x86_64/ /opt/
ln -s /opt/phantomjs-1.9.1-linux-x86_64/ /opt/phantomjs
ln -s /opt/phantomjs/bin/phantomjs /usr/local/bin/
#check what you've just done
which phantomjs
phantomjs --version
@sycobuny
sycobuny / git.pp
Created February 16, 2012 03:15
A simple example of a puppet config with git automatic deployment based on "release-#" tags
class git {
package { 'git':
ensure => installed,
}
define repository($project = $name, $cwd, $dir = "$cwd/${project}",
$repo = "githost:${project}.git", $no_ensure = 0) {
$require = $no_ensure ? {
1 => [Package['git']],
default => [Package['git'], File[$cwd]],
@pfig
pfig / perl_smoker
Created May 21, 2011 21:21 — forked from melo/perl_smoker
Script to use with Jenkins to smoke a Perl module
#!/bin/sh
#
# Use this as Jenkins Build "Execute shell" script
#
# Pedro Melo <[email protected]>
## Die on any errors
set -ex
export OUTPUT=$WORKSPACE/logs