Skip to content

Instantly share code, notes, and snippets.

<?xml version="1.0" encoding="UTF-8"?>
<!-- Welcome to PseudoChannel!
This will be the most difficult part in the process of setting up your PseudoChannel (but it is not hard,
just be sure to read this and you will be set).
There are a few things to keep in mind when setting up this XML.
1) What exactly is this file for?
from __future__ import print_function
import pickle
import os.path
from googleapiclient.discovery import build
from google_auth_oauthlib.flow import InstalledAppFlow
from google.auth.transport.requests import Request
import paho.mqtt.client as paho
### BEGIN Editable Vars
MQTT_BROKER = "192.168.1.125"
/**
* Strip EXIF data from images upon upload.
*/
add_filter('wp_handle_upload_prefilter', 'custom_upload_filter' );
function custom_upload_filter( $file ){
$image = $file['tmp_name'];
try
@justinemter
justinemter / gulp-image-resize.js
Created June 17, 2019 21:27
Gulp file to resize / rename / optimize images for web.
var gulp = require('gulp');
var imageResize = require('gulp-image-resize');
var imagemin = require('gulp-imagemin');
var rename = require('gulp-rename');
gulp.task('default', function(callback) {
gulp.src('./**/*.jpg', { base: "./" })
.pipe(imageResize({
format: 'jpeg',
width: 2880,
@justinemter
justinemter / block-multiple-countries.sh
Last active March 10, 2021 19:59
Block multiple countries using iptables and ipset
#!/bin/bash
declare -a ISO=("af" "au" "al" "dz" "aq" "br" "ar" "cn" "lb" "my" "ly" "lr" "la" "jp" "jm" "jo" "kz" "ke" "hk" "ml" "mx" "fm" "md" "mc" "mn" "ms" "ma" "mz" "mm" "nr" "na" "np" "nl" "an" "nc" "nz" "ni" "ne" "ng" "nu" "nf" "mp" "no" "om" "pk" "pw" "pa" "pg" "py" "pe" "ph" "pn" "pl" "pt" "pr" "qa" "re" "ro" "ru" "rw" "kn" "lc" "vc" "ws" "sm" "st" "sn" "sa" "sc" "sl" "sg" "sk" "si" "sb" "so" "za" "gs" "es" "lk" "sh" "pm" "sd" "sr" "sj" "sz" "se" "ch" "sy" "tw" "tj" "tz" "th" "tg" "tk" "to" "tt" "tn" "tr" "tm" "tc" "tv" "ug" "ua" "ae" "gb" "um" "uy" "uz" "vu" "ve" "vn" "vg" "vi" "wf" "eh" "ye" "yu" "zm" "zw" "ie" "in" "il" "ir" "hn" )
declare -a zone_file_names_ext=()
# remove any old list that might exist from previous runs of this script
find /tmp -name '*.zone' -or -name '*.zone.1' | xargs rm
for i in "${ISO[@]}"
do
zone_file_names_ext+=( "$i.zone" )
@justinemter
justinemter / startstop.sh
Last active January 25, 2023 16:52
Simple script to start / stop a python script in the background.
#!/bin/bash
# file: startstop.sh
#----
# Simple script to start / stop a python script in the background.
#----
#----
# To Use:
@justinemter
justinemter / restart_pfsense.sh
Last active July 18, 2017 21:53
This script pings google to see if the WAN is alive... if the network is down it restarts my pfSense VM running on proxmox.
#!/bin/bash
# file: restart_pfsense.sh
# This is a solution to a problem I have with my pfSense network. When downloading big files often pfsense will stop
# and needs to be restarted. Or, sometimes pfSense will stay running but the WAN goes down for some reason. Rather than
# investigating further I've found that by restarting the pfSense VM (in Proxmox), then the WAN goes back up. Since it takes a minute
# or two to get the VM back up with WAN connection, I have a 10 minute delay to skip the restart if WAN isn't back up. Otherwise you'd
# keep restarting the VM before it had a chance to initialize. Seems to work great!
# Set Crontab to run this every minute:
@justinemter
justinemter / dock_myip.sh
Last active June 19, 2017 07:13
Simple script to check specified domains dynamic IP & update iptable ssh rule.
#!/bin/bash
# file: dock_myip.sh
#----
# Simple script to check specified domains dynamic IP & update iptable ssh rule
#----
#----
# To Use:
# Make this file executable: chmod +x dock_myip.sh
@justinemter
justinemter / SMBDIS.ASM
Created December 16, 2016 04:43 — forked from 1wErt3r/SMBDIS.ASM
A Comprehensive Super Mario Bros. Disassembly
;SMBDIS.ASM - A COMPREHENSIVE SUPER MARIO BROS. DISASSEMBLY
;by doppelganger ([email protected])
;This file is provided for your own use as-is. It will require the character rom data
;and an iNES file header to get it to work.
;There are so many people I have to thank for this, that taking all the credit for
;myself would be an unforgivable act of arrogance. Without their help this would
;probably not be possible. So I thank all the peeps in the nesdev scene whose insight into
;the 6502 and the NES helped me learn how it works (you guys know who you are, there's no
@justinemter
justinemter / joomla-1.5-remove-mootoolsjs.php
Created December 13, 2012 17:46
Remove mootool.js / captions.js from joomla 1.5 as per: https://coderwall.com/p/plp6qg
<?php
/*
* JE - 12.13.2012
* The following snippet removes both mootools.js and caption.js from joomla
* Found here: https://coderwall.com/p/plp6qg
*/
defined('_JEXEC') or die;
unset($this->_scripts[JURI::root(true).'/media/system/js/caption.js']);
defined( '_JEXEC' ) or die( 'Access Denied.' );
// Remove mootools and other scripts from header