Skip to content

Instantly share code, notes, and snippets.

View openoms's full-sized avatar
🏗️
building

openoms openoms

🏗️
building
View GitHub Profile
@openoms
openoms / initial-setup.sh
Created January 16, 2020 06:11 — forked from CandleHater/initial-setup.sh
Initial setup on Debian (incl. Raspbian)
#!/bin/bash
# bash <(curl -s https://gist.githubusercontent.com/CandleHater/c36f8c205b31f70081d9e821bde36ebb/raw/initial-setup.sh)
clear
# show system info
echo "- system"
echo -e "Kernel\t: $(uname -rvm)"
cat /proc/cpuinfo | grep "model name" | sed "s/model name/CPU/g"
@openoms
openoms / 0-hidden-service-subdomains.md
Created June 11, 2019 10:53 — forked from mtigas/0-hidden-service-subdomains.md
Example code for running a (HTTP/HTTPS) Tor hidden service supporting subdomains.

The following files show an example of how to create subdomains for onion site hidden services. (This hasn't been tested for hidden services for anything other than HTTP/HTTPS.)

(You might also want to read our blog post about ProPublica’s Tor hidden service, including a tutorial and notes on running a hidden service: https://www.propublica.org/nerds/item/a-more-secure-and-anonymous-propublica-using-tor-hidden-services )

In general, this works (maybe just in recent Tor clients) because Tor will handle the connection to www.xxxxxxxxxxxxxxxx.onion as a connection to xxxxxxxxxxxxxxxx.onion. The encapsulated HTTP/HTTPS connection contains the subdomain in the Host: header (and in the case of HTTPS, the SNI

## Getting LND working with Dojo
## Start Dojo
$ cd /path/to/docker/my-dojo/ && sudo ./dojo.sh start
## Login to the bitcoind docker container as root
$ sudo docker exec -u root -it bitcoind /bin/bash
## Update and install a text editor
$ apt-get update && apt-get install nano
#### Copy over block data to your Dojo ####
## On your machine running Dojo, open 2 terminals, we'll call them [terminal A] & [terminal Doc]
## In [terminal Doc] login to the bitcoind docker container as root
$ sudo docker exec -u root -it bitcoind /bin/bash
## [terminal Doc] Update and install a text editor
$ apt-get update && apt-get install nano
@openoms
openoms / electrs on dojo
Created June 10, 2019 13:10 — forked from Engelberg/electrs on dojo
Installing local electrum server that relies on the bitcoin daemon inside of Samourai Dojo for its data
I am successfully running a local electrum server, getting its data from dojo. This is useful for private use of hardware wallets.
Step 1: As Laurent MT suggested in the Samourai telegram group, you need to edit the docker-compose.yaml file, adding to the bitcoind section the following two lines
ports:
- "127.0.0.1:28256:28256"
Step 2: Follow install directions for electrs, an electrum server written in rust.
electrs install directions can be found here: https://github.com/romanz/electrs/blob/master/doc/usage.md
###### User friendly interface script for use with ./dojo [command] ######
I set it up to be used with passwordless root login via ssh, as you need to be root to utilize
the ./dojo [commands], also because I run everything headless from my laptop. This may not be
for you if you don't want to permit root login to the machine running your Dojo. I have my VMs
set up with passwordless pubkeys and UFW so that my host machine is the only one that can login
to the VMs via ssh. It is somewhat of a security risk if you do not structure yourself properly,
so please be cautious.
At the end of the script there is haggard documentation on how to setup ssh pubkeys.
@openoms
openoms / patch.txt
Created June 2, 2019 04:53
LND patch
diff --git a/channeldb/graph.go b/channeldb/graph.go
index eaf3503c..9edd2955 100644
--- a/channeldb/graph.go
+++ b/channeldb/graph.go
@@ -3025,7 +3025,8 @@ func (c *ChannelGraph) ChannelView() ([]EdgePoint, error) {
edgeIndex, chanID,
)
if err != nil {
- return err
+ return fmt.Errorf("failed fetching edge info "+
@openoms
openoms / config.display.sh
Last active May 15, 2019 10:11
Display config on the RaspiBlitz
# To run this script on your RaspiBlitz, copy the following line to the ssh terminal (after the #):
# wget hhttps://raw.githubusercontent.com/rootzoll/raspiblitz/master/alternative.platforms/dietpi/dietpi.display.sh && sudo chmod +x dietpi.display.sh && ./dietpi.display.sh
echo "Detect Base Image ..."
baseImage="?"
isDietPi=$(uname -n | grep -c 'DietPi')
isRaspbian=$(cat /etc/os-release 2>/dev/null | grep -c 'Raspbian')
isArmbian=$(cat /etc/os-release 2>/dev/null | grep -c 'Debian')
isUbuntu=$(cat /etc/os-release 2>/dev/null | grep -c 'Ubuntu')
if [ ${isRaspbian} -gt 0 ]; then
#!/bin/bash
# from this comment https://github.com/bamarni/pi64/issues/4#issuecomment-292707581
echo -e "To stop simply press [ctrl]-[c]\n"
Maxfreq=$(( $(awk '{printf ("%0.0f",$1/1000); }' </sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq) -15 ))
while true ; do
# Health=$(perl -e "printf \"%19b\n\", $(vcgencmd get_throttled | cut -f2 -d=)")
Temp=$(vcgencmd measure_temp | cut -f2 -d=)
RealClockspeed=$(vcgencmd measure_clock arm | awk -F"=" '{printf ("%0.0f",$2/1000000); }' )
@openoms
openoms / dietpi-automation_custom_script.log
Created March 27, 2019 09:24
RaspiBlitz build_sdcard.sh output v.1.1 on DietPi
root@DietPi:~# tail -n1000 -f /var/tmp/dietpi/logs/dietpi-automation_custom_script.log
*****************************************
* RASPIBLITZ SD CARD IMAGE SETUP v1.1 *
*****************************************
*** CHECK INPUT PARAMETERS ***
will use code from branch --> 'DietPi-dev'
*** CHECK INPUT PARAMETERS ***
will use code from user --> 'openoms'