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 / gist:5619384
Created May 21, 2013 12:16
RDS Decoder Psudocode (See: http://mediarealm.com.au/articles/2013/05/parsing-rds-group-data-with-pira-p175-and-python/ for more details and explanation of what's happening)
while True:
line = ser.readline()
if (line.find("-") < 0) and (line.__len__() > 16):
hexdata = line.rstrip()
#We need five bits to detect the group type, so turn it into binary:
binaryLine = bin(int(hexdata, 16))[2:].zfill(64)
#RadioText-A:
if binaryLine[16:21] == "00100":
@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 / gist:cefdf552890280328569
Created July 28, 2014 11:01
PyBASS_FX Example Wrapper
'''
This is a simple wrapper for BASS FX in Python, based on PyBASS.
It's incomplete code, but demonstrates basic functionality of the FX plugin in Python.
Feel free to do whatever you like with this. Make it your own.
More info: http://mediarealm.com.au/articles/2014/08/un4seen-bass-audio-library-python/
'''
if platform.system().lower() == 'windows':
@anthonyeden
anthonyeden / gist:d3b395e0406f489b05fe
Created June 28, 2015 08:13
2wcom Example RDS Commands
DURATION=120\n
STRING1=Now: \n
STRING2= by \n
FORMAT_RT=STRING1+TITLE+STRING2+ARTIST\n
AUTO_RT=Y\n
AUTO_RTPLUS=Y\n
RT_DELAY=3\n
TITLE=This is Living\n
ARTIST=Young and Free\n
@anthonyeden
anthonyeden / gist:0a4becbde55bf565803f
Created June 28, 2015 08:14
2wcom RDS Commands via Python
import serial
def updateRDS(comPort, title, artist, duration):
serialConnection = serial.Serial(comPort)
serialConnection.write("DURATION=" + str(int(duration)) + "\n")
serialConnection.write("STRING1=Now: \n")
serialConnection.write("STRING2= by \n")
serialConnection.write("FORMAT_RT=STRING1+TITLE+STRING2+ARTIST\n")
serialConnection.write("AUTO_RT=Y\n")
"""
Azure Table Storage - Python Batching Example
(C) 2016 MediaRealm.com.au
Needs v0.30.0 of the Azure Storage Python SDK
https://github.com/Azure/azure-storage-python/releases/tag/v0.30.0
"""
from azure.storage.table import TableService, Entity, TableBatch
@anthonyeden
anthonyeden / data.php
Created May 24, 2016 06:47
Tally Puller WP Plugin Sample
<?php
// Sample Appeal Tally - Wordpress Plugin
// Provided by Anthony Eden
// Finds and returns various appeal figures for embedding on our pages
// This should be loaded via AJAX, as we don't want a blocking script on our page
//All returned data will be in JSON format
header('Content-type: text/json');
@anthonyeden
anthonyeden / icecast_config_sample.xml
Created August 9, 2016 02:04
Icecast Geoblocking Example
<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>
@anthonyeden
anthonyeden / paradox.py
Last active November 5, 2020 21:31 — forked from BertrandBordage/paradox.py
Python Paradox database reader
# 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.
@anthonyeden
anthonyeden / DreamObjectsUpload.sh
Created September 20, 2016 10:16
DreamObjects Sample Upload Script (Bash)
#!/bin/bash
function uploadDreamObjects {
# Uploads a single file to the DreamObjects S3-style API
# Sample code provided by http://mediarealm.com.au/
# Based on https://gist.github.com/chrismdp/6c6b6c825b07f680e710
# Also https://raw.githubusercontent.com/fredericofs/s3.bash/master/simple_version_working
# And http://tmont.com/blargh/2014/1/uploading-to-s3-in-bash