Skip to content

Instantly share code, notes, and snippets.

View jhenkens's full-sized avatar

Johan Henkens jhenkens

View GitHub Profile
@jhenkens
jhenkens / Alarm Chime for Home Assistant Envisalink.md
Last active May 31, 2023 17:01
Alarm Chime for Home Assistant Envisalink
@jhenkens
jhenkens / README.md
Created October 6, 2020 00:54
AT&T UVerse DSL Residental Gateway InfluxDB Telegraf Grafana Dashboard

I wrote a basic dashboard / telegraf plugin to poll the RG to get line stats.

[[inputs.exec]]
  name_override = "attrg"
  commands = ["/etc/telegraf/exec/attrg.py"]
  timeout = "5s"
  data_format = "json"
  json_strict = true
 interval="15s"
diff --git a/web/index.html b/web/index.html
index d77a0ab..2ec858d 100755
--- a/web/index.html
+++ b/web/index.html
@@ -44,6 +44,9 @@
<div id="toolbar-start" title="Start Selected Torrents"></div>
<div id="toolbar-pause" title="Pause Selected Torrents"></div>
<div id="toolbar-separator"></div>
+ <div id="toolbar-download-random" title="Download Selected Torrent Normally"></div>
+ <div id="toolbar-download-sequential" title="Downloaded Selected Torrent Sequentially"></div>
users = User.all
Project.all.each do |project|
comment = FactoryGirl.create(:comment, author: users.sample, project: project)
100.times do
comment = FactoryGirl.create(:comment, author: users.sample, project: project, parent: comment)
end
end
@jhenkens
jhenkens / .Cox Latency Issues.md
Last active August 29, 2015 14:08
Cox Latency And Speed Issues

Figured I'd try to put together all the packet traces and stuff for cox in one spot to try to get my issues figured out.

Basically, the issue is that during prime time every day, my internet becomes basically unusable for any media usage. Burst speeds of 28Mbps are my normal speed during primetime, when I'm expected to get 100Mbps+ on my current tier. These tests are using their servers! Using Speedtest.net, I get wildly inconsistent speeds - from <10Mbps to >45Mbps during primetime.

WoW and CS:GO have been unplayable, with sustained reported ping of 150+, spikes in the 400 range, and felt latency of around 1 second or more. Streaming videos buffer constantly. I had a SB6120 modem. I replaced it with a SB6183 modem on 11/4/2014, after @coxhelp suggested I may need to get an 8-channel bonded modem. This new modem is up to 16-channels. But I still only see 4 bonded, UP/Down.

These are some scripts I have to manage two versions of transmission that I run on my server. transmission.sh is the script I use with transmission's script-torrent-done. It gets the torrent, and copies all of its files to another hard drive, but leaves the original copies alone. It then calls my sickbeard post-processing script on the copy-directory, and the sickbeard post processing script does all the deleting it wants.

The second script I call now and then to move all the torrents from my sickbeard managed instance of transmission over to my normal instance of transmission. I didn't want to do this automatically as part of the script-torrent-done because sometimes I will set shows to sequential download (using the patch in another one of my gists) and watch them as they are downloading on XBMC. I wouldn't want those files to disappear while watching them! So instead I just call this script manually. Maybe I'll crontab it once a week or something, I don't know.

@jhenkens
jhenkens / transmissionSequentialPatch.diff
Last active August 29, 2015 14:01
Patch to transmission to enable sequential torrenting on a per-torrent basis in the web gui. This allows 'streaming' media as it is downloaded.
Index: daemon/remote.c
===================================================================
--- daemon/remote.c (revision 14252)
+++ daemon/remote.c (working copy)
@@ -718,6 +718,7 @@
TR_KEY_seedRatioMode,
TR_KEY_seedRatioLimit,
TR_KEY_sizeWhenDone,
+ TR_KEY_sequential,
TR_KEY_startDate,
@jhenkens
jhenkens / 01-autoreboot
Last active August 29, 2015 14:01
OpenElec Files
#!/bin/bash
# OpenElec Power Script to restart XBMC
# I didn't want to bind any special buttons to reboot xbmc, and I already had a button to sleep cycle the box.
# I wrote this script to kill xbmc within OpenElec if you sleep and then wake within 60 secodns
# Put it in /storage/.config/sleep.d/01-autoreboot
# Or whatever you want within sleep.d, autoreboot is a terrible name
LOCDIR=/storage/.config/.autoreboot

Install raspbian, set up your users however you would like, so long as you have sudo access on the user you are running this with. You probably want to resize the image so it fills the SD card as well.

  1. Copy this entire gist to your raspberry pi
  2. Do chmod +x step1.sh step2.sh iptables.sh in the gist folder (so that
  3. Run step1.sh a) This script does a few things - it first updates your raspberry pi, then it installs a few needed utilities, then it upgrades the firmware on your raspberry pi
@jhenkens
jhenkens / .My terminal configs
Last active February 18, 2020 11:41
My terminal config files
Some of these are copied from elsewhere, some of these are made by me.
Maybe I'll eventually add my ~/bin scripts to Gist as well, but I
figured I may as well put these up for versioning and as a reference
to the internet.