Skip to content

Instantly share code, notes, and snippets.


Miguel Mota miguelmota

View GitHub Profile
miguelmota / prompt_password.js
Created Apr 9, 2021
Node.js CLI prompt password with hidden input
View prompt_password.js
const prompt = require('prompt)
async function promptPassword () {
prompt.message = ''
prompt.delimiter = ':'
const { password } = await prompt.get({
properties: {
password: {
message: 'password',
miguelmota /
Last active Apr 7, 2021
Linux file audit to detect file changes using auditd, auditctl, ausearch. This can be used to get PID unlike inotify
touch hello.txt
sudo auditd
sudo auditctl -w $PWD/hello.txt -p warx -k hello-file
echo 'hello world' > hello.txt
sudo ausearch -k hello-file
miguelmota /
Created Apr 7, 2021
Linux monitor file open/close events using inotify-tools
inotifywatch -v file.txt
miguelmota /
Created Apr 6, 2021
macOS bell sound notification ping alert
afplay /System/Library/Sounds/Ping.aiff
miguelmota /
Created Mar 26, 2021
SSH generate sha256 fingerprint of public key using ssh-keygen
ssh-keygen -lf ~/.ssh/ -E sha256
# output:
# 3072 SHA256:dxQGxpXYbvfa6mk2I3XC17aT3jh6gbF7YPsOwusHGpU user@linux (RSA)
miguelmota /
Created Mar 25, 2021
Google sheets import JSON script
* Imports JSON data to your spreadsheet
* @param url URL of your JSON data as string
* @param xpath simplified xpath as string
* @customfunction
function ImportJSON(url, xpath) {
try {
// /rates/EUR
var res = UrlFetchApp.fetch(url);
miguelmota / pass.txt
Created Mar 23, 2021
Arch linux PrivateInternetAccess (PIA) OpenVPN VPN setup
View pass.txt
miguelmota /
Created Mar 23, 2021
Arch linux transmission bittorrent daemon terminal cli webui
yay -S transmission-cli
# start daemon with config overrides
transmission-daemon --auth --username arch --password linux --port 9091 --allowed ",192.168.*.*"
# webui
# settings config
vim ~/.config/transmission-daemon/settings.json
miguelmota / notes.txt
Created Mar 19, 2021
DeFi reading notes
View notes.txt
Saddle finance
- AMM for pegged tokens like bitcoin and stablecoins
- created by tBTC venture studio
- based on StableSwap curve whitepaper
miguelmota /
Created Mar 17, 2021
Keybase github setup gpg keys for verified commits
keybase pgp export | gpg --import
keybase pgp export --secret | gpg --allow-secret-key --import
gpg --list-secret-keys
gpg --edit-key <key-id>
> trust
> 5 (trust ultimately)
git config --global user.signingKey <key-id>
git config --global commit.gpgsign true
gpg --armor --export <key-id>