Skip to content

Instantly share code, notes, and snippets.

View mariodian's full-sized avatar

Mario Dian mariodian

View GitHub Profile
@mariodian
mariodian / create-unattended-iso.sh
Created July 4, 2017 10:44
Create unattended iso.sh
#!/usr/bin/env bash
# file names & paths
tmp="/tmp" # destination folder to store the final iso file
hostname="ubuntu"
currentuser="$( whoami)"
# define spinner function for slow tasks
# courtesy of http://fitnr.com/showing-a-bash-spinner.html
spinner()
Verifying my Blockstack ID is secured with the address 143u5qs8w6FM13Av93ZGpzcUKWsfDah1sX https://explorer.blockstack.org/address/143u5qs8w6FM13Av93ZGpzcUKWsfDah1sX
@mariodian
mariodian / ob2start.sh
Created June 23, 2017 10:44
OpenBazaar 2.0 startup hack
#!/bin/bash
# Run via cron
# */5 * * * * sh /home/pi/bin/ob2start.sh >/dev/null 2>&1
PID="$(ps aux | grep -i openbazaard.go | grep -v grep | awk {'print $2'})"
if [ -z "$PID" ]; then
go run $GOPATH/src/github.com/OpenBazaar/openbazaar-go/openbazaard.go start
fi
@mariodian
mariodian / electrumx.conf
Created May 16, 2017 02:05
ElectrumX config for Linux
DAEMON_URL = http://<bitcoin.conf rpcuser>:<bitcoin.conf rpcpassowrd>@localhost:8332/
DB_DIRECTORY = /home/bitcoin/.electrumx/
DB_ENGINE = leveldb
USERNAME = bitcoin
ELECTRUMX = /home/bitcoin/source/electrumx/electrumx_server.py
HOST = 0.0.0.0
ANON_LOGS = "fuck off :)"
BANNER_FILE = /home/bitcoin/.electrumx/banner.txt
DONATION_ADDRESS = 1x1UnfVJu7cprs3E2jjQ9WRcdDi5KJxAU
@mariodian
mariodian / gist:3fcf8e3992c2c48c4e26b67ffe5f22d3
Last active November 6, 2018 16:50
ElectrumX ENV Variables
DAEMON_URL = http://<bitcoin.conf rpcuser>:<bitcoin.conf rpcpassowrd>@localhost:8332/
DB_DIRECTORY = /Users/bitcoin/.electrumx/
DB_ENGINE = leveldb
USERNAME = bitcoin
ELECTRUMX = /Users/bitcoin/source/electrumx/electrumx_server
HOST = 0.0.0.0
ANON_LOGS = fuck off :)
BANNER_FILE = /Users/bitcoin/.electrumx/banner.txt
DONATION_ADDRESS = 34ie35p4G1npt6GoXR9BDhmMndNwCsiiEr
@mariodian
mariodian / HD.php
Last active June 25, 2023 17:56
Derive wallet addresses from xpub, ypub and zpub with Bit-Wasp/Bitcoin-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;
#!/bin/sh
# Create log file
LOG="/tmp/ip-check.log"
touch $LOG
IP="$(dig +short myip.opendns.com @resolver1.opendns.com)"
LAST_IP="$(cat $LOG)"
if [ "$IP" != "$LAST_IP" ]; then
[Unit]
Description=NoIP update client
After=network.target
[Service]
Type=forking
User=pi
Group=pi
ExecStart=/usr/local/bin/noip2
@mariodian
mariodian / ob.sh
Last active April 12, 2017 04:57
Handle OB server daemon
#!/bin/bash
ARGS="start -d -a 0.0.0.0"
cd /home/pi/source/OpenBazaar-Server
if [ "$1" = "start" ]; then
echo "OB Server starting..."
rm -rf /tmp/openbazaard.pid
@mariodian
mariodian / openbazaar.service
Created August 31, 2016 17:10
Debian Systemd OpenBazaar Service
# Save as /lib/systemd/system/openbazaar.service
[Unit]
Description=OpenBazaar server
After=network.target auditd.service
[Service]
Type=forking
User=pi
Group=pi
PIDFile=/tmp/openbazaard.pid