Skip to content

Instantly share code, notes, and snippets.

https://weworkweplay.com/play/rebooting-the-raspberry-pi-when-it-loses-wireless-connection-wifi/ - Rebooting a Pi (Or other Linux box) in the event of a loss of network ping
https://diode.io/raspberry%20pi/running-forever-with-the-raspberry-pi-hardware-watchdog-20202/ Enabling Hardware watchdog on a Pi
https://unix.stackexchange.com/questions/16500/how-to-refuse-routes-that-are-pushed-by-openvpn-server/337675 Forcing OpenVPN client to ignore default route push
https://www.mersive.com/downloads/SolsticeDashboardSetup.exe SolsticeDashboard
@nerdegem
nerdegem / Office365ManualUpdate.txt
Last active August 24, 2022 14:50
Forcing Office to Update if your Organisation blocks updates...
Either run the following command from a CMD/PowerShell or RUN prompt, or create a scheduled task..
"C:\Program Files\Common Files\Microsoft Shared\ClickToRun\OfficeC2RClient.exe" /update user updatepromptuser=true forceappshutdown=false displaylevel=true
You can also add Channel="BetaChannel"
"C:\Program Files\Common Files\Microsoft Shared\ClickToRun\OfficeC2RClient.exe" /update Channel="BetaChannel"
@nerdegem
nerdegem / gist:0ebbf27e32cc22854eb675f25c550f73
Last active October 10, 2023 20:50
HDHomeRun TTL Mangling with IPTables on OpenWRT
If you have a HDHomeRun tuner behind an OpenWRT device such as a cheap Gl-inet router (and within the 3 hop limit), you can very easily break the TTL packet setting that is now set on these devices with a simple shell command.
Based upon this work https://stuff.purdon.ca/?page_id=472
I figured out I could just add
iptables -t mangle -A FORWARD -s <hdhrip> -j TTL --ttl-set 64
iptables -t nat -A POSTROUTING -j MASQUERADE
to the existing rules and it would do what was required. Just add this command, replacing the <hdhrip> with the IP address of the HDHomerun box(s), into your startup scripts, and off you go - HDHomerun DVB TV via the internet once again.
@nerdegem
nerdegem / hevc_nvmpi.txt
Created April 13, 2022 21:04
FFMPEG HEVC NVMPI Codec Options
./ffmpeg -hide_banner -v verbose -h encoder=hevc_nvmpi
Encoder hevc_nvmpi [nvmpi HEVC encoder wrapper]:
General capabilities: delay hardware
Threading capabilities: none
Supported pixel formats: yuv420p
hevc_nvmpi_encoder AVOptions:
-num_capture_buffers <int> E..V..... Number of buffers in the capture context (from 1 to 32) (default 10)
-profile <int> E..V..... Set the encoding profile (from -99 to 100) (default -99)
baseline E..V.....
@nerdegem
nerdegem / JetsonTranscode.txt
Last active April 13, 2022 22:12
HEVC_NVMPI Realtime Transcoding
Using a nVidia Jetson Nano / TX1 to encode HEVC Realtime within TVHeadend
1) Build FFMPEG using the Jetson-FFMPEG instructions
2) chown/grp to hts:video for the ffmpeg to support piping
3) Build TVHeadend and add MPEGTS-SPAWN (Built-in)
4) Add the following script and apply it to the user or default.
/usr/local/bin/ffmpeg -loglevel error -hide_banner -nostats -strict experimental -nostdin -err_detect ignore_err -skip_frame -nokey -ignore_unknown -extra_hw_frames 3 -rtbufsize 4092k -i pipe:0 -c:v hevc_nvmpi -preset:v medium -num_capture_buffers 16 -rc vbr -maxrate 6M -b:v 4M -c:a copy -c:s copy -force_key_frames expr:gte(t,n_forced*3) -f mpegts pipe:1
@nerdegem
nerdegem / radiochannels.m3u8
Created May 3, 2022 21:02
My favourite radio channels
#EXTM3U
#EXTINF:-1 tvg-id="kissfm.es" tvg-chno="800" group-title="Radio",KissFM.es
https://adhandler.kissfmradio.cires21.com/get_link?url=https://bbkissfm.kissfmradio.cires21.com/bbkissfm.mp3
#EXTINF:-1 tvg-id="RadioX.uk" tvg-chno="801" group-title="Radio",RadioX.uk
https://media-ssl.musicradio.com/RadioXUK?isLoggedIn=true&dax_version=release_3139&dax_player=GlobalPlayer&dax_platform=Web&delivery_type=streaming
#EXTINF:-1 tvg-id="planetrock.uk" tvg-chno="802" group-title="Radio",PlanetRock.uk
https://stream-mz.planetradio.co.uk/planetrock.aac?direct=true&aw_0_1st.playerid=BMUK_html5&aw_0_1st.skey=1651611521&aw_0_1st.bauer_loggedin=true&aw_0_req.userConsentV2=true
@nerdegem
nerdegem / tvh_cronjobs.txt
Created May 7, 2022 17:56
tvheadend_schedule networks force scan via Cron
Inspired by https://tvheadend.org/boards/14/topics/20089?r=26364#message-26364
Rather than just 'idle scanning' or 'not scanning' in TVHeadend, this bit of code can be added to your crontab to issue a curl API request to initiate a 'force scan' session. This is ideal for larger IPTV lists whre you probably don't want to be checking thousands of channels for availaibility all the time, but perhaps once a week is useful (for example).
For each service, get the unique "UUID" in /home/hts/.hts/tvheadend/input e.g. /home/hts/.hts/tvheadend/input/dvb/networks
6e715f35f3d81c16584e38163288e123
Then create a cron job to call the API to initiate the request
#DVB Tuner Daily
7 5 * * * curl --user username:password http://server:9981/api/mpegts/network/scan?uuid=uuidnumber --output /dev/null
@nerdegem
nerdegem / tvh_external_ffmpeg_transcode.txt
Last active January 30, 2023 20:40
Code for TVHEadend to perform VAAPI conversion/streaming via external FFMPEG thread
In TVHeadend, create a new Stream Profile using the MPEG-TS SPAWN (Built-in) profile
This one semms to work better:
/usr/local/bin/ffmpeg -loglevel info -hide_banner -nostats -strict experimental -nostdin -err_detect ignore_err -skip_frame -nokey -ignore_unknown -threads 2 -extra_hw_frames 3 -rtbufsize 8096k -hwaccel vaapi -hwaccel_output_format vaapi -hwaccel_device /dev/dri/renderD128 -i pipe:0 -c:v hevc_vaapi -maxrate 5M -b:v 2M -vf 'deinterlace_vaapi=rate=field:auto=1,hwupload' -g 100 -c:a aac -b:a 128k -profile:a aac_main -c:s copy -f matroska pipe:1
This was the old one:
/usr/local/bin/ffmpeg -loglevel info -hide_banner -nostats -strict experimental -nostdin -err_detect ignore_err -skip_frame -nokey -ignore_unknown -threads 1 -extra_hw_frames 3 -rtbufsize 4096k -hwaccel vaapi -hwaccel_device /dev/dri/renderD129 -hwaccel_output_format vaapi -i pipe:0 -c:v hevc_vaapi -maxrate 5M -b:v 2M -vf 'deinterlace_vaapi=rate=field:auto=1,hwupload' -c:a aac -b:a 128k -profile:a aac_main -c:s copy -force_key_frames
@nerdegem
nerdegem / samba.txt
Created May 29, 2022 21:29
Working Samba Config
[global]
workgroup = SAMBA
security = user
server string = %h server (Samba, Ubuntu)
protocol = SMB3
server min protocol = SMB2_02
interfaces = 127.0.0.0/8 eth0
log file = /var/log/samba/log.%m
@nerdegem
nerdegem / gist:e7fe6679a509413311c85a369b764903
Created July 16, 2022 22:24
Default Password for EPSON ET-2820
I couldn't find it recorded anyway, but the default webpage administrator password for an
EPSON ET-2820 EcoTank
is the device serial number.