Skip to content

Instantly share code, notes, and snippets.

View naviat's full-sized avatar
🪲

Harry Dam naviat

🪲
View GitHub Profile
@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
@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