Skip to content

Instantly share code, notes, and snippets.

View tommyv1987's full-sized avatar

Tommy Verrall tommyv1987

View GitHub Profile
@tommyv1987
tommyv1987 / nym_network_diagnostics.sh
Last active April 11, 2024 12:02
A diagnostic of network configurations and connectivity issues for Gateway operators including IPv4/IPv6 forwarding status, firewall rules inspection, routing table examination
#!/bin/bash
echo "---------------------------------------"
echo
echo "checking IPv4 forwarding status..."
cat /proc/sys/net/ipv4/ip_forward
echo "---------------------------------------"
echo
echo "checking IPv6 forwarding status..."
@tommyv1987
tommyv1987 / network_tunnel_manager.sh
Last active April 25, 2024 09:11
networking tunnel manager for nym gateways
#!/bin/bash
network_device=$(ip route show default | awk '/default/ {print $5}')
tunnel_interface="nymtun0"
if ! dpkg -s iptables-persistent >/dev/null 2>&1; then
sudo apt-get update
sudo apt-get install -y iptables-persistent
else
echo "iptables-persistent is already installed."
@tommyv1987
tommyv1987 / node_cpu_usage.sh
Last active March 13, 2024 13:07
Nym-node CPU cron service
#!/bin/bash
# -----------------------------------------
# this script is designed to monitor the load on your mixnode or gateway
# whilst there's plenty of ways to do this, this is a simple cron service that polls the nym binary every minute to check CPU
# you can amend this script on your own accord to do what you need with the results
# in the interim this will write to a simple log file
# -----------------------------------------
# add to your crontab -e
# chmod +x node_cpu_usage.sh
@tommyv1987
tommyv1987 / node_signature_executor.sh
Created March 7, 2024 09:27
Provide a Signature using a Mixnode or Gateway
#!/bin/bash
echo "do you want to sign a message with a mixnode or a gateway? enter 'mixnode' or 'gateway':"
read NODE_TYPE
case $NODE_TYPE in
mixnode)
NODE_TYPE="mixnode"
CONFIG_PATH_NODE="mixnodes"
;;
@tommyv1987
tommyv1987 / execute-nym-vpn-cli-binary.sh
Last active March 25, 2024 11:52
Run the NYM VPN CLI binary
#!/bin/bash
echo "welcome to the nym-cli installation"
echo
release_url="https://api.github.com/repos/nymtech/nym-vpn-client/releases"
current_file_version=$(curl -s $release_url | jq -r '.[].tag_name' | grep '^nym-vpn-cli-v' | sort -Vr | head -n 1 | awk -F'-v' '{print $NF}')
linux_cli="nym-vpn-cli_${current_file_version}_ubuntu-22.04_amd64.tar.gz"
mac_cli="nym-vpn-cli_${current_file_version}_macos_universal.tar.gz"
download_page="https://github.com/nymtech/nym-vpn-client/releases/tag/nym-vpn-cli-v${current_file_version}"
sandbox_env_url="https://raw.githubusercontent.com/nymtech/nym/develop/envs/sandbox.env"
@tommyv1987
tommyv1987 / nym-vpn-client-install-run.sh
Last active March 27, 2024 16:40
Run the nym-vpn-client for MacOs or Linux
#!/bin/bash
echo "welcome to the NYM client installation"
echo "this will now use the NYX mainnet network"
echo "enjoy"
release_url="https://api.github.com/repos/nymtech/nym-vpn-client/releases"
version=$(curl -s $release_url | jq -r '.[].tag_name' | grep '^nym-vpn-desktop-v' | sort -Vr | head -n 1 | awk -F'-v' '{print $NF}')
mac_file="nym-vpn-desktop_${version}_macos_universal"
linux_file="nym-vpn-desktop_${version}_ubuntu-22.04_x86_64"
@tommyv1987
tommyv1987 / upgrade_binaries.sh
Last active November 29, 2023 15:16
Update your Nym Binaries
#!/bin/bash
set -x
if [[ $EUID -ne 0 ]]; then
echo "you need to root :)"
exit 1
fi
read -rp "enter the service file to stop (e.g., nym-mixnode.service): " SERVICE_NAME

Keybase proof

I hereby claim:

  • I am tommyv1987 on github.
  • I am tommyvez (https://keybase.io/tommyvez) on keybase.
  • I have a public key ASDP3H1LUBJD6gH9BRbpuI8cFzNcfFL10cXFT9Qg8yw1lQo

To claim this, I am signing this object: