Skip to content

Instantly share code, notes, and snippets.

View jeremysells's full-sized avatar

Jeremy Sells jeremysells

View GitHub Profile
@jeremysells
jeremysells / Jenkinsfile
Last active March 6, 2019 15:41
Jenkinsfile Docker Composer PHP example
// This was a test for Jenkins running Docker containers
stage('Build') {
agent {
docker {
image 'composer:latest'
// If you use SSH cloning you need this. TODO - look at tokens for private repos and http clone
args '-v /etc/passwd:/etc/passwd:ro'
// args '-e HOME -v $HOME/.ssh:$HOME/.ssh:ro -v /etc/passwd:/etc/passwd:ro -v /etc/group:/etc/group:ro'
}
@jeremysells
jeremysells / ubuntu-ics-notes.md
Created October 12, 2018 16:19
ubuntu-ics notes

Notes on ICS from a VM

Some notes when I was working with ubuntu-ics. These might not be complete and are probably missing things

Hints

  • remove/disable apparmor might help
  • logs are in syslog (cat /var/log/syslog)

Config

  • OS = Xubuntu (Ubuntu 18.04.1 LTS)
@jeremysells
jeremysells / composer.sh
Last active October 19, 2018 06:16
bin/composer.sh
#!/usr/bin/env bash
set -e
# MIT licensed
# This script is AS-IS where is (no warranty, liability etc - see the license for full details)
# https://opensource.org/licenses/MIT and/or https://en.wikipedia.org/wiki/MIT_License
# Notes:
# * This script is meant to be loaded from the root of the git repo, which can contain a .env file (with project settings)
@jeremysells
jeremysells / make-untangle-open-vpn-client.sh
Last active May 6, 2021 12:33
Creates an Untangle compatible OpenVPN client from an inline OpenVPN config
#!/usr/bin/env bash
set -e
# MIT licensed
# This script is AS-IS where is (no warrenty, liability etc - see the license for full details)
# see: https://opensource.org/licenses/MIT and/or https://en.wikipedia.org/wiki/MIT_License
# About:
# This file converts a single file (client.conf) with inline certs into an Untangle compatible client (to be imported)
@jeremysells
jeremysells / .env
Last active November 5, 2022 00:56
Jenkins Example
REGISTRY_URI=registry.example.com
APPLICATION_DOCKER_FROM_IMAGE=ubuntu:18.04
APPLICATION_PHP_VERSION=7.2
APPLICATION_CODE=some-thing
APPLICATION_NAME=Some\ Thing
APPLICATION_DESCRIPTION=Some\ Thing\ Else
APPLICATION_VENDOR_NAME=Your\ Name
DATA_DIR=../some-thing-data
# Dev only.
@jeremysells
jeremysells / dated_folder_backup.sh
Last active September 2, 2018 19:36
Dated Folder Backup
#!/usr/bin/env bash
set -e
# MIT licensed
# This script is AS-IS where is (no warrenty, liability etc - see the license for full)
# see: https://opensource.org/licenses/MIT and/or https://en.wikipedia.org/wiki/MIT_License
# Note: This script should just be used as an example. Use at your own risk!
@jeremysells
jeremysells / Xbuntu-18.04-Install.md
Last active April 9, 2019 16:18
Xbuntu (18.04) (Ubuntu + Xfce)
@jeremysells
jeremysells / permissions-cheat-sheet.sh
Last active September 1, 2017 20:24
permissions cheat sheet.sh
---x------ 1 nobody nogroup 0 Sep 1 20:34 100
--w------- 1 nobody nogroup 0 Sep 1 20:34 200
--wx------ 1 nobody nogroup 0 Sep 1 20:34 300
-r-------- 1 nobody nogroup 0 Sep 1 20:34 400
-r-x------ 1 nobody nogroup 0 Sep 1 20:34 500
-rw------- 1 nobody nogroup 0 Sep 1 20:34 600
-rwx------ 1 nobody nogroup 0 Sep 1 20:34 700
@jeremysells
jeremysells / interpolation_vs_concatination.php
Last active May 9, 2017 23:41
interpolation_vs_concatenation.php
<?php
//This is not just about performance, but also readability!
//But if you can get a win win, why not!
//Please read https://nikic.github.io/2012/01/09/Disproving-the-Single-Quotes-Performance-Myth.html
$varA = "Some really long string here dasdlasmd;mas;lemas;lem;lasmel;asme";
$varB = "Some other string here";
//Test 1
@jeremysells
jeremysells / reverse engineer tables.sql
Last active June 27, 2017 21:52
reverse engineer tables.sql
--Useful queries for database(s) with no documentation
--Note: Phpmyadmin, database() will not work and this needs to be a param
SET @inspect_table = 'change_me';
SET @database = database();
--SELECT ALL
SET @s = CONCAT('select * from ', @inspect_table);
PREPARE stmt1 FROM @s;
EXECUTE stmt1;
DEALLOCATE PREPARE stmt1;