Skip to content

Instantly share code, notes, and snippets.

View lantrix's full-sized avatar
:octocat:
always coding and merging

Ted B lantrix

:octocat:
always coding and merging
View GitHub Profile
@lantrix
lantrix / gitflow.md
Created April 5, 2019 02:10
Git Flow workflow

Git-Flow Cheatsheet

Initialize a Repository for git-flow

git flow init

Follow along:

Which branch should be used for bringing forth production releases?
  • develop
@lantrix
lantrix / tunnelblick-automation.AppleScript
Created March 27, 2019 13:14
Tunnelblick Applescript automation for launching a random VPN config and then services and apps - Notify with Growl
tell application "System Events"
set isRunning to (count of (every process whose bundle identifier is "com.Growl.GrowlHelperApp")) > 0
end tell
if isRunning then
tell application id "com.Growl.GrowlHelperApp"
-- Make a list of all the notification types
-- that this script will ever send:
set the allNotificationsList to ¬
{"VPN Connecting", "VPN Down", "VPN Connected"}
@lantrix
lantrix / dnsupdate.sh
Last active March 1, 2022 18:39 — forked from TonyFNZ/dnsupdate.sh
Script to update Route53 with the current public IP of an instance
#!/bin/bash
hosted_zone_id='Z57Q212345678'
domain_name='server.example.com'
# Abort script on any errors
set -e
# Get new IP address
ip_address=$(curl -s http://169.254.169.254/latest/meta-data/public-ipv4)
@lantrix
lantrix / ee4-siteperms.sh
Last active November 30, 2018 10:32
EE4 sites lockdown perms
mysftpuser="usernamehere"
adduser $mysftpuser www-data # Add SFTP user to www-data group
cd /opt/easyengine/sites/ # Change to EE Sites folder
for i in `ls`;
do
chmod 644 $i/app/wp-config.php # Default recommended from wordpress doco - https://codex.wordpress.org/Changing_File_Permissions#Example_Permission_Settings
chown -R www-data:www-data $i/app/htdocs # Ref https://wordpress.stackexchange.com/a/241310/4153
find -L $i/app/htdocs -type f |xargs -d '\n' chmod 744
find -L $i/app/htdocs -type d |xargs -d '\n' chmod 755
Parameters:
RootDomainName:
Description: Domain name for your website (example.com)
Type: String
Mappings:
RegionMap:
us-east-1:
S3hostedzoneID: Z3AQBSTGFYJSTF
websiteendpoint: s3-website-us-east-1.amazonaws.com
us-west-1:
@lantrix
lantrix / docker-compose.yml
Last active November 4, 2018 11:01
PiHole Docker
version: "3"
services:
pihole:
image: pihole/pihole:latest
dns:
- 127.0.0.1
- 1.1.1.1
environment:
- DNS1=1.1.1.1
- DNS2=1.0.0.1
@lantrix
lantrix / flickr-rename-images-to-originaldate.sh
Created October 2, 2018 04:55
Flickr Photo Download - Image processing for dates in OS
#!/bin/bash
# When you download a zip of images from flickr, the files are named by flickr object IDs.
# Processing all files in a directory, this script will:
# - Change OS Modify date to match the EXIF OriginalDate of the image
# - Rename image to match EXIF OriginalDate in format:
# YYYY-MM-DD HH:mm:ss.ext
DIR="$1"
# failsafe - fall back to current directory
function Test-ADCredential {
<#
.SYNOPSIS
This PowerShell function takes a user name and a password as input and will verify if the combination is correct.
The function returns a boolean based on the result.
.PARAMETER Credential
PS Credential Object.
.EXAMPLE
@lantrix
lantrix / Route 53 Updater
Created August 27, 2018 04:39 — forked from hsiboy/Route 53 Updater
BASH Script to keep Route53 updated with your current external IP address
Roll your own dynamic DNS service using Route53
@lantrix
lantrix / nginx.sh
Last active October 27, 2018 12:05
SearX Private search instance on docker with reverse proxy & SSL with letsencrypt (auto-renewing)
mkdir -p /usr/local/dockercerts
#nginx template
curl https://raw.githubusercontent.com/lantrix/nginx-proxy/master/nginx.tmpl > /usr/local/nginx.tmpl
#Setup nginx
docker run -d \
-p 80:80 -p 443:443 \
--name nginx \
-v /etc/nginx/conf.d \