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
Moved to https://github.com/ctrezevant/everlasting-botstopper! |
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
//Nasty bot catcher adapted from https://github.com/ctrezevant/node-form-inspector | |
//Loads our dependencies. | |
var http = require('http'); | |
var url = require('url') ; | |
var qs = require('querystring'); | |
var fs = require('fs'); | |
//On what port should the server run? | |
var PORT = 8082; |
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
# Boot email notification by Charlton Trezevant | |
# Version 3.0 | |
###SETUP: | |
# Just paste it right in to /etc/rc.local | |
# Note that this depends on having mailx and postfix installed. | |
# See below for more info. | |
###DEPENDENCIES | |
# This script requires mailx and postfix to be installed. |
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
# Get num of episodes in the current directory by | |
# Searching for files that contain 'Episode' in the name. | |
EP=`ls | grep -i 'Episode' | wc -l` | |
# Get current season from the name of the directory we're currently in | |
# This assumes that episodes are in directories by episode, like so: | |
# /path/to/TV Show/Season 1/ | |
SEASON=`pwd | grep -o '[0-9]*'` | |
# Initialize the variable we'l be using for the while loop. | |
I=1 |
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
Moved to: https://github.com/ctrezevant/bane |
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
echo "Downloading APUSH book..." | |
# Initialize total downloaded count. | |
DLT=0 | |
echo "Creating downloads directory (./apush-dl)" | |
# Create downloads directory and redirect stderr to /dev/null (in case the directory already exists). | |
mkdir ./apush-dl/ 2>/dev/null | |
# There are 32 chapters. |
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
/* | |
Roids.js by Charlton Trezevant - 2015 | |
This is a bot I used to cast votes for my high school's Football coach. | |
It is written specifically for that poll, and in the interest of keeping the skiddies away | |
I will leave it to you to reverse-engineer PollDaddy. | |
Enjoy! | |
*/ | |
// The Request library is an excellent HTTP library. Install it with "npm install request". | |
var request = require('request'); |
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
// Test the divisibility of numbers from 1-100. | |
for (var i = 1; i <= 100; i++) { | |
// Is the number evenly divisible by both 3 and 5? | |
if((i % 3 === 0) && (i % 5 === 0)){ | |
console.log('fizzbuzz'); | |
// No? Then let's see whether it's divisible by 3. | |
} else if(i % 3 === 0) { | |
console.log('fizz'); | |
// Still no? Let's try 5, then. | |
} else if (i % 5 === 0){ |
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
###Hotlinking madness :^) | |
$HTTP["host"] =~ "charltontrezevant\.com" { | |
$HTTP["referer"] !~ "charltontrezevant|ctis\.me|google|bing|facebook|twitter|reddit|ycombinator|Skype|Slack" { | |
$HTTP["useragent"] !~ "Google|msnbot|FlipBoard|Bing|Yahoo|Facebook|Yandex|twitter|Slack|Skype" { | |
$HTTP["url"] =~ "\.jpeg|\.jpg|\.png|\.gif|\.bmp" { | |
$HTTP["url"] !~ "hotlinking\.png" { | |
url.redirect = ("" => "https://www.charltontrezevant.com/resources/images/hotlinking.png") | |
} | |
} | |
} |
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
=begin | |
Pocket Export.rb | |
My first 'real' Ruby script (hello world)! | |
More info here: http://blog.ctis.me/2015/12/archiving-your-pocket-articles-with-ruby.html | |
DEPENDENCIES: | |
pocket_export requires the following gems: | |
curb | |
nokogiri | |
OlderNewer