View evilcode.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Shell script to look for evil code and mail if detected | |
# ------------------------------------------------------------------------- | |
# http://serverfault.com/questions/153666/send-email-based-on-grep-results | |
# http://www.linuxforums.org/forum/red-hat-fedora-linux/166780-shell-script-send-email.html | |
# ------------------------------------------------------------------------- | |
WHERE="/home/" | |
TMP="/tmp/webinject_result.txt" |
View logerror.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Shell script to look for error in log web server log files | |
# ------------------------------------------------------------------------- | |
# http://www.linuxforums.org/forum/red-hat-fedora-linux/166780-shell-script-send-email.html | |
# ------------------------------------------------------------------------- | |
tail -f -n0 <log-filename> | while read line ; do | |
if [ $(echo $line | grep -i 'ERROR' | wc -l) != 0 ]; then | |
(echo "Subject: Fix: Web Server Error"; echo; echo $line) | mail adm@lovemusic.se | |
fi |
View jenkins-slave
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# defaults for jenkins continuous integration server | |
JENKINS_ARGS="-jnlpUrl https://test.viaplay.tv/jenkins/computer/SLAVENAME/slave-agent.jnlp" | |
# jenkins home location | |
JENKINS_HOME=/opt/jenkins-slave | |
# location of the jenkins war file | |
JENKINS_WAR=$JENKINS_HOME/slave.jar | |
# pulled in from the init script; makes things easier. | |
NAME=jenkins |
View setup-slave.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Input | |
newhost=$1 | |
applicationStart=$2 | |
### | |
# Functions | |
### | |
updateBaseInstall() { |
View .bachrc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## multi-line prompt | |
PS1=' | |
[\d \t \u@\h:\w ] | |
$> ' | |
## aliases | |
alias cd..="cd .." | |
alias l="ls -al" | |
alias lp="ls -p" | |
alias ll="ls -lahG" |
View route53DynDNS.bash
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# | |
# This script requires xpath to parse part of the dnscurl.pl output | |
# on CentOS/RedHat/Amazon Linux: | |
# | |
# sudo yum install perl-XML-XPath | |
# | |
# also, dnscurl.pl (from http://aws.amazon.com/code/Amazon-Route-53/9706686376855511) | |
# expects your secrets to be in ~/.aws-secrets | |
# using a file format like this (from http://dmz.us/wp/wp-content/uploads/r53/aws-secrets.txt) |
View r53-dyn-dns.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 |
View post-recive hook in Atlassian Stash
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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" |
View jenkins-slave
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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" |
View gist:7186636
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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" |
OlderNewer