Skip to content

Instantly share code, notes, and snippets.

View alpha1125's full-sized avatar

L L alpha1125

  • Toronto, Ontario, Canada
View GitHub Profile
@petenelson
petenelson / ssh-mysql-tunnel-test.php
Created July 13, 2017 16:10
WordPress: MySQL PDO command via SSH tunnel
<?php
/**
* Plugin Name: SSH Remote Test
*/
add_action( 'admin_init', 'ssh_remote_test', 1 );
function ssh_remote_test() {
@bwbaugh
bwbaugh / ec2-ubuntu-16.04-swap.md
Last active September 27, 2019 06:27
EC2 swap file instructions. Gathered from several online articles / blogs / stackexchange.

Can check if you're using swap with sudo swapon --show and free -h.

EBS volume

Useful for t2.micro and other instances with no access to instance store. Use this if you prefer not to mess with the root volume.

  1. Create the EBS volume e.g., 1 GB.
@rpdelaney
rpdelaney / crontab.header
Created August 17, 2016 19:17
Useful crontab header
# +--------- Minute (0-59) | Output Dumper: >/dev/null 2>&1
# | +------- Hour (0-23) | Multiple Values Use Commas: 3,12,47
# | | +----- Day Of Month (1-31) | Do every X intervals: */X -> Example: */15 * * * * Is every 15 minutes
# | | | +--- Month (1 -12) | Aliases: @reboot -> Run once at startup; @hourly -> 0 * * * *;
# | | | | +- Day Of Week (0-6) (Sunday = 0) | @daily -> 0 0 * * *; @weekly -> 0 0 * * 0; @monthly ->0 0 1 * *;
# | | | | | | @yearly -> 0 0 1 1 *;
# * * * * * COMMAND