Skip to content

Instantly share code, notes, and snippets.

View zautomata's full-sized avatar
🌴
On vacation

zautomata

🌴
On vacation
  • BH, Brazil
View GitHub Profile
@zautomata
zautomata / cloudflare-update-record.sh
Created July 7, 2018 10:45 — forked from benkulbertis/cloudflare-update-record.sh
Cloudflare API v4 Dynamic DNS Update in Bash
#!/bin/bash
# CHANGE THESE
auth_email="user@example.com"
auth_key="c2547eb745079dac9320b638f5e225cf483cc5cfdda41" # found in cloudflare account settings
zone_name="example.com"
record_name="www.example.com"
# MAYBE CHANGE THESE
ip=$(curl -s http://ipv4.icanhazip.com)
@zautomata
zautomata / fdm.conf
Created June 25, 2018 10:03 — forked from kgaughan/fdm.conf
Annotated copy of my .fdm.conf file.
# Constants
$path = "%h/Mail"
# Used for processing mail from Postfix. Here's how we tell Postfix to invoke
# this from main.cf:
#
# mailbox_command = /usr/local/bin/fdm -l -m -astdin fetch
#
account "stdin" disabled stdin
@zautomata
zautomata / tmux.conf
Created May 31, 2018 12:20 — forked from spicycode/tmux.conf
The best and greatest tmux.conf ever
# 0 is too far from ` ;)
set -g base-index 1
# Automatically set window title
set-window-option -g automatic-rename on
set-option -g set-titles on
#set -g default-terminal screen-256color
set -g status-keys vi
set -g history-limit 10000
@zautomata
zautomata / .tmux.conf
Created May 31, 2018 12:15 — forked from lomholdt/.tmux.conf
Add git branch to tmux status bar
set -g status-right '#(cd #{pane_current_path}; git rev-parse --abbrev-ref HEAD)'
@zautomata
zautomata / chroot.txt
Created May 30, 2018 04:13
Creating containers by hand (the hard way)
# List the contents of the current directory
root@host:/# ls
bin dev home lib lost+found mnt proc run srv tmp vagrant vmlinuz
boot etc initrd.img lib64 media opt root sbin sys usr var
# Bind mount 'dev' and 'proc' filesystems from the host
root@host:/# TARGET="/var/some-chroot"
root@host:/# mkdir -p ${TARGET}/{dev,proc,bin,lib,lib64}
root@host:/# mount --bind /dev ${TARGET}/dev
root@host:/# mount --bind /proc ${TARGET}/proc
@zautomata
zautomata / suckless-st-sixel.diff
Created May 5, 2018 10:31 — forked from saitoha/suckless-st-sixel.diff
Add SIXEL graphics support for suckless st. (sixel.c/sixel_hls.c come from mintty, licensed under GPL)
commit ea830e03d4d4562b1ff225940f65bceddd9cad6c
Author: Hayaki Saito <saitoha@me.com>
Date: Sun Jun 11 23:46:45 2017 +0900
Add sixel graphics support
Signed-off-by: Hayaki Saito <saitoha@me.com>
diff --git a/Makefile b/Makefile
index d8595fe..a25d040 100644
@zautomata
zautomata / transmission_remove_finished.sh
Created April 12, 2018 01:18 — forked from pawelszydlo/transmission_remove_finished.sh
Script to clear finished torrents from transmission-daemon
#!/bin/bash
# port, username, password
SERVER="localhost:9091 --auth user:pass"
# use transmission-remote to get torrent list from transmission-remote list
TORRENTLIST=`transmission-remote $SERVER --list | sed -e '1d' -e '$d' | awk '{print $1}' | sed -e 's/[^0-9]*//g'`
# for each torrent in the list
for TORRENTID in $TORRENTLIST
@zautomata
zautomata / Icelandic-Weather-Data-html2csv
Created April 11, 2018 02:00 — forked from gardart/Icelandic-Weather-Data-html2csv
Convert icelandic weather html data (all stations) from html table to csv format - http://brunnur.vedur.is/athuganir/athtafla
# Convert icelandic weather html data (all stations) from html table to csv format
$ curl "http://brunnur.vedur.is/athuganir/athtafla/2015081210.html" 2>/dev/null | grep -i -e '</\?TABLE\|</\?TD\|</\?TR'| tr -d '\n' | sed 's/<\ /TR[^>]*>/\n/Ig' | sed 's/<\/\?\(TABLE\|TR\)[^>]*>//Ig' | sed 's/^<T[DH][^>]*>\|<\/\?T[DH][^>]*>$//Ig' | sed 's/<\/T[DH][^>]*><T[DH][^>]*>/,/Ig' | sed 's/<[^>] \+>//Ig' | sed 's/^[\ \t]*//g' | sed 's/^[\ \t]*//g' | sed '/^\s*$/d' | sed 's/^/2015081210,/'
Output:
2015081210,33751,Siglufjarðarvegur_Herkonugil,-99,6.9,6.9,7.9,80,6.7,7.1,10.2,92,-99
2015081210,33643,Stafá,40,9.3,8.9,9.5,38,4.9,4.9,7.1,79,-99
2015081210,32474,Steingrímsfjarðarheiði,440,4.4,3.9,4.5,65,11.5,11.6,14.2,99,-99
2015081210,31950,Stórholt,70,9.9,9.3,9.9,81,6.7,6.7,8.5,82,-99
@zautomata
zautomata / curl-crawler.sh
Created April 9, 2018 16:21 — forked from oliveratgithub/curl-crawler.sh
Unix Shell-Script to crawl a list of website URLs using curl
#!/bin/sh
timezone="Europe/Zurich"
# List of valid timezones: wikipedia.org/wiki/List_of_tz_database_time_zones
script="${0##*/}"
rootdir=$(cd `dirname "${BASH_SOURCE[0]}"` && pwd)
logfile="$script.log"
log="$rootdir/$logfile"
now=$(TZ=":$timezone" date)
# Uncomment 'mailto=' (remove #) to enable emailing the log upon completion
#mailto="your@email.com"
@zautomata
zautomata / Install Bitcoin on OpenBSD 6.0
Created January 3, 2018 20:43 — forked from desnudopenguino/Install Bitcoin on OpenBSD 6.0
Building/Installing Bitcoin on OpenBSD
0. Make sure some dependencies are installed!
automake (1.15), autoconf (2.69), git, libtool, berkleydb (installed from source 4.8), boost, protobuf, python > 3.5, gmake, leveldb
5.9 guide: https://github.com/bitcoin/bitcoin/blob/master/doc/build-openbsd.md
1. Clone the repo
git clone https://github.com/bitcoin/bitcoin.git
2. Checkout newest stable branch (0.13.0 currently)
git checkout v0.13.0
3. run autogen script
./autogen.sh
Error: Provide an AUTOCONF_VERSION environment variable, please.