Skip to content

Instantly share code, notes, and snippets.

View naviat's full-sized avatar
🪲

Harry Dam naviat

🪲
View GitHub Profile
@naviat
naviat / Dockerfile
Created June 7, 2018 09:03 — forked from feltnerm/Dockerfile
Docker + MySQL + `lower_case_table_names=1`
FROM mysql
ADD my.cnf /etc/mysql/my.cnf
CMD ["mysqld", "--datadir=/var/lib/mysql", "--user=mysql"]
@naviat
naviat / Dockerfile
Created June 11, 2018 02:34 — forked from thduttonuk/Dockerfile
Mongo 3.6 docker file example
FROM ubuntu
RUN apt-get update
RUN apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 2930ADAE8CAF5059EE73BB4B58712A2291FA4AD5
RUN echo 'deb [ arch=amd64 ] http://repo.mongodb.org/apt/ubuntu trusty/mongodb-org/testing multiverse' | tee /etc/apt/sources.list.d/mongodb-org-3.6.list
RUN apt-get update
RUN apt-get install -y mongodb-org
RUN mkdir -p /data/db
@naviat
naviat / replace-var
Created June 12, 2018 06:33
Shell script to replace variables docker-compose.yml
#!/bin/bash
set -eu
main() {
local args=("$@")
local inFile=$(pwd)/docker-compose.yml
local outFile=$(pwd)/$1
if [[ $# -lt 2 ]]; then
usage
@naviat
naviat / README.md
Created June 12, 2018 06:49 — forked from bvis/README.md
Docker Env Vars expanded with secrets content

Variables by Secrets

Sample script that allows you to define as environment variables the name of the docker secret that contains the secret value. It will be in charge of analyze all the environment variables searching for the placeholder to substitute the variable value by the secret.

Usage

You can define the next environment variables:

@naviat
naviat / aws-ec2-redis-cli.md
Created July 24, 2018 07:57 — forked from todgru/aws-ec2-redis-cli.md
AWS redis-cli on EC2
@naviat
naviat / docker-compose.yml
Created August 1, 2018 16:34 — forked from mlabouardy/docker-compose.yml
TICK stack: telegraf, influxdb, chronograf, kapacitor with swarm mode
version: "3.3"
services:
telegraf:
image: telegraf:1.3
networks:
- tick-net
volumes:
- /var/run/docker.sock:/var/run/docker.sock
configs:
@naviat
naviat / deploy.sh
Created August 1, 2018 16:34 — forked from mlabouardy/deploy.sh
Deploy Lambda function with CloudWatch event rule trigger
#!/bin/bash
## Override
JENKINS_HOST=""
JENKINS_USERNAME=""
JENKINS_PASSWORD=""
JENKINS_JOB=""
CRON_EXPRESSION="cron(0 8 * * ? *)"
## Global variables
AWS_REGION="us-east-1"
@naviat
naviat / invoke.sh
Created August 1, 2018 16:35 — forked from mlabouardy/invoke.sh
Invoke Lambda
aws lambda invoke --function-name RestartJob output
@naviat
naviat / main.go
Created August 1, 2018 16:35 — forked from mlabouardy/main.go
Lambda function to trigger Jenkins job
func triggerJob() error {
url := fmt.Sprintf(`%s/job/%s/build`, os.Getenv("JENKINS_HOST"), os.Getenv("JENKINS_JOB"))
client := http.Client{}
req, err := http.NewRequest("POST", url, nil)
if err != nil {
return err
}
crumb, err := getToken()