Skip to content

Instantly share code, notes, and snippets.

View ahathaway's full-sized avatar

Alex Hathaway ahathaway

View GitHub Profile
@ahathaway
ahathaway / disable-ipv6.sh
Created February 18, 2023 02:28 — forked from kwilczynski/disable-ipv6.sh
Amazon Linux OS tweaks
#!/bin/bash
set -u
set -e
set -o pipefail
export PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
cat <<'EOF' > /etc/modprobe.d/blacklist-ipv6.conf
@ahathaway
ahathaway / LogUse.php
Created June 4, 2022 19:45 — forked from laverboy/LogUse.php
A simple, static, logging singleton class
<?php
Log::info("something really interesting happened", ['extra' => 'information', 'about' => 'anything' ]);
@ahathaway
ahathaway / Simple Ajax Login Form.php
Created February 3, 2022 04:26 — forked from cristianstan/Simple Ajax Login Form.php
Wordpress: Simple Ajax Login Form
<?php
//Simple Ajax Login Form
//Source: http://natko.com/wordpress-ajax-login-without-a-plugin-the-right-way/
?>
//html
<form id="login" action="login" method="post">
<h1>Site Login</h1>
<p class="status"></p>
<label for="username">Username</label>

NDJSON is a convenient format for storing or streaming structured data that may be processed one record at a time.

  • Each line is a valid JSON value
  • Line separator is ‘\n’

1. Convert JSON to NDJSON?

cat test.json | jq -c '.[]' > testNDJSON.json
@ahathaway
ahathaway / le-renew-webroot
Created October 1, 2020 19:29 — forked from thisismitch/le-renew-webroot
Let's Encrypt Auto-Renewal using the Webroot Plugin (Nginx)
#!/bin/bash
web_service='nginx'
config_file="/usr/local/etc/le-renew-webroot.ini"
le_path='/opt/letsencrypt'
exp_limit=30;
if [ ! -f $config_file ]; then
echo "[ERROR] config file does not exist: $config_file"
Elastic Load Balancer, CloudFront and Let's Encrypt
@ahathaway
ahathaway / .gitignore
Created April 28, 2020 21:13
default wordpress .gitignore
# ignore everything in the root except the "wp-content" directory.
!wp-content/
# ignore everything in the "wp-content" directory, except:
# "mu-plugins", "plugins", "themes" directory
wp-content/*
!wp-content/mu-plugins/
!wp-content/plugins/
!wp-content/themes/
@ahathaway
ahathaway / handler.js
Created April 29, 2019 15:13
handler for deploy lambda
'use strict';
console.log('Loading function');
const SSH = require('simple-ssh');
const FS = require('fs');
const AWS = require('aws-sdk');
const S3 = new AWS.S3({httpOptions: {timeout: 2000}});
const Deploy = require('Deploy');
let deploy = new Deploy(S3,SSH,FS);
@ahathaway
ahathaway / Deploy.js
Last active April 29, 2019 15:47
Deploy class for lambda
class Deploy {
constructor(S3, SSH, FS) {
this.s3 = S3;
this.SSH = SSH;
this.fs = FS;
this.msgString = null;
this.zip_extract_path = '/home/golfmds/deploy/thriv-golfnow';
this.deploy_base_path = '/home/golfmds/thriv-golfnow';
this.deploy_base_path_suffix = '/view-applet_golfnow';
this.envs = {
<?php
/*
Plugin Name: Gravity Forms Encryptorator
Plugin URI: https://github.com/humanmade/Gravity-Forms-Encryptorator
Description: Encrypt all Gravity Forms data on the way into the database using openssl public encryption, data can only be decrypted with the associated private key.
Author: Human Made Limited
Version: 1.0 Alpha
Author URI: http://www.hmn.md/
*/