Skip to content

Instantly share code, notes, and snippets.

View majal's full-sized avatar
👫
Living and loving life with my lovely wife. :-)

Majal majal

👫
Living and loving life with my lovely wife. :-)
View GitHub Profile
@majal
majal / minterpolate
Last active May 26, 2024 21:39 — forked from sgqy/minterpolate.sh
Multi-threaded minterpolate in ffmpeg
#!/bin/bash
# Multicore minterpolate in ffmpeg
# Just slice & process & concat
# NB: The concat points between slices may be weird
# Default arguments
ff=/usr/bin/ffmpeg
fps=60
dur=00:00:10
@majal
majal / AuthyToOtherAuthenticator.md
Created December 21, 2022 04:12 — forked from gboudreau/AuthyToOtherAuthenticator.md
Export TOTP tokens from Authy

Generating Authy passwords on other authenticators


There is an increasing count of applications which use Authy for two-factor authentication. However many users who aren't using Authy, have their own authenticator setup up already and do not wish to use two applications for generating passwords.

Since I use 1Password for all of my password storing/generating needs, I was looking for a solution to use Authy passwords on that. I couldn't find any completely working solutions, however I stumbled upon a gist by Brian Hartvigsen. His post had a neat code with it to generate QR codes for you to use on your favorite authenticator.

His method is to extract the secret keys using Authy's Google Chrome app via Developer Tools. If this was not possible, I guess people would be reverse engineering the Android app or something like that. But when I tried that code, nothing appeared on the screen. My guess is that Brian used the

@majal
majal / majcertikupgrade
Last active September 22, 2020 23:09
Bash script for certikd upgrade
#!/bin/bash
# https://www.majlovesreg.one/tag/code/
height=224300
cdir='/home/majlovesreg/certik' # change to match your user directory
newv="${cdir}/v0.13.4-shentu-rts-broken" # the binaries should have been downloaded in advance to this directory
confdir='/home/majlovesreg/.certikd/config' # change to match your user directory
clidir='/home/majlovesreg/.certikcli/config' # change to match your user directory
oldchain='shentu-rts'
@majal
majal / majnearmonitor
Created September 16, 2020 05:35
NEAR Node Monitoring and Dynamic Staking (NEAR Stake Wars II Challenges 003 and 004)
#!/bin/bash
# https://www.majlovesreg.one/tag/code/
# Made for betanet, can be edited for other networks
instances=$(pgrep -xc $(basename "$0"))
[ "${instances}" ] && [ ${instances} -gt 1 ] && { echo "Multiple instances found, exiting..."; exit 0; }
source $HOME/.profile
export NVM_DIR="$HOME/.nvm"
@majal
majal / majnearup
Last active September 16, 2020 05:22
Upgrade and monitoring Bash script for running a NEAR Node (NEAR Stake Wars II Challenge 005)
#!/bin/bash
# https://www.majlovesreg.one/tag/code/
# Made for betanet, can be edited for other networks
instances=$(pgrep -xc $(basename "$0"))
[ "${instances}" ] && [ ${instances} -gt 1 ] && { echo "Multiple instances found, exiting..."; exit 0; }
source $HOME/.profile
export NVM_DIR="$HOME/.nvm"

Keybase proof

I hereby claim:

  • I am majal on github.

  • I am majal (https://keybase.io/majal) on keybase.

  • I have a public key ASCiOS7PtuG9fxXfkHZxD5vU7VTnTNATxqGB0lH9bbgulgo

@majal
majal / mkbrotli
Last active October 27, 2020 08:12
Bash script for automating dynamic module creation and installation of Brotli on NGINX.
#!/bin/bash
# https://www.majlovesreg.one/tag/code/
# https://www.majlovesreg.one/adding-brotli-to-a-running-nginx-instance
# For custom NGINX version, use:
# ngver=1.14.2
# For automated detection of installed NGINX, use:
ngver=$(nginx -v 2>&1 | grep -oP '(?<=/).*')
@majal
majal / vboxsign
Last active May 26, 2019 10:13
This script automates signing of virtualbox modules every time virtualbox-dkms upgrades. Useful when using these kernel modules while keeping secure boot.
#!/bin/bash
# Sign and load VirtualBox modules
# https://www.majlovesreg.one/tag/code/
# https://www.majlovesreg.one/thoughts/sign-virtualbox-on-ubuntu-16-04-with-secure-boot-enabled/
# Run as root
[ "`whoami`" = root ] || exec sudo "$0" "$@"
# Set working directory
dir=/home/directory/of/keys
@majal
majal / pdfra
Last active November 12, 2020 20:27 — forked from stefanschmidt/remove-annotations.sh
Remove all annotations from a PDF document
#!/bin/bash
[[ -z "$1" ]] && echo "Please enter a filename. Exiting..."
[[ -z "$1" ]] && exit 1
echo
printf "Stripping annotations from $1... "
pdftk "$1" output "/tmp/$1 - uncompressed.pdf" uncompress
LANG=C sed -n '/^\/Annots/!p' "/tmp/$1 - uncompressed.pdf" > "/tmp/$1 - stripped.pdf"