Skip to content

Instantly share code, notes, and snippets.

View auyongcheemeng's full-sized avatar

Chee Meng Au Yong auyongcheemeng

View GitHub Profile
@auyongcheemeng
auyongcheemeng / pushover-ipchange-watchdog.sh
Last active October 18, 2024 19:52
IPv4 / IPv6 address change monitoring and notification bash script with Pushover.net notifications, for use with crontab
#!/bin/bash
## IPv4 / IPv6 address change monitoring and notification bash script with Pushover.net notifications
## intended for use with crontab
if [ ! -e ~/ipv4addr.log ] ; then
touch ~/ipv4addr.log
fi
if [ ! -e ~/ipv6addr.log ] ; then
@auyongcheemeng
auyongcheemeng / ublockorigin-facebook-filter
Last active September 13, 2021 08:28
Blocking annoyances on FB with uBlock origin (tenor, giphy, reaction emoticons)
! Overriding an exception in uBlock filters – Unbreak
! that was supposingly intended in 2017 to fix https://github.com/gorhill/uBlock/issues/3138
! but that original fix does not seem to be doing anything in 2021 but hamper our efforts to filter
@@||fbcdn.net/safe_image.php?$image,domain=facebook.com|facebookcorewwwi.onion|facebookwkhpilnemxj7asaniu7vnjjbiltxjqhye3mhbshg7kx5tfyd.onion,badfilter
! regex filter matching for external fbcdn.net img assets containing (tenor|giphy)
! example link: https://external.fkul2-2.fna.fbcdn.net/safe_image.php?d=AQE-RknvkuCPucuY&w=960&h=960&url=https%3A%2F%2Fmedia2.giphy.com%2Fmedia%2FWOl1f1lAD76IjaXWs7%2Fgiphy.gif%3Fkid%3Dbe302117%26ct%3Ds&ext=jpg&_nc_oe=6eab8&_nc_sid=220845&ccb=3-5&_nc_hash=AQFINvBoNBpXUcmc
/^https?:\/\/external.*.fna.fbcdn.net\/safe_image.php\?.*(tenor|giphy)/$image,third-party,domain=facebook.com|facebookcorewwwi.onion|facebookwkhpilnemxj7asaniu7vnjjbiltxjqhye3mhbshg7kx5tfyd.onion
! regex filter mtching for static content on fbcdn *.png (reaction emo
@auyongcheemeng
auyongcheemeng / ffmp-resample-44100.bat
Created May 9, 2020 20:16
ffmpeg script for resampling ALAC to 44.1kHz sample rate (windows batch)
:: ffmpeg script for resampling ALAC to 44.1kHz sample rate
IF NOT EXIST resample-input\NUL mkdir resample-input
IF NOT EXIST resample-output\NUL mkdir resample-output
for %%a in ("resample-input\*.m4a") do ffmpeg -y -i "%%a" -vn -c:a alac -ar 44100 "resample-output\%%~na.m4a"
@echo off
pause
@auyongcheemeng
auyongcheemeng / ffmp-flac-alac.bat
Last active March 24, 2025 16:59
ffmpeg flac to alac conversion batch script (windows)
:::: ffmpeg script for converting FLAC to ALAC
:: ffmpeg windows binary is required (https://ffmpeg.org)
:: Script creates the folders ['flac' and 'alac'] on first run.
:: Copy the associated files to the appropriate folder [ie. '.flac' files to 'flac' folder]
:: and run the
IF NOT EXIST alac\NUL mkdir alac
@auyongcheemeng
auyongcheemeng / ffmpeg-stream-from-raspivid.md
Last active April 8, 2018 11:35 — forked from max-mapper/readme.md
ffmpeg youtube live event rtmp stream from raspberry pi with raspi camera (raspivid)
  1. apt-get install ffmpeg - it is now available on raspbian repos (last checked April 2018)
  2. create youtube 'live event'. get rtmp url + session id
  3. run this:
raspivid -o - -t 0 -vf -hf -w 1280 -h 720 -fps 30 -b 3000000 -cfx 128:128 -drc high | ffmpeg -re -ar 44100 -ac 2 -acodec pcm_s16le -f s16le -ac 2 -i /dev/zero -f h264 -i - -vcodec copy -acodec aac -ab 128k -g 50 -strict experimental -f flv rtmp://a.rtmp.youtube.com/live2/<SESSION>

custom additions:
-cfx 128:128: for grayscale video

@auyongcheemeng
auyongcheemeng / umatrix-rules-minimal-cdn.txt
Last active May 9, 2020 17:12
A whitelist of common global CDNs for use with uMatrix
* ajax.googleapis.com script allow
* code.jquery.com script allow
* google.com fetch allow
* google.com frame allow
* google.com script allow
* gstatic.com fetch allow
* gstatic.com script allow
* jsdelivr.net script allow
* maps.googleapis.com script allow
* recaptcha.net script allow
#!/bin/sh
# This script automates the setup ssl cert and key on Tomato router to use JFFS
# Based on Tutorial: Use SSL certificate for WAN admin @http://tomatousb.org/tut:use-ssl-certificate-for-wan-admin
# Requires default `certpem` and `key.pem` present at /jffs/ssl/
rm /etc/cert.pem
rm /etc/key.pem
ln -s /jffs/ssl/cert.pem /etc/cert.pem
ln -s /jffs/ssl/key.pem /etc/key.pem

Keybase proof

I hereby claim:

  • I am auyongcheemeng on github.
  • I am auyongcheemeng (https://keybase.io/auyongcheemeng) on keybase.
  • I have a public key whose fingerprint is 57A5 1632 B3FB B5E1 F5EB B2F1 6F74 2999 293D 7ECA

To claim this, I am signing this object: