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 / FontInstallation.ps1
Last active April 11, 2024 03:35
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"
@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 / README.md
Created December 3, 2023 22:35
MetaRadio Template - Smarts Broadcast Skylla
@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 / Python WExpect
Created January 18, 2014 10:40
Python's PExpect for Microsoft Windows: WExpect
"""Pexpect is a Python module for spawning child applications and controlling
them automatically. Pexpect can be used for automating interactive applications
such as ssh, ftp, passwd, telnet, etc. It can be used to a automate setup
scripts for duplicating software package installations on different servers. It
can be used for automated software testing. Pexpect is in the spirit of Don
Libes' Expect, but Pexpect is pure Python. Other Expect-like modules for Python
require TCL and Expect or require C extensions to be compiled. Pexpect does not
use C, Expect, or TCL extensions. It should work on any platform that supports
the standard Python pty module. The Pexpect interface focuses on ease of use so
that simple tasks are easy.
@anthonyeden
anthonyeden / ExchangeInstallLE.bat
Created December 23, 2017 03:03
Let's Encrypt & Microsoft Exchange - Installation Script
"C:\Program Files\Lets Encrypt\letsencrypt.exe" --renew --baseuri "https://acme-v01.api.letsencrypt.org/"
powershell -File "C:\Program Files\Lets Encrypt\ExchangeLetsEncrypt.ps1" -CertificateImport "C:\ProgramData\letsencrypt-win-simple\httpsacme-v01.api.letsencrypt.org\mail.example.com-all.pfx" -ServerName exchange.example.com
@anthonyeden
anthonyeden / simplistic-ffmpeg-streaming.py
Created May 28, 2018 11:46
Sending FFmpeg output to HTTP, via Python's Flash
"""
Streaming FFmpeg to HTTP, via Python's Flask.
This is an incredibly simple example, which will yield issues due to inconsistant input and output rates.
If you're going to use this, VLC works okay as a client.
You really need to move FFmpeg into a separate thread, which should help stream audio more consistantly to the HTTP client.
Example by Anthony Eden (https://mediarealm.com.au)
"""
from flask import Flask
@anthonyeden
anthonyeden / MetaRadioStationPlaylist.xml
Last active May 19, 2023 06:51
MetaRadio: StationPlaylist Studio XML Template
<StationPlaylist><artist><![CDATA[%a]]></artist><title><![CDATA[%t]]></title><album><![CDATA[%T]]></album><duration>%S</duration><starttime>%d %h</starttime><filename><![CDATA[%f]]></filename><comment><![CDATA[%C]]></comment></StationPlaylist>
@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 / 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);