Extract values from Senec JSON with string-hex-floats and push them to InfluxDB
SENEC_URL=http://senec.local/lala.cgi INFLUX_URL=https://influx.yourserver.net/ INFLUX_ORG=your_org INFLUX_TOKEN=your_token ./senec-to-influx.py
launchctl unload -w /System/Library/LaunchDaemons/com.apple.spindump.plist |
These steps show two less common interactions with git to extract a single file which is inside a subfolder from a git repository. These steps essentially reduce the repository to just the desired files and should performed on a copy of the original repository (1.).
First the repository is reduced to just the subfolder containing the files in question using git filter-branch --subdirectory-filter
(2.) which is a useful step by itself if just a subfolder needs to be extracted. This step moves the desired files to the top level of the repository.
Finally all remaining files are listed using git ls
, the files to keep are removed from that using grep -v
and the resulting list is passed to git rm
which is invoked by git filter-branch --index-filter
(3.). A bit convoluted but it does the trick.
#! /bin/sh | |
find . -name "*.nib" -type d | awk '{sub(/.nib/,"");print}' | xargs -I % ibtool --write %.xib --upgrade %.nib |
#!/usr/bin/env sh | |
# Stored at: https://gist.github.com/4452136 | |
# Assumes the given path points to a FLV file with MP4 video. | |
# Use ffmpeg to repackage the file. | |
ffmpeg -i "$1" -acodec copy -vcodec copy "$1".mp4 | |
# old version: | |
# Not used anymore as VLC seems to have a bug that creates broken |
<?xml version="1.0"?> | |
<!-- | |
Stylesheet to list all tag-name paths in an XML file, including attributes. | |
2013 Sven-S. Porst <porst@sub.uni-goettingen.de> | |
--> | |
<xsl:transform xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> | |
<xsl:output method="text" /> |
{ a: 7, b: 2, c: 5, d: 4, e: 1, f: 3, g: 8, h: 6 } |
<?xml version="1.0" encoding="UTF-8"?> | |
<!-- | |
Attempt to use xsl:key on data not stored in the document itself. | |
We _can_ load external XML into a variable using document() and use | |
the key() function on that. | |
We _cannot_ include the XML into our stylesheet and use the key() | |
function on that. |
HandBrakeCLI --input input.dv --output output.mp4 --format mp4 --encoder x264 --x264opts ref=2:bframes=2:subq=6:mixed-refs=0:weightb=0:8x8dct=0:trellis=0 --optimize --quality 0.5 --audio 1 --aencoder ca_aac --ab 128 --arate 32 --aname English | |
HandBrakeCLI-0.9.3 --input input.dv --output result.ogv --format ogm --encoder theora --optimize --quality 0.6 --audio 1 --aencoder vorbis --ab 128 --arate 32 --aname English | |
# Commands to convert DV (or any) video to MP4 and OGM using the CLI version of HandBrake. | |
# The MP4 result it simple-minded enough to be played by QuickTime. | |
# The audio bitrate is picked to match the 32kHz audio of some DV video. | |
# You need the 0.9.3 version for the ogg files, as that feature was removed in 0.9.4. |
#! /bin/sh | |
find . -name "*.xib" -type f | awk '{sub(/.xib/,"");print}' | xargs -I % ibtool --compile %.nib %.xib |