Skip to content

Instantly share code, notes, and snippets.

View sethryder's full-sized avatar
:shipit:

Seth Ryder sethryder

:shipit:
View GitHub Profile
@sethryder
sethryder / yoast_redirect_fixer.php
Last active April 29, 2022 18:16
update redirects in yoast when changing from date based permalinks to just post name
<?php
$option_value_export_plain = file_get_contents('export_plain.txt');
$option_value_base = file_get_contents('base.txt');
$export_plain = unserialize($option_value_export_plain);
$base = unserialize($option_value_base);
$new_export_plain = [];
@sethryder
sethryder / cloudfront_ips_lambda.py
Last active July 30, 2018 15:03
simple lambda for storing cloudfront ips in parameter store for use in other places (such as nginx for where to trust X-Forwarded-For headers)
from botocore.vendored import requests
import json
import boto3
def get_cloudfront_ips():
ip_list = ''
d = requests.get('https://ip-ranges.amazonaws.com/ip-ranges.json').text
l = json.loads(d)
for ip_range in [x['ip_prefix'] for x in l['prefixes'] if x['service']=='CLOUDFRONT' ]:
ip_list += ip_range + ','
@TomRichter
TomRichter / OnWipe.xml
Last active April 29, 2024 14:28
Installation Instructions for FFXIV ACT + Key Plugins
<?xml version="1.0"?>
<TriggernometryExport Version="1">
<ExportedTrigger Enabled="true" Name="On Wipe" Id="d2f2668d-dfd5-456d-a404-1d2b5cdd18cd" RegularExpression="(wipeout|0038:end|21:([0-9,a-f,A-F]{8}):40000010)" DebugLevel="Inherit" PrevActions="Keep" PrevActionsRefire="Allow" Scheduling="FromFire" PeriodRefire="Allow" RefirePeriodExpression="0">
<Actions>
<Action DiscordTts="false" OrderNumber="1" AuraImageMode="Normal" TextAuraAlignment="MiddleCenter" TextAuraFontSize="8.25" TextAuraEffect="None" TextAuraUseOutline="false" Enabled="true" ActionType="EndEncounter" ExecutionDelayExpression="0" Asynchronous="true" DebugLevel="Inherit" RefireInterrupt="false" RefireRequeue="true" SystemBeepFreqExpression="1000" SystemBeepLengthExpression="100" PlaySoundVolumeExpression="100" PlaySoundExclusive="true" PlaySoundMyself="false" PlaySpeechMyself="false" UseTTSVolumeExpression="100" UseTTSRateExpression="0" UseTTSExclusive="true" LaunchProcessWindowStyle="Normal" ExecScriptType="CSharp" MessageBoxIcon
@zahna
zahna / gist:b302ee6d150405e5430855e53d5771ee
Last active August 8, 2017 13:05
render any number of recaptchas that are on a single page
In the page somewhere:
<script type="text/javascript" defer>
var gcRender = function() {
var sitekey, gcs, i, rcks, len;
sitekey = '';
// Render all .g-recaptcha's on the page
gcs = document.getElementsByClassName('g-recaptcha');
len = gcs.length;
for (i = 0; i < len; i++) {
@yefim
yefim / Dockerrun.aws.json
Last active April 7, 2023 16:11
Build a Docker image, push it to AWS EC2 Container Registry, then deploy it to AWS Elastic Beanstalk
{
"AWSEBDockerrunVersion": "1",
"Image": {
"Name": "<AWS_ACCOUNT_ID>.dkr.ecr.us-east-1.amazonaws.com/<NAME>:<TAG>",
"Update": "true"
},
"Ports": [
{
"ContainerPort": "443"
}
@sethryder
sethryder / aws-generate-ssh-config.php
Created April 12, 2016 15:17
a quickly hacked together script to generate a .ssh/config from aws instances
<?php
$ssh_instances = [];
$ssh_user = 'root';
require 'vendor/autoload.php';
$ec2 = new Aws\Ec2\Ec2Client([
'version' => 'latest',
'region' => 'us-east-1'
]);
@gene1wood
gene1wood / all_aws_lambda_modules_python.md
Last active April 25, 2024 03:06
AWS Lambda function to list all available Python modules for Python 2.7 3.6 and 3.7
@danackerson
danackerson / 100_base.conf
Last active October 20, 2023 10:11
using nginx + lua + redis for redirects and rewrites
# using such a setup requires `apt-get install lua-nginx-redis` under Ubuntu Trusty
# more info @ http://wiki.nginx.org/HttpLuaModule#access_by_lua
http {
lua_package_path "/etc/nginx/include.d/?.lua;;";
lua_socket_pool_size 100;
lua_socket_connect_timeout 10ms;
lua_socket_read_timeout 10ms;
server {
@bradmontgomery
bradmontgomery / install-comodo-ssl-cert-for-nginx.rst
Last active April 1, 2024 11:21
Steps to install a Comodo PositiveSSL certificate with Nginx.

Setting up a SSL Cert from Comodo

I use Namecheap.com as a registrar, and they resale SSL Certs from a number of other companies, including Comodo.

These are the steps I went through to set up an SSL cert.

Purchase the cert