Skip to content

Instantly share code, notes, and snippets.

View paulormart's full-sized avatar
🎾

Paulo Martins paulormart

🎾
View GitHub Profile
@paulormart
paulormart / substrate_block_drift_watcher.sh
Last active April 18, 2023 16:04
Substrate Block drift watcher
#!/bin/bash
#
# Bash script to be executed in the remote server to monitor block drift
#
# > Make a file executable
# chmod +x ./substrate_block_drift_watcher.sh
#
# > Positional arguments:
# 1st - blocks threshold
# 2nd - service name
#!/bin/bash
#
# > make a file executable
# chmod +x ./polkadot_node_update.sh
DIRNAME="/polkadot/bin"
FILENAME="$DIRNAME/polkadot"
ARTIFACTS="./artifacts"
if [ ! -d "$ARTIFACTS" ]
#!/bin/bash
#
# > make a file executable
# chmod +x ./polkadot-node-update.sh
DIRNAME="/polkadot/bin"
FILENAME="$DIRNAME/polkadot"
ARTIFACTS="./artifacts"
if [ ! -d "$ARTIFACTS" ]
@paulormart
paulormart / bump-version.sh
Last active April 28, 2021 14:13
Version script for Cargo Rust projects
#!/bin/bash
#
# > make a file executable
# chmod +x ./bump-version.sh
#
# works with a file called VERSION in the current directory,
# the contents of which should be a semantic version number
# such as "v1.2.3"
# this script will display the current version, automatically
@paulormart
paulormart / bump-release.sh
Created October 15, 2019 23:44
Version script
#!/bin/bash
#
# > make a file executable
# chmod +x ./bump-release.sh
#
# works with a file called VERSION in the current directory,
# the contents of which should be a semantic version number
# such as "1.2.3"
# this script will display the current version, automatically
@paulormart
paulormart / bump-staging.sh
Created January 24, 2019 12:31
Version script (develop, staging, master)
#!/bin/bash
#
# > make a file executable
# chmod +x ./bump-staging.sh
#
# works with a file called VERSION in the current directory,
# the contents of which should be a semantic version number
# such as "1.2.3"
# this script will display the current version, automatically

Export without audio and without reencode the file

ffmpeg -i [input_file] -vcodec copy -an [output_file]

Export as mp4 otherwise safari will not be able to stream the file. The qscale 0 directive instructs ffmpeg not to adjust quality of the video during conversion.

ffmpeg -i [input_file.webm] -qscale 0 [output_file.mp4]
@paulormart
paulormart / rinkeby-ethereum-address
Last active October 3, 2017 11:05
Rinkeby Ethereum address
0xBc9070dC52F1E142a9C556E1EB4Dc43636EAABac
@paulormart
paulormart / bump-version.sh
Last active October 15, 2019 23:40
Version script
#!/bin/bash
# credits for https://gist.github.com/pete-otaqui/4188238
#
# > make a file executable
# chmod +x ./bump-version.sh
#
# works with a file called VERSION in the current directory,
# the contents of which should be a semantic version number
# such as "v1.2.3"
@paulormart
paulormart / forwarding-example.md
Created September 21, 2016 21:12 — forked from f1sherman/forwarding-example.md
Port Forwarding Example in OS X El Capitan

Add the following to /etc/pf.anchors/myname:

rdr pass on lo0 inet proto tcp from any to any port 80 -> 127.0.0.1 port 4000
rdr pass on lo0 inet proto tcp from any to any port 443 -> 127.0.0.1 port 4001

Add the following to /etc/pf-myname.conf:

rdr-anchor "forwarding"
load anchor "forwarding" from "/etc/pf.anchors/myname"