Skip to content

Instantly share code, notes, and snippets.

@JasperE84
JasperE84 / .htaccess
Created July 1, 2022 11:59
.htaccess webp redirection if exists and client accept header permits
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
# check if browser accepts webp
RewriteCond %{HTTP_ACCEPT} image/webp
# check if file is jpg or png
RewriteCond %{REQUEST_FILENAME} (.*\.(jpe?g|png))$
# check if corresponding webp file exists image.png -> image.webp
@JasperE84
JasperE84 / docker-compose.yml
Created January 29, 2022 10:54
Docker compose file for transmission-openvpn, nzbget, radarr, sonarr, jackett and bazarr
version: "3.3"
services:
transmission:
cap_add:
- NET_ADMIN
sysctls:
- net.ipv6.conf.all.disable_ipv6=0
image: haugene/transmission-openvpn
@JasperE84
JasperE84 / BarcodeService.cs
Created February 17, 2019 13:15
An UWP PointOfService class for keeping Bluetooth barcode scanners connected
namespace MyApp.Services.BarcodeServices
{
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Windows.Devices.Enumeration;
using Windows.Devices.PointOfService;
using Windows.UI.Xaml;
using static MyApp.Helpers.BarcodeHelpers;
@JasperE84
JasperE84 / comskip-pd.sh
Created October 28, 2017 13:01
TVHeadend post-remove script for automatic removal of edl, log and logo files as generated by comskip
#!/bin/bash
#
# TVHeadend post-remove script to remove log/edl/logo.txt files (generated by comskip) from recording dir
# TVHeadend config: Configuration -> Recording -> Select profile -> Add the following in setting "Post-remove command": /home/USER/PATH/comskip-pd.sh "%f"
#
INPUTVIDEO="$1" # Full path to recording, i.e. /home/user/Videos/News.ts
FILENAME=$(basename "$INPUTVIDEO")
BASENAME="${FILENAME%.*}"
@JasperE84
JasperE84 / comskip-pp.sh
Created October 28, 2017 12:59
TVHeadend postprocessor script for comskip
#!/bin/bash
#
# This is a postprocessor script to run comskip on a recording and optionally keep a logfile
# TVHeadend config: Configuration -> Recording -> Select profile -> Add the following in setting "Post-processor command": /home/USER/PATH/comskip-pp.sh "%f"
# Get comskip for linux from: https://github.com/erikkaashoek/Comskip
#
# Comskip and script paths
COMSKIPPATH="/home/hts/comskip/Comskip/comskip"
COMSKIPINI="/home/hts/comskip/comskip.ini"