Skip to content

Instantly share code, notes, and snippets.

@richardbenson
richardbenson / get-steam-screenshots.php
Last active August 11, 2023 17:26
Turn Steam screenshots into RSS feed
<?php
header("Content-Type: application/rss+xml; charset=utf-8");
error_reporting(E_ALL);
ini_set("display_errors", 0);
define('STEAM_USER', $_GET['u']);
define('LIST_URL', "http://steamcommunity.com/id/".STEAM_USER."/screenshots/?appid=0&sort=newestfirst&browsefilter=myfiles&view=grid");
include('extlib/ganon/ganon.php');
@richardbenson
richardbenson / xmlrpc.php
Last active October 13, 2015 15:38
ifttt to movabletype
<?php
//Variables, set these
$xmlrpc_fullurl = "http://www.example.com/cgi-bin/mt/mt-xmlrpc.cgi"; // path to your mt-xmlrpc.cgi file
$blog_id = "3"; //The blog ID to post to, as IFTTT has no options for this we force it.
//Fetch the request and turn it into an XML element for editing
$request_body = file_get_contents('php://input');
$methodCall = new SimpleXMLElement($request_body);
//Check if the title includes a blog id in the form "title {x}"
@richardbenson
richardbenson / sns-pushover.php
Last active September 30, 2018 10:35
Simple script to send SNS notifications to your smartphone via Pushover. Requires signing up for Pushover and getting an API key. Then host anywhere and add the URL as subscription to your topic.
<?php
define('PUSHOVER_API_KEY', '<API KEY>'); //Replace with your API Key
$userKey = (isset($_GET['u']) ? $_GET['u'] : '<DEFAULT USER ID>'); //Default user or group
$response = json_decode(file_get_contents('php://input'), true);
switch ($response["Type"]) {
case "SubscriptionConfirmation":
//For this use case, we will just automatically subscribe, we could forward this via email,
@richardbenson
richardbenson / RestoreCryptolockerFiles.vbs
Created October 15, 2013 19:42
Dirty script knocked together to recover from a CryptoLocker infection. So you don't have to roll-back unaffected files: * Restore back to a separate folder * Amend first two lines as follows: * `strRestoreFolder` is the folder you restored from backuup * `strOriginalFolder` is your destroyed store * Highly recommend a test run by leaving `bolDo…
strRestoreFolder = "G:\Document"
strOriginalFolder = "E:\Document"
bolDoIt = false
strAffectedFiles = "odt, ods, odp, odm, odc, odb, doc, docx, docm, wps, xls, xlsx, xlsm, xlsb, xlk, ppt, pptx, pptm, mdb, accdb, pst, dwg, dxf, dxg, wpd, rtf, wb2, mdf, dbf, psd, pdd, eps, ai, indd, cdr, jpg, jpe, jpg, dng, 3fr, arw, srf, sr2, bay, crw, cr2, dcr, kdc, erf, mef, mrw, nef, nrw, orf, raf, raw, rwl, rw2, r3d, ptx, pef, srw, x3f, der, cer, crt, pem, pfx, p12, p7b, p7c, pdf, tif"
arrAffectedFiles = Split(arrAffectedFiles, ", ")
Set dicAffectedFiles = CreateObject("Scripting.Dictionary")