Skip to content

Instantly share code, notes, and snippets.

View btgoodwin's full-sized avatar

Thomas Goodwin btgoodwin

View GitHub Profile
@btgoodwin
btgoodwin / fcpxml_parse
Last active October 21, 2022 17:26
Final Cut Pro X FCPXML Parser
#!/usr/bin/python
'''
Author: Thomas Goodwin
Company: Geon Technologies, LLC, 2014
This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program. If not, see http://www.gnu.org/licenses/.
@btgoodwin
btgoodwin / FrontEndController.patch
Last active August 29, 2015 14:13
Patch file for supervisord.conf to mirror what happens with the LiveDVD.
--- a/python/FrontEndController.py
+++ b/python/FrontEndController.py
@@ -37,10 +37,10 @@ class FrontEndController_i(FrontEndController_base):
example of FEI Allocations and connections. It was developed with REDHAWK 1.10.0.
"""
- targetComponent=None
+ targetComponents=[]
targetDevice=None
domain = None
@btgoodwin
btgoodwin / fei-factories.js
Last active January 26, 2016 13:22
Start of some generic factory extensions on top of those in client/redhawk-services.js
/*
* This file is protected by Copyright. Please refer to the COPYRIGHT file
* distributed with this source distribution.
*
* This file is part of fei-factories.
*
* REDHAWK redhawk-web-app is free software: you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License as published by the
* Free Software Foundation, either version 3 of the License, or (at your
* option) any later version.
@btgoodwin
btgoodwin / debug-python-device.txt
Last active August 29, 2015 14:18
Debug a Python REDHAWK Device on a running domain
In this case, I'm suggesting using `winpdb` because it should be available to you in the CentOS 6.x EPEL repos (which gets around some issues of what software can be used, where).
1) Find the `entrypoint` tag entry in your SPD.XML file, duplicate it
2) Comment the original `entrypoint` line
3) Edit the new entry to use a shell script instead, e.g.: `<entrypoint>python/debug.sh</entrypoint>`
4) Create `python/debug.sh`:
@btgoodwin
btgoodwin / frontend_gps_idl
Created April 22, 2015 17:56
Simple set of frontend GPS definitions in Python since the code generator doesn't support it right now.
'''
This can be pasted at the head of your implementation class file. In your implementation
initialize() method, replace the port with this new one and add 2 private members attached
to two public properties:
def initialize(self):
baseclass.initialize()
self.port_port_name = self.My_PortFRONTENDGPSIn(self, 'port_name')
self._GPSInfo = GPSInfo()
self._GpsTimePos = GpsTimePos()
@btgoodwin
btgoodwin / uEnv.txt
Created January 19, 2017 14:23
MicroZed Target
kernel_image=uImage
devicetree_image=microzed-zynq7.dtb
bootargs=console=ttyPS0,115200 root=/dev/mmcblk0p2 rw rootwait earlyprintk
uenvcmd=echo Copying Linux from SD to RAM... && fatload mmc 0 0x3000000 ${kernel_image} && fatload mmc 0 0x2A00000 ${devicetree_image} && bootm 0x3000000 - 0x2A00000
modeboot=uenvcmd
@btgoodwin
btgoodwin / time_patch.sh
Created December 13, 2017 13:40
Script for correcting the Racoon configuration of macOS/OS X so IPSec VPNs do not time out.
#!/bin/bash
# There currently (12/13/17) is no way to update the Racoon template configuraiton
# of macOS or OS X...and there hasn't been despite this lingering issue where
# VPN tunnels will "collapse" silently just shy of an hour. The below patching
# will correct the timeout issue so that your tunnel will remain useful for hours
# (really, days).
#
# Usage:
# Start your VPN connection.
# Copy the "/var/run/racoon/[filename].conf" to /etc/racoon/config
@btgoodwin
btgoodwin / erase_all_jobs.sh
Last active March 20, 2019 13:07
GitLab EE/CE V4 API: Erase all jobs for project
#!/usr/bin/env bash
# Author: Thomas Goodwin
# Company: Geon Technologies
# Purpose: Erase all jobs for a given GitLab project.
# Arguments:
# 1) URL of gitlab project (https://some.server.com/group/[group/]project)
# 2) private token (personal access token, impersonation token, etc.)
#
# Requirements: bash > 4.0, jq
@btgoodwin
btgoodwin / find_replace_example.py
Created May 1, 2019 11:42
Python find-replace
import re
output_file_path = 'whatever'
content = None
with open(out_file_path, 'r') as f:
content = f.read()
# Regex find, replace pairs
FINDREPLACE_LIST = [
( re.compile(r'FIND', re.M), r'REPLACE' )
@btgoodwin
btgoodwin / statuses.xml
Created June 22, 2019 16:15
REDHAWK 2.2.x Programmable Device properties
<structsequence id="hw_load_statuses" mode="readwrite" name="hw_load_statuses">
<description>The representation of received and valid hw_load_requests.</description>
<struct id="hw_load_status" name="hw_load_status">
<description>A request to load a specific file to a specific piece of hardware</description>
<simple id="hw_load_status::request_id" name="request_id" type="string">
<description>A unique ID representing a new request that is used to differentiate hw_loads from one another</description>
</simple>
<simple id="hw_load_status::requester_id" name="requester_id" type="string">
<description>The ID (typically device identifier()) that is attempting to request a hw load. This is required so the programmable device knows which device has requested and should be given full control of the hardware.</description>
</simple>