Skip to content

Instantly share code, notes, and snippets.

View anthonyeden's full-sized avatar
💭
Working on changing the world.

Anthony Eden anthonyeden

💭
Working on changing the world.
View GitHub Profile
@anthonyeden
anthonyeden / nexgen_xml_receiver.php
Created September 26, 2016 10:47 — forked from anonymous/nexgen_xml_receiver.php
NexGen Now Playing PHP Sample Script
<?php
//GET XML data from RCS NexGen
//?nexgendata=ENCODEDXML
// The raw XML data sent from NexGen
$xml_raw = $_GET['nexgendata'];
// A simple way to convert the XML to an associative array
$xml_nexgen = json_decode(json_encode((array)simplexml_load_string($xml_raw)), 1);
@anthonyeden
anthonyeden / TrelloTimeTracker.php
Created April 17, 2017 07:11
Trello Time Tracker
<?php
// Trello Time Tracker
// (C) 2017 Anthony Eden
// http://mediarealm.com.au/
// This script takes an JSON export from a Trello board (saved as data.json) and shows you a timesheet
// It uses Custom Fields in Trello to read the hours spent working on each card, then displays it as a table
// Simple, yet very handy.
@anthonyeden
anthonyeden / AWS_S3_Presign_Download.php
Last active December 5, 2023 09:48
AWS S3: Pre-sign Upload & Download Requests [PHP]
<?php
function AWS_S3_PresignDownload($AWSAccessKeyId, $AWSSecretAccessKey, $BucketName, $AWSRegion, $canonical_uri, $expires = 8400) {
// Creates a signed download link for an AWS S3 file
// Based on https://gist.github.com/kelvinmo/d78be66c4f36415a6b80
$encoded_uri = str_replace('%2F', '/', rawurlencode($canonical_uri));
// Specify the hostname for the S3 endpoint
if($AWSRegion == 'us-east-1') {
@anthonyeden
anthonyeden / ParadoxPythonExample.py
Last active May 31, 2024 12:46
Paradox Database: Connect & Query in Python
# A sample script to create a temporary copy of a Paradox database, connect to it, and query it.
# Requires PyPyODBC: https://pypi.python.org/pypi/pypyodbc
# Written by Anthony Eden - http://mediarealm.com.au/
import os
import shutil
import pypyodbc
@anthonyeden
anthonyeden / StatusFeedExample1.py
Created June 24, 2017 08:38
Zetta Status Feed Examples (Python)
"""
Zetta Status Feed - Example Code
Written by Anthony Eden (http://mediarealm.com.au/)
https://mediarealm.com.au/articles/rcs-zetta-status-feed-getting-started/
"""
# We need the PySimpleSoap library (https://pypi.python.org/pypi/PySimpleSOAP/1.16)
# Make sure you see my change to PySimpleSoap in the file "pysimplesoap-helpers-patch.py"
from pysimplesoap.client import SoapClient
@anthonyeden
anthonyeden / icecast-downloadxml.sh
Created June 25, 2017 06:46
Icecast: Pull Configuration from S3
#!/bin/sh
# This script downloads your Icecast XML script from AWS S3, compares it for changes, and reloads Icecast if changes have been found
# Written by Anthony Eden (http://mediarealm.com.au/)
file="icecast.xml"
bucket="BUCKET-NAME-GOES-HERE"
s3Key="KEY-GOES-HERE"
s3Secret="SECRET-GOES-HERE"
@anthonyeden
anthonyeden / Zetta-LogLoadEmail.py
Created October 21, 2017 05:01
Zetta: Email Alerts for Flat-File Log Imports
"""
Zetta Log Import Emailer
This script will email you whenever a new log is imported into Zetta
Written by Anthony Eden (https://mediarealm.com.au/)
"""
# You need to download this module: https://pypi.python.org/pypi/pypyodbc
# Email config options
@anthonyeden
anthonyeden / wordpress-date.php
Last active May 8, 2023 07:38
Wordpress Date() and StrToTime() Functions
<?php
function wp_date_localised($format, $timestamp = null) {
// This function behaves a bit like PHP's Date() function, but taking into account the Wordpress site's timezone
// CAUTION: It will throw an exception when it receives invalid input - please catch it accordingly
// From https://mediarealm.com.au/
$tz_string = get_option('timezone_string');
$tz_offset = get_option('gmt_offset', 0);
@anthonyeden
anthonyeden / RDS_INSTALL.bat
Created October 28, 2017 02:59
Let's Encrypt & Microsoft Remote Desktop Services - Installation Script
"C:\Program Files\Lets Encrypt\letsencrypt.exe" --renew --baseuri "https://acme-v01.api.letsencrypt.org/"
powershell -File "C:\Program Files\Lets Encrypt\RDS_INSTALL_CERT.ps1" -CertificateImport "C:\ProgramData\letsencrypt-win-simple\httpsacme-v01.api.letsencrypt.org\remote.example.com-all.pfx" -RDCB remote.example.com
@anthonyeden
anthonyeden / FontInstallation.ps1
Last active February 11, 2025 21:56
Font User Installation - Powershell (No Admin Password Needed)
# Run this as a Computer Startup script to allow installing fonts from C:\InstallFont\
# Based on http://www.edugeek.net/forums/windows-7/123187-installation-fonts-without-admin-rights-2.html
# Run this as a Computer Startup Script in Group Policy
# Full details on my website - https://mediarealm.com.au/articles/windows-font-install-no-password-powershell/
$SourceDir = "C:\InstallFont\"
$Source = "C:\InstallFont\*"
$Destination = (New-Object -ComObject Shell.Application).Namespace(0x14)
$TempFolder = "C:\Windows\Temp\Fonts"