Skip to content

Instantly share code, notes, and snippets.

View naviat's full-sized avatar
🪲

Harry Dam naviat

🪲
View GitHub Profile
@naviat
naviat / install_jenkins_plugin.sh
Created January 11, 2018 02:29 — forked from micw/install_jenkins_plugin.sh
Script to install one or more jenkins plugins including dependencies while jenkins is offline
#!/bin/bash
set -e
if [ $# -eq 0 ]; then
echo "USAGE: $0 plugin1 plugin2 ..."
exit 1
fi
plugin_dir=/var/lib/jenkins/plugins
#!/usr/bin/env bash
# Generate timestamped filename
TIMESTAMPED_TAG=`date +%Y-%m-%d-%H%M%S`
BACKUP_ARCHIVE="./jenkins-backup-${TIMESTAMPED_TAG}.tar.gz"
# Inconceivable race condition avoidance
if [-f $BACKUP_ARCHIVE ]; then
rm ${BACKUP_ARCHIVE}
fi
@naviat
naviat / chmod.groovy
Created January 25, 2018 07:55 — forked from tamirko/chmod.groovy
change permissions example
/* Groovy Usage:
This code snippet changes the permissions
of all the files inside the /usr/bin/myapp/data folder.
In this case, all the files in /usr/bin/myapp/data
will be writable after invoking this command.
*/
builder = new AntBuilder()
builder.chmod(dir:"/usr/bin/myapp/data", perm:'+w', includes:"*")
@naviat
naviat / datadog-role-delegation.json
Created February 28, 2018 17:24 — forked from miketheman/datadog-role-delegation.json
Datadog AWS Integration Automated Setup - CloudFormation
{
"AWSTemplateFormatVersion": "2010-09-09",
"Parameters": {
"SharedSecret": {
"Default": "SOOPASEKRET",
"Description": "Shared Secret, aka External ID",
"Type": "String",
"NoEcho": "true"
}
},
@naviat
naviat / control_ecs_asg.py
Created February 28, 2018 17:57 — forked from joey-g/control_ecs_asg.py
ECS/ASG Startup Script
import boto3
import sys
import time
# Script param validation.
def validate_params():
param_error_found = False
if len(sys.argv) < 3:
param_error_found = True
if sys.argv[1].lower() not in ['qa0', 'qa1', 'qa2', 'qa3', 'qa4', 'qa5', 'qa6', 'qa7', 'qa8', 'qa9', 'qa10']:

MicroService Proxy Gateway Solutions

Kong, Traefik, Caddy, Linkerd, Fabio, Vulcand, and Netflix Zuul seem to be the most common in microservice proxy/gateway solutions. Kubernetes Ingress is often a simple Ngnix, which is difficult to separate the popularity from other things.

Github Star Trend:

Github Star History for Kong vs traefik vs fabio vs caddy vs Zuul

This is just a picture of this link from Feb

@naviat
naviat / gist:f0c25447c26aa80e1dc0f0f5f6cbe643
Created March 20, 2018 04:32 — forked from imranity/gist:9246dd195f785cf4783d
How to solve "sudo: no tty present and no askpass program specified" when trying to run a shell from Jenkins
Running shell scripts that have contain sudo commands in them from jenkins might not run as expected. To fix this, follow along
Simple steps:
1. On ubuntu based systems, run " $ sudo visudo "
2. this will open /etc/sudoers file.
3. If your jenkins user is already in that file, then modify to look like this:
jenkins ALL=(ALL) NOPASSWD: ALL
4. save the file by doing Ctrl+O (dont save in tmp file. save in /etc/sudoers, confirm overwrite)
5. Exit by doing Ctrl+X
6. Relaunch your jenkins job
#!/usr/bin/python -tt
#
import datetime
import json
import logging
import logging.handlers
import optparse
import os
import re
import shutil
@naviat
naviat / nginx-ssl-config
Created April 29, 2018 04:17 — forked from apollolm/nginx-ssl-config
Nginx Configuration with multiple port apps on same domain, with SSL.
# the IP(s) on which your node server is running. I chose port 3000.
upstream app_geoforce {
server 127.0.0.1:3000;
}
upstream app_pcodes{
server 127.0.0.1:3001;
}
@naviat
naviat / nginx-restart.bat
Created May 30, 2018 09:19
Quick startup for NGINX and PHP on Windows
@ECHO OFF
call nginx-stop.bat
call nginx-start.bat
EXIT /b