Skip to content

Instantly share code, notes, and snippets.

View waynegraham's full-sized avatar

Wayne Graham waynegraham

View GitHub Profile
@waynegraham
waynegraham / authors.txt
Last active February 9, 2024 18:18
Get authors from svn repository
wsg4w = Wayne Graham <wsg4w@uva.edu>
@waynegraham
waynegraham / update.sh
Last active January 30, 2024 18:11
Update StopForumSpam Blocked IPs
#!/bin/bash
#
# Pull updated IPs from StopForumSpam from
# https://www.stopforumspam.com/downloads. Note that different files have
# different download limits. Generally you can download the last day hourly and
# everything else you are limited to twice daily.
#
# URL: https://github.com/waynegraham/UpdateBlockedIPs
# Author: Wayne Graham
# License: MIT
@waynegraham
waynegraham / _footer.scss
Created September 5, 2023 17:51
CLIR footer in Bootstrap
@waynegraham
waynegraham / creat_test_files.py
Created August 26, 2023 19:08
Create text files for LORA model
import os
import shutil
def create_text_file(jpeg_file):
"""Creates a text file with the same name as the given JPEG file."""
text_file_name = jpeg_file.split(".")[0] + ".txt"
text_file = open(text_file_name, "w")
text_file.write("")
text_file.close()
@waynegraham
waynegraham / gist:3020675
Created June 29, 2012 21:10
Wordpress Nameservers
ns1.wordpress.com
ns2.wordpress.com
ns3.wordpress.com
@waynegraham
waynegraham / README.md
Last active November 2, 2022 20:45
Update blocked IPs for StopForumSpam

Stop Forum Spam Update

  • Add a directory (e.g. mkdir /var/www/blocked_ips)
  • Run the bash script to download the suggested listed_ip_30_all (see https://www.mediawiki.org/wiki/Extension:StopForumSpam#IP_blocking)
  • Make sure LocalSettings.php points to the extracted file
  • Run /var/www/mediawiki/extensions/StopForumSpam/maintenance/updateDenyList.php to load into APCu cache
@waynegraham
waynegraham / console.js
Last active October 16, 2022 19:03
print console.log output to a debug div (for mobile)
if (typeof console != "undefined")
if (typeof console.log != 'undefined')
console.olog = console.log;
else
console.olog = function() {};
console.log = function(message) {
console.olog(message);
$('#debugDiv').append('<p>' + message + '</p>');
};
@waynegraham
waynegraham / import_full_rss.rb
Created January 10, 2017 15:09
Import the full RSS feed in to Jekyll (from WordPress)
#! /usr/bin/env ruby
require 'rss'
require 'rss/2.0'
require 'open-uri'
require 'fileutils'
require 'safe_yaml'
url = 'https://www.diglib.org/topics/ndsa/feed/'
@waynegraham
waynegraham / gist:5256410
Created March 27, 2013 17:37
Postgresql 9.2 Replication on CentOS 6

Master Server

In /var/lib/pgsql/9.2/data/postgresql.conf add

wal_level = hot_standby
max_wal_senders = 1
wal_keep_segments
@waynegraham
waynegraham / .zshrc
Created February 10, 2022 13:59
ZSH
# If you come from bash you might have to change your $PATH.
export PATH=$HOME/bin:$HOME/.rbenv/bin:/usr/local/bin:$PATH
# Path to your oh-my-zsh installation.
export ZSH="/Users/wgraham/.oh-my-zsh"
# Set name of the theme to load --- if set to "random", it will
# load a random theme each time oh-my-zsh is loaded, in which case,
# to know which specific one was loaded, run: echo $RANDOM_THEME
# See https://github.com/ohmyzsh/ohmyzsh/wiki/Themes