Skip to content

Instantly share code, notes, and snippets.

View blizko's full-sized avatar

Arturs Plisko blizko

View GitHub Profile
@blizko
blizko / dns_convert.sh
Created November 2, 2021 03:12
Migrate /etc/hosts to DigitalOcean domain zone
while IFS= read -r i
do
host=$(echo "$i" | awk {'print $2'} | sed -e "s/.$DOMAIN//");
ip=$(echo "$i" | awk {'print $1'});
payload="{\"type\":\"A\",\"name\":\"$host\",\"data\":\"$ip\",\"priority\":null,\"port\":null,\"ttl\":3600,\"weight\":null,\"flags\":null,\"tag\":null}"
curl -X POST \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $DIGITALOCEAN_TOKEN" \
-d "$payload" \
"https://api.digitalocean.com/v2/domains/$DOMAIN/records"
@blizko
blizko / emercoin-raspberry.txt
Created May 10, 2018 16:44
Emercoin ARM Raspbery PI Build
# Get the latest Jessie Image (http://downloads.raspberrypi.org/raspbian_lite/images/raspbian_lite-2017-07-05/2017-07-05-raspbian-jessie-lite.zip)
# Stretch images could fail and require additional magic. At time of writing Emercoind didn't like the default libboost and libssl-dev versions that come in Stretch.
# Check for more - http://downloads.raspberrypi.org/raspbian_lite/images/
# Install System to SD Card
# There could be issues with boot. Check link - https://www.raspberrypi.org/forums/viewtopic.php?t=138163
git clone https://github.com/raspberrypi/firmware --depth=1
# Replace all boot partition contents.
# On successfull boot on the RPI:
@blizko
blizko / emercoin-openwrt-cross.txt
Created May 10, 2018 16:33
Emercoin OpenWRT Cross-Compile Build
# Before Build - check Endianness of your target system. Haven't managed to get it working on Big-Endian with TP-Link TL1043-ND (Some notes in code have clues that it is not possible)
# As from https://github.com/corsis/PortFusion/wiki/MIPS-Builds
$ echo -n I | hexdump -o | awk '{ print substr($2,6,1); exit}'
# 0 = big-endian
# 1 = little-endian
apt-get install build-essential ncurses-dev unzip python zlib1g-dev autoconf libtool pkg-config libssl-dev subversion
# Idea Source - http://telecnatron.com/articles/Cross-Compiling-For-OpenWRT-On-Linux/index.html