Skip to content

Instantly share code, notes, and snippets.

Avatar

Mario Dian mariodian

View GitHub Profile
View zte-sms-control.sh
#!/bin/bash
URL=http://192.168.0.1
REFERER="$URL/index.html"
URL_SET="$URL/goform/goform_set_cmd_process"
URL_GET="$URL/goform/goform_get_cmd_process"
CONTENT_PREVIEW_LENGTH=40
command -v jq >/dev/null 2>&1 || { echo >&2 "'jq' is required but not installed. Aborting."; exit 1; }
@mariodian
mariodian / HD.php
Last active May 18, 2022
Derive wallet addresses from xpub, ypub and zpub with Bit-Wasp/Bitcoin-php
View HD.php
<?php
require_once('vendor/autoload.php');
use BitWasp\Bitcoin\Bitcoin;
use BitWasp\Bitcoin\Address\AddressCreator;
use BitWasp\Bitcoin\Key\Deterministic\HdPrefix\GlobalPrefixConfig;
use BitWasp\Bitcoin\Key\Deterministic\HdPrefix\NetworkConfig;
use BitWasp\Bitcoin\Network\Slip132\BitcoinRegistry;
use BitWasp\Bitcoin\Key\Deterministic\Slip132\Slip132;
View install-lnd.sh
#!/bin/sh
# Get number of cores to speed up the compilation time
CORES=$(( $(lscpu | awk '/^Socket/{ print $2 }') * $(lscpu | awk '/^Core/{ print $4 }') ))
# Other vars
IP=$(dig +short myip.opendns.com @resolver1.opendns.com)
BTC_CONF=~/.bitcoin/bitcoin.conf
LND_DIR=~/.lnd
LND_CONF=lnd.conf
@mariodian
mariodian / zte-sms-forwarder.sh
Last active Feb 10, 2022
ZTE 3G/4G Modem SMS Forwarder
View zte-sms-forwarder.sh
#!/bin/bash
PUSHOVER_TOKEN="<token>"
PUSHOVER_USER="<user>"
# The list of blocked keywords
declare -a BLOCKED=("uber eats" "block another keyword")
URL=http://192.168.0.1
REFERER="$URL/index.html"
URL_SET="$URL/goform/goform_set_cmd_process"
@mariodian
mariodian / nbxplorer.service
Created Nov 8, 2018
NBXplorer Systemd Service
View nbxplorer.service
[Unit]
Description=NBXplorer daemon
Requires=bitcoind.service
After=bitcoind.service
[Service]
ExecStart=/usr/bin/dotnet "/home/satoshi/source/NBXplorer/NBXplorer/bin/Release/netcoreapp2.1/NBXplorer.dll" -c /home/satoshi/.nbxplorer/Main/settings.config
User=satoshi
Group=satoshi
Type=simple
@mariodian
mariodian / pushover
Created Nov 14, 2021
Send pushover notifications
View pushover
#!/bin/bash
TITLE=$1
MESSAGE=$2
PRIORITY=${3:-0}
RETRY=${4:-60}
EXPIRE=${5:-300}
if [ -z "$TITLE" ]; then
echo "No title provided"
@mariodian
mariodian / service_status.sh
Last active Nov 14, 2021
Check status of systemd services
View service_status.sh
#!/bin/bash
URL="https://freedomnode.com/server-maintenance"
if [ "`wget -qO- $URL | sed -e 's/<[^>]*>//g' 2> /dev/null`" != "true" ]; then
SERVICES=(bitcoind lnd monerod btcpayserver nbxplorer thunderhub electrs tor nginx)
TITLE="Services alert!"
MESSAGE=""
for SERVICE in "${SERVICES[@]}"
@mariodian
mariodian / lnd.service
Created Mar 22, 2018
LND Systemd script
View lnd.service
[Unit]
Description=LND Lightning Daemon
Requires=bitcoind.service
After=bitcoind.service
[Service]
ExecStart=/home/satoshi/go/bin/lnd
ExecStop=/home/satoshi/go/bin/lncli stop
PIDFile=/home/satoshi/.lnd/lnd.pid
@mariodian
mariodian / dojo.service
Created Sep 23, 2020
Dojo Systemd Service
View dojo.service
[Unit]
Description=Samourai Dojo
After=bitcoind.service
[Service]
ExecStart=/home/satoshi/bin/dojo start
ExecStop=/home/satoshi/bin/dojo stop
User=satoshi
Group=satoshi
Type=forking
View umbrel-middleware.service
[Unit]
Description=Umbrel Middleware
Requires=lnd.service
Wants=umbrel-manager.service
After=umbrel-manager.service
[Service]
WorkingDirectory=/home/satoshi/source/umbrel/umbrel-middleware
ExecStart=/usr/bin/yarn start
PIDFile=/home/satoshi/.umbrel/umbrel-middleware.pid