Skip to content

Instantly share code, notes, and snippets.

Stewart Adam stewartadam

Block or report user

Report or block stewartadam

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
stewartadam / install-google-chrome.ps1
Last active Jul 22, 2019
Install Google Chrome from PowerShell (i.e. how to avoid IE on Windows Server)
View install-google-chrome.ps1
# Credits to @nicolaigj:
$Path = $env:TEMP; $Installer = "chrome_installer.exe"; Invoke-WebRequest "" -OutFile $Path\$Installer; Start-Process -FilePath $Path\$Installer -Args "/silent /install" -Verb RunAs -Wait; Remove-Item $Path\$Installer
stewartadam / LICENSE
Last active Jun 29, 2018
Default license to apply for all of my Gists that (1) are not forked and (2) do not have a file named LICENSE
MIT License
Copyright (c) 2018 Stewart Adam
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
stewartadam /
Last active Mar 1, 2020 — forked from gear11/
Simple Python proxy server based on Flask and Requests with support for GET and POST requests.
A simple proxy server, based on original by gear11:
Modified from original to support both GET and POST, status code passthrough, header and form data passthrough.
Usage: http://hostname:port/p/(URL to be proxied, minus protocol)
For example: http://localhost:5000/p/
import re
stewartadam /
Last active Jul 28, 2019
systemd configuration for containers on boot with docker-compose (via, among others)


This sample is intended for modern Linux systems using systemd (Fedora, Ubuntu, Arch, etc).


Install the files in this gist, replacing dashes for slashes (e.g. etc-systemd-system-dockercompose.service should be installed to /etc/systemd/system/dockercompose.service) and then run systemctl enable --now dockercompose.service to get things started.


Any manual docker-compose commands should be run from /srv/appdata/linuxserver so that the values from the .env file are applied properly.

Log files can be viewed by running docker-compose -f --tail=50.

stewartadam /
Last active Apr 4, 2018
Spring Redirect to Azure AD
class StubController {
ModelAndView resource(ModelMap model, HttpServletRequest request, @PathVariable String id) {
model.addAttribute("attribute", "forwardWithForwardPrefix");
String client_id = "";
int state = (int )(Math.random() * 1000000 + 1);
String resource = "client_id_guid_of_fhir";
stewartadam /
Last active Jun 21, 2018
Installing Plex in a systemd-nspawn container
sudo dnf --releasever=25 --installroot="$CONTAINER_ROOT" install systemd passwd dnf fedora-release NetworkManager
systemd-nspawn -D "$CONTAINER_ROOT" --network-bridge="$BRIDGE_INTERFACE"
# Install Plex RPM here, then 'exit' or press Ctrl+] 3x to kill container
mkdir -p /etc/systemd/nspawn
stewartadam / memcached-multi.init
Created Apr 9, 2017
memcached-multi, a RHEL6 initscript with support for easily managing multiple memcached services
View memcached-multi.init
#! /bin/bash
# chkconfig: - 55 45
# description: The memcached daemon is a network memory cache service.
# processname: memcached
# Based on
# Usage:
# cp /etc/sysconfig/memcached /etc/sysconfig/memcached-server1
stewartadam /
Created Jan 16, 2017
#!/usr/bin/env python
# -*- coding: utf-8 -*-
Calculates the x,y co-ordinates of the contour lines given a 2D grid of land
heights, with the origin in the bottom-left corner.
import math
# cheap scope hack
stewartadam /
Created Mar 10, 2016
CentOS 7 shared hosting server setup script based on the SCS Shared Linux Hosting Server Security tutorial at Concordia University (2016) - discussion about security principles in the context of a shared hosting server.
# Usage:
# This script will establish a basic shared hosting server running DNS, Web (HTTP), DB (SQL) and e-mail (SMTP/IMAP) services.
# This script doesn't include usage information on adding new user accounts and setting up mail inboxes; for that, please see my
# CentOS 5 server setup tutorial:
# This configuration is very similar to my previously documented CentOS 5 server setup, but has been ported to take advantage
# of the new features in CentOS 7.
stewartadam /
Last active Apr 2, 2019
Script used for the SCS Linux Basics tutorial at Concordia University (2016) - discussion about Linux basics & setting up Wordpress on a CentOS 7 machine
### Example usage of common commands
# pwd
# ls # it's empty
# cd /var/log # there are some files
You can’t perform that action at this time.