Skip to content

Instantly share code, notes, and snippets.

Avatar

Danilo Araújo Silva Danilo-Araujo-Silva

View GitHub Profile
@Danilo-Araujo-Silva
Danilo-Araujo-Silva / Tutorial.md
Last active Apr 27, 2021
full configuration for bitcoind with regtest and docker
View Tutorial.md

01- Create two different docker containers (there are bitcoin.conf examples below) bitcoind-regtest-01 and bitcoind-regtest-02 pointing to different data folders (The regtest network will only work with at least 2 nodes).

  • bitcoind -conf=/path/to/bitcoind-regtest-01/bitcoin.conf -datadir=/path/to/bitcoind-regtest-01/data/folder -daemon
  • bitcoind -conf=/path/to/bitcoind-regtest-02/bitcoin.conf -datadir=/path/to/bitcoind-regtest-02/data/folder -daemon

02- Create a docker network with the 2 containers

  • docker network create bitcoind-regtest-network
  • docker network connect bitcoind-regtest-network bitcoind-regtest-01
  • docker network connect bitcoind-regtest-network bitcoind-regtest-02
@Danilo-Araujo-Silva
Danilo-Araujo-Silva / tree.sh
Last active Apr 26, 2021
tree command, only folders, human readable format, easy way to find large folders
View tree.sh
# Command:
sudo tree --du -ahF /path/to/folder | grep "\(files\|/\)$"
# Example from a fresh google colab opt folder:
# Command: !sudo tree --du -ahF /opt | grep "\(files\|/\)$"
# Output:
@Danilo-Araujo-Silva
Danilo-Araujo-Silva / Dockerfile
Last active Apr 22, 2021
Bitcoind with Tor network - Simple and customisable Dockerfile
View Dockerfile
# Usage:
# useradd -r bitcoind
# docker builx build --no-cache -t bitcoind --platform linux/amd64 --build-arg USER_ID=$( id -u bitcoind ) --build-arg GROUP_ID=$( id -g bitcoind ) .
# docker run -dt --name=bitcoind bitcoind -v /path/to/bitcoin/volume/folder:/media/bitcoin
#
FROM ubuntu:latest
RUN apt update \
&& apt install -y --no-install-recommends \
View echo.sh
#!/bin/bash
#echo $@
# store arguments in a special array
args=("$@")
# get number of elements
ELEMENTS=${#args[@]}
@Danilo-Araujo-Silva
Danilo-Araujo-Silva / mathemagika.kts
Last active Jun 17, 2020
Mathemagika Demonstration Kotlin KTS Script
View mathemagika.kts
@file:MavenRepository("mathemagika", "https://dl.bintray.com/danilo-araujo-silva/mathemagika" )
@file:DependsOnMaven("com.daniloaraujosilva:mathemagika:1.0.0")
println(zeta(2))
@Danilo-Araujo-Silva
Danilo-Araujo-Silva / kotlin_keywords_and_symbols.kt
Created Jun 10, 2020
All Kotlin Keyworkds and Symbols in a MutableMap
View kotlin_keywords_and_symbols.kt
val kotlinKeywordsAndSymbols =
mutableListOf(
"as",
"as?",
"break",
"class",
"continue",
"do",
"else",
"false",
View FunctionLambdaCompositionInKotlin.kt
infix fun <A, B, C> ((A) -> B).andThen(g: (B) -> C): (A) -> C = { a: A -> g(this(a)) }
val c = a andThen b
@Danilo-Araujo-Silva
Danilo-Araujo-Silva / Allowed characters in Kotlin backticks.md
Last active Jul 28, 2020
Allowed characters in Kotlin backticks
View Allowed characters in Kotlin backticks.md

Allowed characters in Kotlin backticks

Some allowed characters are

val ` -!"#$%^&()*+,-=?@^_{|}~😡` = ""

Yes, that's write, emojis are allowed too =)

Some not allowed characters are

We couldn’t find that file to show.
@Danilo-Araujo-Silva
Danilo-Araujo-Silva / Vee Validate - Validating Child components
Last active Nov 13, 2020
A strategy to validate child components with Vue and Vee Validate.
View Vee Validate - Validating Child components
// Somewhere in the initialization:
import VeeValidate from "vee-validate";
Vue.use(VeeValidate);
// Then, in the parent component:
export default {
provide () {
return { parentValidator: this.$validator }
},