Skip to content

Instantly share code, notes, and snippets.

View by-nari's full-sized avatar
🏠
Working from home

Nari by-nari

🏠
Working from home
  • Midgard
View GitHub Profile
@by-nari
by-nari / README.md
Created April 3, 2021 06:03 — forked from tombigel/README.md
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 https://docs.basho.com/riak/kv/2.1.4/using/performance/open-files-limit/#mac-os-x

The last time i visited this link it was dead (403), so I cloned it here from the latest snapshot in Archive.org's Wayback Machine https://web.archive.org/web/20170523131633/https://docs.basho.com/riak/kv/2.1.4/using/performance/open-files-limit/

Mac OS X

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

@by-nari
by-nari / genEdDSA.sh
Created February 20, 2021 08:50
generate EdDSA keypair for JWT
openssl genpkey -algorithm ed25519 -out private.pem
openssl pkey -in private.pem -pubout
@by-nari
by-nari / fix.sh
Created January 26, 2021 16:41
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
@by-nari
by-nari / keys.sh
Created October 1, 2020 16:19
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
fetch
quit
# Create a stub for the secret key in your keychain
gpg --card-status
# Use the (secret) key as if it was in your keychain
@by-nari
by-nari / AdbCommands
Created August 27, 2020 01:54 — forked from Pulimet/AdbCommands
Adb useful commands list
adb help // List all comands
== Adb Server
adb kill-server
adb start-server
== Adb Reboot
adb reboot
adb reboot recovery
adb reboot-bootloader
@by-nari
by-nari / filters.txt
Last active March 26, 2022 18:00
my own uBlock Origin filters
! Remove Facebook sponsored posts
!facebook.com##div[data-pagelet^="FeedUnit"]:has(a[role^=button]:has(> span > span:matches-css(position: relative):has-text(S)))
!facebook.com##div[data-pagelet^="FeedUnit"]:has(div[role^=button]:has(> span > span:matches-css(position: relative):has-text(S)))
!facebook.com##div[data-pagelet^="FeedUnit"]:has(a[aria-label="Sponsored"])
facebook.com##div[role="feed"] div > span > span > a > span:upward(div[role="feed"] > div)
! Remove Facebook "Suggested for You"
!facebook.com##div[data-pagelet^="FeedUnit"]:has(div[role="article"]:has(span > span > span:has-text(Suggested for You)))
! Remove Facebook "New Message"
facebook.com##span:has(div[aria-label="New Message"])
! Remove Facebook "Create Room"
@by-nari
by-nari / README.md
Created May 24, 2020 16:33
How to detect if network is dropping UDP packets?

On serverside use

iperf3 --server

On client side use

iperf3 --udp --client

ffmpeg -i in.mp4 -vcodec h264_videotoolbox -b:v 5000k out.mp4
ffmpeg -i in.mp4 -vcodec hevc_videotoolbox -b:v 5000k out.mp4
@by-nari
by-nari / clearLog.cmd
Created March 31, 2020 03:06
Clear Windows Event Logs via CMD
powershell.exe -Command "Get-WinEvent -ListLog * -Force | % { Wevtutil.exe cl $_.LogName }"
@by-nari
by-nari / ffmpeg.md
Last active April 30, 2021 05:40
FFmpeg cheat sheet

Basic conversion

ffmpeg -i in.mp4 out.avi

Merging video and audio, without re-encoding

ffmpeg -i video.mp4 -i audio.wav -c:v copy -c:a copy output.mp4