Skip to content

Instantly share code, notes, and snippets.

View hughker's full-sized avatar

Winston Hughes hughker

View GitHub Profile
We are having a problem billing
@hughker
hughker / SDImage.sh
Created September 11, 2022 16:27 — forked from chatchavan/SDImage.sh
Create a disk image from an SD card and write the disk image to another SD card (Mac OS X)
#!/bin/bash
### NOTE
# Ideally, you should create an image from small partition (e.g., 4 GB) instead of the whole SD card (e.g., 32 GB).
# For example, an image for Raspbian image should be created by the following procdure:
# (1) Install the official Raspbian image (3.5 GB for Jessie) on an SD card
# (2) Manually expand the partition to a modest size to accommodate your base software (e.g., 4 GB)
# (3) Perform apt-get update and upgrade, install software and configuration that you want.
# (4) Create an image from that (4 GB) partition
#
@hughker
hughker / bs-config.js
Last active October 2, 2021 20:08
Browser Sync Fix for Shopify
module.exports = {
snippetOptions: {
rule: {
match: /<\/head>/i,
fn: function(snippet, match) {
return snippet + match;
}
}
}
};
@hughker
hughker / git-backup-to-AWS-S3.sh
Created June 11, 2018 00:23 — forked from philippb/git-backup-to-AWS-S3.sh
Complete git repository backup script to AWS S3
#!/bin/bash
# Script to backup git repo to S3
# Set bucket, dir, password and account to use for the backup. I keep mine in local env vars
# These are set by localrc which lives on an encrypted home directory and is executed by my bashrc
bucket=$GITHUB_BACKUP_BUCKET
dir=$GITHUB_BACKUP_DIR
password=$GITHUB_BACKUP_PASSWORD
account=$GITHUB_ACCOUNT
@hughker
hughker / git-backup-to-Backblaze-B2.sh
Created June 11, 2018 00:23 — forked from nilayp/git-backup-to-Backblaze-B2.sh
Complete git repository backup script to Backblaze B2
#!/bin/bash
# Script to backup git repo to Backblaze B2
# Set bucket, dir, password and account to use for the backup. I keep mine in local env vars
# These are set by localrc which lives on an encrypted home directory and is executed by my bashrc
# Ensure you have authorized the B2 command line tool with the correct account AND added your SSH
# public key to your github account, if you need to backup private repositories.
# To restore this repo in the future, download it from B2, extract it and then use this command:
# cd old-repository.git
@hughker
hughker / README.md
Created March 10, 2018 19:48 — forked from jimothyGator/README.md
Nginx configuration for Mac OS X with Homebrew, using sites-enabled directory.
mkdir -p /usr/local/etc/nginx/sites-{enabled,available}
cd /usr/local/etc/nginx/sites-enabled
ln -s ../sites-available/default.conf
ln -s ../sites-available/default-ssl.conf

File locations:

  • nginx.conf to /usr/local/etc/nginx/
  • default.conf and default-ssl.conf to /usr/local/etc/nginx/sites-available
  • homebrew.mxcl.nginx.plist to /Library/LaunchDaemons/
@hughker
hughker / secure-ssh.yml
Created May 1, 2017 17:47 — forked from cmavr8/secure-ssh.yml
Secure SSH configuration ansible playbook
---
# SSH server settings, in line with https://stribika.github.io/2015/01/04/secure-secure-shell.html
# Before using, change myhosts to your hosts' nickname and myuser to your username (two instances! make sure you replace both or you'll be locked out of ssh!)
- hosts: myhosts
become: true
remote_user: myuser
tasks:
# Key exchange, ciphers and MACs
- lineinfile: dest=/etc/ssh/sshd_config regexp='^KexAlgorithms' line='KexAlgorithms curve25519-sha256@libssh.org,diffie-hellman-group-exchange-sha256'
details, summary {display: block;}
details:not([open]) > :not(summary) {display: none;}
@hughker
hughker / kmskeys10.txt
Created January 27, 2017 18:17 — forked from CHEF-KOCH/kmskeys10.txt
Windows 10 KMS Keys
Windows.10.and.Office.2016.gVLK
#####################################################################
# technet.microsoft.com/en-us/library/jj612867.aspx?lc=1033 #
#####################################################################
Windows 10 Professional W269N-WFGWX-YVC9B-4J6C9-T83GX
Windows 10 Professional N MH37W-N47XK-V7XM9-C7227-GCQG9
Windows 10 Education NW6C2-QMPVW-D7KKK-3GKT6-VCFB2
Windows 10 Education N 2WH4N-8QGBV-H22JP-CT43Q-MDWWJ
@hughker
hughker / install.sh
Created January 25, 2017 20:40 — forked from jamiecollinson/install.sh
Installing OpenVBX on Ubuntu 14.04 EC2 instance
# check for updates
sudo apt-get update
sudo apt-get upgrade
# install necessary software
sudo apt-get install mysql-server apache2 php5 libapache2-mod-php5 php5-mysql libapache2-mod-auth-mysql php5-curl git sendmail
# create DB
echo "CREATE DATABASE OpenVBX; GRANT ALL PRIVILEGES ON OpenVBX.* TO ubuntu@localhost IDENTIFIED BY {PASSWORD_HERE}; FLUSH PRIVILEGES" | sudo mysql -p