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 | |
srcreg="my.privateregistry.com" | |
tgtreg="awsacctnum.dkr.ecr.awsregion.amazonaws.com" | |
repos=`curl -s http://$srcreg/v2/_catalog?n=2048 | jq '.repositories[]' | tr -d '"'` | |
for repo in $repos; do | |
echo -e "\n===WORKING ON REPOSITORY" $repo"===" |
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
./easyrsa --subject-alt-name="DNS:www.example.net,DNS:secure.example.net" build-server-full alttest nopass |
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 | |
# Author: Lior Goikhburg | |
if [ -z "$1" ]; then | |
echo "Parameter required: Path" | |
exit 1 | |
fi | |
pushd $1 > /dev/null |
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
#!/usr/bin/env python | |
__author__ = 'Lior Goikhburg' | |
import argparse | |
import ConfigParser | |
import os | |
import boto3 | |
app_name = os.path.basename(__file__) |
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
#!/usr/bin/env bash | |
oldrev="$1" | |
newrev="$2" | |
flag="$3" | |
# exit if it's not a branch operation (e.g. file checkout) | |
if [ "$flag" != "1" ]; then | |
exit | |
fi |
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
# Look for and purge old sessions every 30 minutes | |
*/30 * * * * root [ -x /usr/lib/php5/maxlifetime ] && [ -x /usr/lib/php5/sessionclean ] && [ -d /var/www/pools ] && find /var/www/pools -path "*/var/lib/php5" -exec /usr/lib/php5/sessionclean {} $(/usr/lib/php5/maxlifetime) \; |
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
#!/usr/bin/env python | |
# | |
# Example: ./slack.py \@user PROBLEM::Information::http://trigger.url.com 'Trigger message on common.r24-admin.ru' | |
# Example: ./slack.py \@channel PROBLEM::Information::http://trigger.url.com 'Trigger message on common.r24-admin.ru' | |
# Configure your trigger like this: | |
# subject: {TRIGGER.STATUS}::{TRIGGER.SEVERITY}::{TRIGGER.URL} | |
# Default message: {TRIGGER.NAME} on {HOST.NAME1} | |
# | |
__author__ = 'Lior Goikhburg' |
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
#!/usr/bin/env python | |
import socket | |
# Figure out the source IP address that would be used to connect to SERVER_IP | |
def get_local_ip(master_ip): | |
local_socket = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) | |
local_socket.connect((SERVER_IP, 0)) | |
local_ip = local_socket.getsockname()[0] | |
local_socket.close() |
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
# lock the script against multiple run attempts | |
lock_file_name = '/var/run/deploy.lock' | |
if not os.path.isfile(lock_file_name): | |
logger.debug('Creating lock file') | |
try: | |
open(lock_file_name, 'w').close() | |
except Exception as error: | |
logger.error('Cannot create lock file.') | |
sys.exit(1) |
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
#!/usr/bin/env python | |
__author__ = 'Lior Goikhburg' | |
import argparse | |
import logging | |
import os | |
import pika | |
import signal | |
import sys |