Skip to content

Instantly share code, notes, and snippets.

View WillSams's full-sized avatar
🚀

Will Sams WillSams

🚀
View GitHub Profile
@WillSams
WillSams / install-jenkins.sh
Last active January 29, 2019 22:08
Install Jenkins CI & Configure Open-JDK 8 on Debian-based System
#!/bin/bash
echo "==================================================================="
echo
echo "Installs Jenkins & Open-JDK 8"
echo "You may be prompted for root credentials to complete the install."
echo
echo "==================================================================="
set -o nounset # unset variables are errors
@WillSams
WillSams / setup-jenkins-nginx.sh
Created January 31, 2019 15:24
Jenkins CI SSL Configuration For Nginx on Debian-based system
#!/bin/bash
set -o nounset # unset variables are errors
SCRIPTVERSION="2019.01.29-Debian"
SCRIPTNAME="setup-jenkins-nginx.sh"
SCRIPTFULLNAME="$0"
PORT='8080'
WEBNAME='jenkins.yourdomain'
@WillSams
WillSams / git_tricks
Created January 31, 2019 20:37 — forked from michaelkarrer81/git_tricks
[GIT Installation and Configuration] Git installation and configuration options #git
#!/usr/bin/env bash
# https://medium.com/@porteneuve/mastering-git-submodules-34c65e940407#.3o6drt47o
# http://blogs.atlassian.com/2013/03/git-submodules-workflows-tips/#scenarios
# http://stackoverflow.com/questions/2144406/git-shallow-submodules
# -----------------
# INSTALL AND SETUP
# -----------------
# https://github.com/bobthecow/git-flow-completion/wiki/Install-Bash-git-completion
@WillSams
WillSams / install-salt-minion.sh
Last active January 31, 2019 21:14
Install and Configure Salt Minion on Debian-based System
#!/bin/bash
set -o nounset # unset variables are errors
SCRIPTVERSION="2019.01.25-Debian"
SCRIPTNAME="install-salt-minion.sh"
SCRIPTFULLNAME="$0"
SALTMASTER='192.168.56.101' #IP of Salt-master
echoerror() { printf "\033[1;31m * ERROR\033[0m: %s\\n" "$@" 1>&2; }
@WillSams
WillSams / nginx-rails.sh
Last active February 1, 2019 15:15
Install script for Nginx & Ruby-on-Rails for Ubuntu 18.04 'bionic'
#!/bin/bash
# Nginx installer script - Ruby On Rails example
#
# Pre-req:
# * Ubuntu Bionic (18.04) flavored distro
# * Script must be executed under the account of the web admininstrator
# * linux-devel-setup.sh - https://gist.github.com/WillSams/f17427b5a4f5bccc23d6efe1389b33ca
# * mongodb-setup.sh - https://gist.github.com/WillSams/3588b69c805acf07ccb278c55fd91302
#
@WillSams
WillSams / install-salt-master.sh
Last active February 5, 2019 13:48
Install and Configure Salt Master on Debian-based System
#!/bin/bash
set -o nounset # unset variables are errors
SCRIPTVERSION="2019.01.25-Debian"
SCRIPTNAME="install-salt-master.sh"
SCRIPTFULLNAME="$0"
BROADCAST='192.168.56.1/24' #local network broadcast IP & subnet
echoerror() { printf "\033[1;31m * ERROR\033[0m: %s\\n" "$@" 1>&2; }
@WillSams
WillSams / 1-create-dotnetcore-example.sh
Last active March 8, 2019 14:10
VSCode Script For Customer-Orders-Core base template
#!/bin/bash
set -o nounset # unset variables are errors
SCRIPTVERSION="2018.10.09-Debian"
SCRIPTNAME="create-dotnetcore-example.sh"
SCRIPTFULLNAME="$0"
SOLUTIONNAME=Northwind
API=$SOLUTIONNAME.Api
@WillSams
WillSams / bowling-ruby_tdd_kata-Debian.sh
Last active March 19, 2019 22:25
Ruby Bowling Game Kata
set -o nounset # unset variables are errors
__ScriptVersion="2018.02.19"
__ScriptName="bowling-ruby_tdd_kata-Debian.sh"
__ScriptFullName="$0"
if [ -d $HOME/.rvm ]; then
echo "RVM /w Ruby is already installed on your machine."
else
echo "********************** RVM & RUBY INSTALL ************************"
@WillSams
WillSams / m68k-bin2elf.sh
Created May 12, 2019 21:11
M68000 Bin2Elf
#!/bin/bash
echo "==================================================================="
echo " This script can be executed under Linux or Windows (using MSys2) "
echo " Modify GENDEV variable to fit your toolchain. "
echo
echo " Linux toolchain: "
echo " https://gist.github.com/WillSams/c4cbf6235b467d8b595693969342237e "
echo
echo " Windows toolchain: "
@WillSams
WillSams / interview_questions.sh
Last active December 20, 2019 13:34
Powershell Coding Interview
# ==============================================================================
# 1 - Powershell program to determine if any two integers in array sum to given integer
# ==============================================================================
echo '$myArray = @{}
class Algorithm {
#Brute force solution, O(n^2) time complexity
[bool] TwoIntegersSumToTarget([int[]] $arr, [int] $target) {
$numElements = $arr.length
for ([int] $outer = 0; $outer -lt $numElements; $outer++) {