Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View jacksoncage's full-sized avatar
🏠
Working from home

Love Billingskog Nyberg jacksoncage

🏠
Working from home
View GitHub Profile
@jacksoncage
jacksoncage / jenkins-slave
Last active December 8, 2023 23:40
Bash script to check if a Jenkins slave node is offline and will restart node java process.
#!/bin/sh
#
# jenkins-slave: Launch a Jenkins BuildSlave instance on this node
#
# chkconfig: - 99 01
# description: Enable this node to fulfill build jobs
#
JENKINS_WORKDIR="/var/jenkins"
JENKINS_USER="jenkins"
# Copyright 2003, 2004 Jeroen van Wolffelaar <jeroen@wolffelaar.nl>
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; version 2 of the License
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
@jacksoncage
jacksoncage / setup-slave.sh
Last active July 5, 2018 09:23
Auto install Jenkins slave on Debian
#!/bin/bash
# Input
newhost=$1
applicationStart=$2
###
# Functions
###
updateBaseInstall() {
FROM java:jdk
LABEL maintainer "yury.sannikov@gmail.com"
ENV DEBIAN_FRONTEND noninteractive
ENV UPDATED_AT 2017-05-15
################################################################################################
###
### Environment variables
+ git clone https://github.com/tatsuhiro-t/nghttp2.git /usr/local/src/nghttp2
Cloning into '/usr/local/src/nghttp2'...
remote: Counting objects: 33700, done.
remote: Compressing objects: 100% (3/3), done.
remote: Total 33700 (delta 0), reused 0 (delta 0), pack-reused 33697
Receiving objects: 100% (33700/33700), 25.76 MiB | 4.90 MiB/s, done.
Resolving deltas: 100% (24885/24885), done.
+ cd /usr/local/src/nghttp2
+ autoreconf -i
libtoolize: putting auxiliary files in AC_CONFIG_AUX_DIR, `.'.
#!/bin/bash
ORG_DIR=`pwd`
SRC_DIR="/usr/local/src/"
cd $SRC_DIR
echo "####### START: apt-get deps ########"
apt-get -qq update
apt-get install -yqq --force-yes g++ make binutils autoconf automake autotools-dev libtool pkg-config \
DOCKER_VERSION=0.6.5
DATA_DIR="__data"
POSTGRES_VERSION=9.3
PORT=5432
.PHONY: docker-check docker-version postgres
docker-check:
@command -v docker >/dev/null 2>&1 || \
{ echo >&2 "Docker needs to be installed and on your PATH. Aborting."; exit 1; }
@jacksoncage
jacksoncage / gist:7186636
Last active December 26, 2015 17:19
Script to stop/start a play framework application.
#!/bin/sh
#
# play-run: Launch a play run instance on this node
#
# chkconfig: - 99 01
# description: Enable this play application to run
#
PLAY_WORKDIR="/var/www/play"
PLAY_LOGDIR="/var/log/play"
@jacksoncage
jacksoncage / post-recive hook in Atlassian Stash
Created May 10, 2013 20:30
Create post-recive hook in Atlassian Stash that notifys Jenkins on push
#!/bin/bash
# Create git hook on stash server
# Exit script on error
set -e
# Define the function that renders super awesome header
renderHeader () {
HEADER=$1
printf "\n\n"
#!/bin/sh
ZONE="my-tld.com"
RESOURCE="some-host"
INTERFACE="eth0"
ADDR=$(ifconfig $INTERFACE | grep "inet addr" | awk -F: '{print $2}' | awk '{print$1}')
cli53 rrcreate $ZONE $RESOURCE A $ADDR -x 3600 -r