- 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
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use PHPMailer\PHPMailer\PHPMailer; | |
use PHPMailer\PHPMailer\SMTP; | |
use PHPMailer\PHPMailer\Exception; | |
require './vendor/autoload.php'; | |
$dotenv = Dotenv\Dotenv::createImmutable(__DIR__ . '/'); | |
$dotenv->load(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /bin/bash | |
for file in *.doc; do | |
textutil -convert docx "$file" | |
# Account for the new `x` in `docx` | |
pandoc -o "${file%doc}pdf" "${file}x" | |
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'nokogiri' | |
require 'open-uri' | |
sitemaps = [ | |
'https://www.clir.org/page-sitemap1.xml', | |
'https://www.clir.org/page-sitemap2.xml' | |
] | |
xml = Nokogiri::XML(URI.open(sitemaps[0])) | |
# urls = xml.search('url') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# frozen_string_literal: true | |
source "https://rubygems.org" | |
git_source(:github) {|repo_name| "https://github.com/#{repo_name}" } | |
gem "mechanize" | |
gem 'progress_bar' | |
gem 'terminal-table' |
NewerOlder