View RDS_INSTALL.bat
"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 |
View AWS_S3_Presign_Download.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') { |
View command-dshow-listinputs.txt
ffmpeg -list_devices true -f dshow -i dummy |
View Responsive-YouTube-Embed-Wordpress-Filters.php
<?php | |
add_filter('the_content', function($content) { | |
return str_replace(array("<iframe", "</iframe>"), array('<div class="iframe-container"><iframe', "</iframe></div>"), $content); | |
}); | |
add_filter('embed_oembed_html', function ($html, $url, $attr, $post_id) { | |
if(strpos($html, 'youtube.com') !== false || strpos($html, 'youtu.be') !== false){ | |
return '<div class="embed-responsive embed-responsive-16by9">' . $html . '</div>'; | |
} else { |
View icecast_config_sample.xml
<mount> | |
<mount-name>/mountname</mount-name> | |
<password>hackme</password> | |
<!-- Geo-blocking can be added to any mount, but not relays --> | |
<authentication type="url"> | |
<option name="listener_add" value="http://example.com/icecast_geoblock.php?mount=mountmame" /> | |
<option name="auth_header" value="icecast-auth-user: 1" /> | |
</authentication> | |
</mount> |
View FontInstallation.ps1
# 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" |
View paradox.py
# coding: utf-8 | |
""" | |
Converts Paradox databases to Python objects or CSV. | |
You don't need any dependency (except Python) to make this module work. | |
This module is incomplete but reads most Paradox `.DB` files. | |
If this module is not fast or complete enough for you, consider using pxview. | |
CAUTION: THIS SOFTWARE DOES NOT RELIABLY FETCH ALL DATA FROM PARADOX. CONSIDER USING ODBC DRIVERS INSTEAD. |
View countdown_5mins.txt
st = 300; | |
t = st - time; | |
c = timeToTimecode(t); | |
c = c.substring(4,8) | |
c |
View simplistic-ffmpeg-streaming.py
""" | |
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 |
View wordpress-date.php
<?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); | |
NewerOlder