Simple collection of Groovy scripts to help me maintain some Jenkins systems.
See also https://wiki.jenkins-ci.org/display/JENKINS/Jenkins+Script+Console
# | |
# Installation: | |
# mkdir -p ~/.byobu | |
# wget -O ~/.byobu/keybindings.tmux byobu.relaxdiego.com | |
# tmux source-file ~/.byobu/keybindings.tmux | |
# | |
# Rebind Ctrl-a as the prefix | |
unbind-key -n C-a | |
set -g prefix ^A |
Simple collection of Groovy scripts to help me maintain some Jenkins systems.
See also https://wiki.jenkins-ci.org/display/JENKINS/Jenkins+Script+Console
#!/usr/bin/env bash | |
# | |
# Author: Stefan Buck | |
# https://gist.github.com/stefanbuck/ce788fee19ab6eb0b4447a85fc99f447 | |
# | |
# | |
# This script accepts the following parameters: | |
# | |
# * owner | |
# * repo |
# install deps | |
yum install gcc kernel-devel make ncurses-devel | |
# DOWNLOAD SOURCES FOR LIBEVENT AND MAKE AND INSTALL | |
wget https://github.com/downloads/libevent/libevent/libevent-2.0.21-stable.tar.gz | |
tar -xvzf libevent-2.0.21-stable.tar.gz | |
cd libevent-2.0.21-stable | |
./configure --prefix=/usr/local | |
make | |
sudo make install |
#!/usr/bin/env bash | |
# | |
# Usage: ./yaml-to-json.sh | jq . | |
# | |
file=$1 | |
if ! pip show pyyaml >/dev/null; then | |
echo "PyYAML needs to be installed" |
#!/usr/bin/env bash | |
ip_address=$( | |
aws ec2 describe-instances --instance-id $instance_id | \ | |
jq -r ".Reservations[] | .Instances[] | select(.InstanceId==\"$instance_id\") | .PublicIpAddress" | |
) | |
if ! grep $ip_address ~/.ssh/known_hosts >/dev/null; then | |
# Print the SSH fingerprints for jumpbox | |
echo "Valid server key fingerprints:" | |
aws ec2 get-console-output --instance-id $instance_id | \ |
cd /tmp | |
curl -O -L http://sourceforge.net/projects/sshpass/files/sshpass/1.06/sshpass-1.06.tar.gz && tar xvzf sshpass-1.06.tar.gz | |
cd sshpass-1.06 | |
./configure | |
sudo make install |
require 'formula' | |
class Sshpass < Formula | |
url 'http://sourceforge.net/projects/sshpass/files/sshpass/1.05/sshpass-1.05.tar.gz' | |
homepage 'http://sourceforge.net/projects/sshpass' | |
sha256 'c3f78752a68a0c3f62efb3332cceea0c8a1f04f7cf6b46e00ec0c3000bc8483e' | |
def install | |
system "./configure", "--disable-debug", "--disable-dependency-tracking", | |
"--prefix=#{prefix}" |
#!/bin/bash -e | |
bundle_name=${1:-'charmed-kubernetes'} | |
channel=${2:-'stable'} | |
architecture=${3:-'amd64'} | |
mkdir -p /tmp/${bundle_name} | |
cd /tmp/${bundle_name} | |
echo "Downloading ${bundle_name} metadata..." | |
curl "https://api.jujucharms.com/charmstore/v5/meta/bundle-metadata?id=${bundle_name}&channel=${channel}" > ${bundle_name}.json |