Skip to content

Instantly share code, notes, and snippets.

View ScottJWalter's full-sized avatar
🔮
Particle. Wave. It's all data.

Scott Walter ScottJWalter

🔮
Particle. Wave. It's all data.
View GitHub Profile
Ansible playbook to setup HTTPS using Let's encrypt on nginx.
The Ansible playbook installs everything needed to serve static files from a nginx server over HTTPS.
The server pass A rating on [SSL Labs](https://www.ssllabs.com/).
To use:
1. Install [Ansible](https://www.ansible.com/)
2. Setup an Ubuntu 16.04 server accessible over ssh
3. Create `/etc/ansible/hosts` according to template below and change example.com to your domain
4. Copy the rest of the files to an empty directory (`playbook.yml` in the root of that folder and the rest in the `templates` subfolder)
@ScottJWalter
ScottJWalter / debian_upgrade.yml
Created January 5, 2019 21:34 — forked from maethor/debian_upgrade.yml
Ansible playbook to update and upgrade Debian hosts
---
- hosts: all
sudo: yes
tasks:
- name: Update packages list
apt: update_cache=yes
when: ansible_os_family == 'Debian'
- name: List packages to upgrade (1/2)
@ScottJWalter
ScottJWalter / class.endpoint.php
Last active November 9, 2018 13:13 — forked from claudiosanches/custom-my-account-endpoint.php
PHP Class that wraps creating custom "My Account" endpoints inside WooCommerce
<?php
defined( 'ABSPATH' ) or exit;
class CUSTOM_WC_My_Account_Endpoint {
/**
* Properties
*
* @prop string $endpoint URI slug of endpoint
* @prop string $title Text to display on menu
* @prop callback $callback Display/Draw function to call
@ScottJWalter
ScottJWalter / Ionic Android Development on WSL.md
Created November 2, 2018 22:41 — forked from fedme/Ionic Android Development on WSL.md
Ionic Android Development on WSL (Windows Subsystem for Linux)

Ionic Android Development on WSL

Installing the required software

Execute the following commands to install Node, npm, git, Java, Ionic, Cordova and Angular CLI:

cd ~
sudo apt update
sudo apt upgrade
@ScottJWalter
ScottJWalter / adding_new_webhook_topics.php
Created October 6, 2018 18:18 — forked from jessepearson/adding_new_webhook_topics.php
How to add a new custom Webhook topic in WooCommerce, with example of order filtering.
<?php // do not copy this line
/**
* add_new_topic_hooks will add a new webhook topic hook.
* @param array $topic_hooks Esxisting topic hooks.
*/
function add_new_topic_hooks( $topic_hooks ) {
// Array that has the topic as resource.event with arrays of actions that call that topic.
@ScottJWalter
ScottJWalter / lambda-dynamodb-scan
Created September 21, 2018 21:46 — forked from markusklems/lambda-dynamodb-scan
Short aws lambda sample program that scans a dynamodb table
// create an IAM Lambda role with access to dynamodb
// Launch Lambda in the same region as your dynamodb region
// (here: us-east-1)
// dynamodb table with hash key = user and range key = datetime
console.log('Loading event');
var AWS = require('aws-sdk');
var dynamodb = new AWS.DynamoDB({apiVersion: '2012-08-10'});
exports.handler = function(event, context) {
/**
* This sample demonstrates a simple skill built with the Amazon Alexa Skills Kit.
* For additional samples, visit the Alexa Skills Kit developer documentation at
* https://developer.amazon.com/appsandservices/solutions/alexa/alexa-skills-kit/getting-started-guide
*/
// Route the incoming request based on type (LaunchRequest, IntentRequest,
// etc.) The JSON body of the request is provided in the event parameter.
exports.handler = function (event, context) {
try {
@ScottJWalter
ScottJWalter / miniconda_on_rpi.md
Created September 5, 2018 22:19 — forked from simoncos/miniconda_on_rpi.md
Install Miniconda 3 on Raspberry Pi
@ScottJWalter
ScottJWalter / wsl-go-install.sh
Last active September 5, 2021 12:47
Script to install Go 1.11 on Linux and WSL (Windows Subsystem for Linux)
#!/bin/bash
set -e
GVERSION="1.11"
GFILE="go$GVERSION.linux-amd64.tar.gz"
GOPATH="$HOME/projects/go"
GOROOT="/usr/local/go"
if [ -d $GOROOT ]; then
echo "Installation directories already exist $GOROOT"
@ScottJWalter
ScottJWalter / vpn-refresh.sh
Created June 22, 2018 08:06 — forked from smcpeck/vpn-refresh.sh
Shell script to select fastest VPN location from available list
#!/bin/bash
# Set your VPN up with this guide: https://gist.github.com/superjamie/ac55b6d2c080582a3e64
# This runs nicely on a Raspberry Pi that is setup to be your gateway.
# Requires: speedtest-cli, openvpn
# Assuming you have config files of:
# /etc/openvpn/newyork.conf
# /etc/openvpn/chicago.conf