Skip to content

Instantly share code, notes, and snippets.

View Stadicus's full-sized avatar

Stadicus Stadicus

View GitHub Profile
@Stadicus
Stadicus / systemd-sendmail@.service
Created March 9, 2018 13:33
Thundroid: email alerting systemd unit
[Unit]
Description=Systemd Unit Mailer
After=network.target
[Service]
Type=simple
ExecStart=/usr/local/bin/systemd-sendmail.sh %i "Hostname: %H" "Machine ID: %m" "Boot ID: %b"
#!/bin/bash
# part of Thundroid setup
# copy to /usr/local/bin/systemd-statusmail.sh
# make executable with: sudo chmod +x /usr/local/bin/systemd-statusmail.sh
MAILTO="youremail@domain.com"
MAILFROM="serviceuser@gmail.com"
UNIT=$1
UNITSTATUS=$(systemctl status $UNIT)
@Stadicus
Stadicus / sendmail.mc
Created March 8, 2018 09:03
Thundroid: insert into sendmail.mc above first "MAILER" line
define(`SMART_HOST',`[smtp.gmail.com]')dnl
define(`RELAY_MAILER_ARGS', `TCP $h 587')dnl
define(`ESMTP_MAILER_ARGS', `TCP $h 587')dnl
define(`confAUTH_OPTIONS', `A p')dnl
TRUST_AUTH_MECH(`EXTERNAL DIGEST-MD5 CRAM-MD5 LOGIN PLAIN')dnl
define(`confAUTH_MECHANISMS', `EXTERNAL GSSAPI DIGEST-MD5 CRAM-MD5 LOGIN PLAIN')dnl
FEATURE(`authinfo',`hash -o /etc/mail/authinfo/gmail-auth.db')dnl
@Stadicus
Stadicus / 20-thundroid-welcome
Last active November 21, 2021 12:36
Thundroid: System overview MotD
#!/bin/sh
# by Stadicus
# make executable and copy script to /etc/update-motd.d/
# root must be able to execute bitcoin-cli and lncli
# set colors
color_red='\033[0;31m'
color_green='\033[0;32m'
color_yellow='\033[0;33m'
color_gray='\033[0;37m'
@Stadicus
Stadicus / torrc
Last active March 8, 2018 08:30
Thundroid: Tor configuration
RunAsDaemon 1
PortForwarding 1
ControlPort 9051
CookieAuthentication 1
CookieAuthFileGroupReadable 1
MaxMemInQueues 256MB
Log notice file /var/log/tor/notices.log
@Stadicus
Stadicus / bitcoin.conf
Last active March 8, 2018 08:31
Thundroid testnet: bitcoin.conf for Bitcoin Node with Lightning
# Example bitcoin.conf for Thundroid
server=1
daemon=1
testnet=1
txindex=1
# Connection settings
#externalip=111.222.333.444 # to announce fixed ip
#port=12345 # for non-standard port
rpcuser=bitcoin
@Stadicus
Stadicus / .bashrc
Last active February 25, 2018 10:14
Pimp your bitcoin prompt
# enable color prompt (uncomment)
force_color_prompt=yes
# pimp prompt (replace the PS1 line), use only one yellow OR red, not both.
# yellow user
PS1="${debian_chroot:+($debian_chroot)}\[\e[33m\]\u \[\033[01;34m\]\w\[\e[33;40m\] ฿\[\e[m\] "
# red user
PS1="${debian_chroot:+($debian_chroot)}\[\e[31m\]\u \[\033[01;34m\]\w\[\e[33;40m\] ฿\[\e[m\] "
# set "ls" to always use the -la option
@Stadicus
Stadicus / lnd.service
Last active January 23, 2023 07:50
systemd service for LND Lightning Daemon
[Unit]
Description=LND Lightning Daemon
Requires=bitcoind.service
After=getpublicip.service
After=bitcoind.service
# for use with sendmail alert
#OnFailure=systemd-sendmail@%n
[Service]
@Stadicus
Stadicus / lnd.conf
Last active June 22, 2021 13:23
lnd.conf for Raspberry Pi
[Application Options]
debuglevel=debug
debughtlc=true
maxpendingchannels=5
alias=YOUR_NAME [LND]
color=#68F442
# for fixed ip allocation with custom port
#externalip=111.222.333.444:19735
#listen=0.0.0.0:19735
@Stadicus
Stadicus / 20-raspberry-bitcoin
Last active February 23, 2018 21:35
bash welcome script for RaspiBolt
#!/bin/sh
# original script by Damian Mee https://github.com/meeDamian
# copy script to /etc/update-motd.d/
# set colors
color_red='\033[0;31m'
color_green='\033[0;32m'
color_yellow='\033[0;33m'
color_gray='\033[0;37m'
color_darkgray='\033[1;30m'