Skip to content

Instantly share code, notes, and snippets.

Working from home

Vir QuynhVir

Working from home
View GitHub Profile
QuynhVir /
Last active Apr 6, 2021
Find files that are smaller than 50 bytes then delete it
# Count: find . -type f -size -50c -printf 1 | wc -c
# `b' for 512-byte blocks (this is the default if no suffix is used)
# `c' for bytes
# `w' for two-byte words
# `k' for Kilobytes (units of 1024 bytes)
# `M' for Megabytes (units of 1048576 bytes)
# `G' for Gigabytes (units of 1073741824 bytes)
find . -type f -size -50c -delete
QuynhVir /
Created Apr 3, 2021 — forked from tombigel/
How to Change Open Files Limit on OS X and macOS Sierra (10.8 - 10.12)

How to Change Open Files Limit on OS X and macOS

This text is the section about OS X Yosemite (which also works for macOS Sierra) from

The last time i visited this link it was dead (403), so I cloned it here from the latest snapshot in's Wayback Machine

Mac OS X

To check the current limits on your Mac OS X system, run:

QuynhVir /
Created Feb 20, 2021
generate EdDSA keypair for JWT
openssl genpkey -algorithm ed25519 -out private.pem
openssl pkey -in private.pem -pubout
QuynhVir /
Created Jan 26, 2021
perl: warning: Setting locale failed
# Install locales-all package
sudo apt-get install -y locales-all
# Set environment variables
export LANGUAGE=en_US.UTF-8
export LANG=en_US.UTF-8
export LC_ALL=en_US.UTF-8
# Generate en_US.UTF-8
sudo locale-gen en_US.UTF-8
QuynhVir /
Created Oct 1, 2020
Keys on Smart Card not shown in GPG Keychain
# Get the public key (only if the public key is not yet in your keychain)
gpg --card-edit
# Create a stub for the secret key in your keychain
gpg --card-status
# Use the (secret) key as if it was in your keychain
QuynhVir / AdbCommands
Created Aug 27, 2020 — forked from Pulimet/AdbCommands
Adb useful commands list
View AdbCommands
adb help // List all comands
== Adb Server
adb kill-server
adb start-server
== Adb Reboot
adb reboot
adb reboot recovery
adb reboot-bootloader
QuynhVir / filters.txt
Last active Dec 17, 2020
my own uBlock Origin filters
View filters.txt
! Remove Facebook sponsored posts
![data-pagelet^="FeedUnit"]:has(a[role^=button]:has(> span > span:matches-css(position: relative):has-text(S)))
![data-pagelet^="FeedUnit"]:has(div[role^=button]:has(> span > span:matches-css(position: relative):has-text(S)))
![data-pagelet^="FeedUnit"]:has(a[aria-label="Sponsored"])[role="feed"] div > span > span > a > span:upward(div[role="feed"] > div)
! Remove Facebook "Suggested for You"
![data-pagelet^="FeedUnit"]:has(div[role="article"]:has(span > span > span:has-text(Suggested for You)))
! Remove Facebook "New Message"[aria-label="New Message"])
! Remove Facebook "Create Room"
QuynhVir /
Created May 24, 2020
How to detect if network is dropping UDP packets?

On serverside use

iperf3 --server

On client side use

iperf3 --udp --client <server address>

View gist:3923e3aaddb3767928bc972d892b8ab5
ffmpeg -i in.mp4 -vcodec h264_videotoolbox -b:v 5000k out.mp4
ffmpeg -i in.mp4 -vcodec hevc_videotoolbox -b:v 5000k out.mp4
QuynhVir / clearLog.cmd
Created Mar 31, 2020
Clear Windows Event Logs via CMD
View clearLog.cmd
powershell.exe -Command "Get-WinEvent -ListLog * -Force | % { Wevtutil.exe cl $_.LogName }"