Skip to content

Instantly share code, notes, and snippets.

View A5hleyRich's full-sized avatar

Ashley Rich A5hleyRich

View GitHub Profile
import http from 'k6/http';
import { sleep } from 'k6';
export const options = {
insecureSkipTLSVerify: true,
};
export default function() {
http.get('https://uat.fathomevents.com/',
{
@A5hleyRich
A5hleyRich / cron-test.php
Last active July 26, 2022 17:25
WordPress Cron and Email Test
<?php
/**
* Plugin Name: Cron Test
* Plugin URI: https://gist.github.com/A5hleyRich/6de1712ce5f46662c8ba
* Description: WordPress cron and email test.
* Author: Ashley Rich
* Version: 1.0
* Author URI: http://ashleyrich.com
*/
@A5hleyRich
A5hleyRich / index.html
Created October 23, 2018 11:41
Sample back soon page.
<!doctype html>
<html>
<head>
<title>Back Soon</title>
<style>
body { text-align: center; padding: 150px; }
h1 { font-size: 50px; }
body { background-color: #e13067; font: 20px Helvetica, sans-serif; color: #fff; line-height: 1.5 }
article { display: block; width: 650px; margin: 0 auto; }
</style>
@A5hleyRich
A5hleyRich / nginx.conf
Last active October 17, 2017 12:35
Hosting WordPress Yourself Part 1 – Installing Nginx, PHP and MySQL
user ashley;
worker_processes 1;
pid /run/nginx.pid;
include /etc/nginx/modules-enabled/*.conf;
events {
worker_connections 1024;
multi_accept on;
}
@A5hleyRich
A5hleyRich / nginx.conf
Last active February 16, 2017 11:51
Hosting WordPress Yourself Part 6
user ashley;
worker_processes 1;
pid /run/nginx.pid;
events {
worker_connections 1024;
multi_accept on;
use epoll;
}
@A5hleyRich
A5hleyRich / ashleyrich.com
Last active February 15, 2017 15:10
Hosting WordPress Yourself Part 7
fastcgi_cache_path /home/ashley/ashleyrich.com/cache levels=1:2 keys_zone=ashleyrich.com:100m inactive=60m;
server {
listen 443 ssl http2;
listen [::]:443 ssl http2;
server_name pluto.ashleyrich.com;
ssl_certificate /etc/letsencrypt/live/pluto.ashleyrich.com/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/pluto.ashleyrich.com/privkey.pem;
$post_content_sql = "UPDATE $wpdb->posts SET `post_content` = replace(post_content, '{$pair['old_url']}', '{$pair['new_url']}'){$where_sql};";
$meta_content_sql = "UPDATE $wpdb->postmeta SET `meta_value` = replace(meta_value, '{$pair['old_url']}', '{$pair['new_url']}') WHERE `meta_key` IN ('tve_content_before_more', 'tve_save_post', 'tve_updated_post');";
// run the sql
$wpdb->query( $post_content_sql );
$wpdb->query( $meta_content_sql );
@A5hleyRich
A5hleyRich / backup.sh
Last active July 4, 2016 15:17
Simple WordPress Backups
#!/bin/bash
cd /home/ashley/ashleyrich.com/public
# Backup database
wp db export ../backups/`date +%Y%m%d`_database.sql --add-drop-table
# Backup uploads directory
tar -zcf ../backups/`date +%Y%m%d`_uploads.tar.gz wp-content/uploads
@A5hleyRich
A5hleyRich / nginx.conf
Last active March 19, 2016 23:48
Hosting WordPress Yourself Multiple Sites
user ashley;
worker_processes 1;
pid /run/nginx.pid;
events {
worker_connections 1024;
multi_accept on;
}
http {
Verifying that +a5hleyrich is my blockchain ID. https://onename.com/a5hleyrich