This file contains hidden or 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
console.log('Loading function'); | |
const https = require('https'); | |
const url = require('url'); | |
// to get the slack hook url, go into slack admin and create a new "Incoming Webhook" integration | |
const slack_url = 'https://hooks.slack.com/services/...'; | |
const slack_req_opts = url.parse(slack_url); | |
slack_req_opts.method = 'POST'; | |
slack_req_opts.headers = {'Content-Type': 'application/json'}; |
This file contains hidden or 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 | |
TOOL_NAME=$1 | |
ZIP_URL=$2 | |
mkdir /tmp/$TOOL_NAME | |
cd /tmp/$TOOL_NAME | |
curl -sS $ZIP_URL > $TOOL_NAME.zip | |
unzip $TOOL_NAME.zip | |
sudo cp $TOOL_NAME /usr/local/bin/$TOOL_NAME | |
rm -rf /tmp/$TOOL_NAME | |
echo "$TOOL_NAME :: is installed successfully" |
This file contains hidden or 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 | |
VERSION=$1 | |
cd /tmp/ | |
wget "https://releases.hashicorp.com/terraform/"$VERSION"/terraform_"$VERSION"_linux_amd64.zip" | |
unzip "terraform_"$VERSION"_linux_amd64.zip" | |
sudo cp terraform /usr/local/bin/terraform | |
rm -rf /tmp/terraform_$VERSION_linux_amd64.zip | |
echo "Terraform :: is installed successfully" |
This file contains hidden or 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 | |
# Usage: ./main.sh action [target] [params] | |
# ./main.sh plan | |
# ./main.sh plan -destroy | |
# ./main.sh plan vpc | |
# ./main.sh plan vpc -destroy | |
ACTION=$1 | |
EXTRA=$* | |
TARGET="" |
This file contains hidden or 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
""" github_orgy -- monitor github organizations for new repos. | |
Usage: | |
python3.5 github_orgy.py deepmind tensorflow facebookresearch google watson-developer-cloud | |
Or with cron: | |
@hourly /usr/bin/python github_orgy.py deepmind tensorflow facebookresearch google watson-developer-cloud | |
""" | |
import time | |
import os |
This file contains hidden or 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 | |
BUCKET="mybucket.deploy" | |
ENVIRONMENT="dev" | |
LATEST="/tmp/latest.zip" | |
APP_DIR="/var/www/web" | |
latest=$(aws s3 ls s3://$BUCKET/$ENVIRONMENT/ --recursive | sort | tail -n 1 | awk '{print $4}') | |
aws s3 cp s3://$BUCKET/$latest $LATEST | |
sudo mkdir -p $APP_DIR && unzip -qo $LATEST -d $APP_DIR | |
rm -f $LATEST |
This file contains hidden or 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
check process apache with pidfile /run/apache2.pid | |
start program = "/etc/init.d/apache2 start" with timeout 60 seconds | |
stop program = "/etc/init.d/apache2 stop" |
This file contains hidden or 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
// Examples for using socat (and filan) | |
//"$" means normal user, "#" requires privileges, "//" starts a comment | |
/////////////////////////////////////////////////////////////////////////////// | |
// similar to netcat | |
// connect to 10.1.1.1 on port 80 and relay to and from stdio |
This file contains hidden or 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
#!/usr/bin/env python | |
import os | |
import subprocess | |
# > python subprocessdemote.py | |
# > sudo python subprocessdemote.py | |
def check_username(): |
This file contains hidden or 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
export CLUSTER_DNS=[...] | |
export CLUSTER_IP=[...] | |
ssh -i workshop.pem docker@$CLUSTER_IP | |
docker container run -d --name jenkins -p 8080:8080 jenkins:alpine | |
docker container ls # Wait until it is up and running |