Skip to content

Instantly share code, notes, and snippets.

Avatar

Winston Hoy curiousercreative

View GitHub Profile
@arm2arm
arm2arm / rebalance_zfs.sh
Created Apr 6, 2021
rebalance zfs for the cold data
View rebalance_zfs.sh
# If you change some settings in the zfs dataset you should rebalance it in order to store data with this current settings.
# Usage:
# zfs set recordsize=1M data/archive
# sh ./rebalance_zfs.sh /data/archive| parallel -P 16 --eta
mypath=$1
find $mypath -type f | xargs -d '\n' -I{} echo "rsync -a --inplace \"{}\" \"{}.abcdef\";unlink \"{}\";mv \"{}.abcdef\" \"{}\" "
View esm-package.md

Pure ESM package

The package linked to from here is now pure ESM. It cannot be require()'d from CommonJS.

This means you have the following choices:

  1. Use ESM yourself. (preferred)
    Use import foo from 'foo' instead of const foo = require('foo') to import the package. You also need to put "type": "module" in your package.json and more. Follow the below guide.
  2. If the package is used in an async context, you could use await import(…) from CommonJS instead of require(…).
  3. Stay on the existing version of the package until you can move to ESM.
@qdm12
qdm12 / README.md
Last active Sep 27, 2022
Wireguard and iptables restrictions for multiple users
View README.md

Wireguard and iptables restrictions for multiple users

If you don't know what Wireguard is, well, you should. It's fast, easy to setup and highly configurable. We will configure Wireguard for multiple users with various restrictions using iptables.

Assumptions

This should fit most setups (not mine though 😉)

@afriza
afriza / INSTALLING-vlc-with-decklink-support.md
Last active Jan 28, 2021
Compiling and installing `vlc` with Decklink SDK on Ubuntu 18.04 Server
View INSTALLING-vlc-with-decklink-support.md
@jakub-g
jakub-g / _1_"script async defer" blocks "load" event.md
Last active Jul 19, 2022
Beware of "script async defer" blocking HTML "load" event
View _1_"script async defer" blocks "load" event.md

Beware of <script async defer> blocking HTML "load" event

2015.10.07 t

On the importance of simulated latency testing, and bulletproofing your page from the third-party JS load failures

TL;DR

View ffmpeg.md

ffmpeg

Converting Audio into Different Formats / Sample Rates

Minimal example: transcode from MP3 to WMA:
ffmpeg -i input.mp3 output.wma

You can get the list of supported formats with:
ffmpeg -formats

You can get the list of installed codecs with:

@mhussain
mhussain / update-dns.sh
Created May 8, 2012 — forked from smarthall/update-dns.sh
Linode dynamic DNS updating script
View update-dns.sh
#!/bin/sh
# modified by jfro from http://www.cnysupport.com/index.php/linode-dynamic-dns-ddns-update-script
# Uses curl to be compatible with machines that don't have wget by default
LINODE_API_KEY=licensekey
DOMAIN_ID=domainid
RESOURCE_ID=resourceid
WAN_IP=`curl -s ifconfig.me/ip`
if [ -f $HOME/.wan_ip.txt ]; then