Skip to content

Instantly share code, notes, and snippets.

Required Packages Luckily, installing this on Debian/Ubuntu is dead simple. bash

apt-get install ssmtp

Then, you'll need to edit your ssmtp.conf file.

nano /etc/ssmtp/ssmtp.conf

Basic Usage

Start a new tmux session

$ tmux

Reattach to an existing tmux session

$ tmux attach

@casmith
casmith / bamboo_delete_disabled_branches.sh
Created February 2, 2018 03:56 — forked from sguillope/bamboo_delete_disabled_branches.sh
Script to delete all disabled branches of a Bamboo build plan.
#!/bin/bash -u
# Deletes all disabled branches of a Bamboo build plan
# -----------------------------------------------------------------------------
# Syntax:
# $0 {planKey}
# -----------------------------------------------------------------------------
# Purpose: Bamboo does not automatically delete plan branches when the
# corresponding branch in the repository gets deleted. Because Bamboo fails
# to pull from it, it disables the branch but keep it around forever.
# This script goes through all branches of a build plan and delete the ones
'use strict';
function convertDigit(val, one, five, ten) {
if (val !== '' && val !== undefined && val !== '0') {
val = parseInt(val);
if (val < 4) {
return one.repeat(val);
} else if (val <= 5) {
return one.repeat(5 - val) + five;
} else if (val < 9) {
for k in $(git branch | sed /\*/d); do
if [ -Z "$(git log -1 --since='2 months ago' -s $k)" ]; then
echo $k
fi
done
task explodedWar(type: Copy) {
into "$buildDir/exploded"
with war
}
war.dependsOn explodedWar
@casmith
casmith / pre-commit
Last active November 7, 2017 15:12
#!/bin/bash
if test $(git rev-parse --abbrev-ref HEAD) = "master" ; then
echo "Cannot commit on master"
exit 1
fi
if test $(git rev-parse --abbrev-ref HEAD) = "develop" ; then
echo "Cannot commit on develop"
exit 1
fi