Skip to content

Instantly share code, notes, and snippets.

Avatar

Erik Gelderblom ErikFontanel

View GitHub Profile
@ErikFontanel
ErikFontanel / README.md
Created Nov 24, 2018
Fysetc F6 v1.3 platform.io configuration
View README.md

Fysetc F6 v1.3 for platform.io

Instructions for compiling Marlin for the Fysetc F6 using Platform.io and VSCode or Atom.

Add a new custom board to Platform.io

  1. Add fysetcf6_13.json to the platformio boards directory ~/.platformio/boards in your home folder.
@ErikFontanel
ErikFontanel / docker.zsh
Created Aug 31, 2018
Start docker daemon if it's not already when docker-compose up is ran
View docker.zsh
#!/bin/bash
# spinner
# @see https://stackoverflow.com/questions/238073/how-to-add-a-progress-bar-to-a-shell-script
sp="/-\|"
sc=0
spin() {
printf "\b${sp:sc++:1}"
((sc==${#sp})) && sc=0
}
@ErikFontanel
ErikFontanel / firewall-start.sh
Last active Jul 31, 2018
Block Google DNS on R7800
View firewall-start.sh
#!/bin/sh
# Use together with Voxel Firmware
# Symlink this file from optware root to /root/firewall-start.sh
# Make script executable with chmod +x
#
# More info: https://www.reddit.com/r/pihole/comments/930g2z/psa_google_services_including_ads_and_others_try/
iptables -t nat -I PREROUTING -i br0 ! -s 192.168.1.13 -p tcp --dport 53 -j DNAT --to 192.168.1.13
iptables -t nat -I PREROUTING -i br0 ! -s 192.168.1.13 -p udp --dport 53 -j DNAT --to 192.168.1.13
@ErikFontanel
ErikFontanel / README.md
Last active Sep 5, 2021
Firefly backup and restore scripts
View README.md

firefly-backup

This script automatically creates a tar.gz archive of the firefly database and copies it to a secure offsite location.

It does NOT save the encryption key. Store that somewhere else securely (e.g. password manager).

I have firefly-backup running via a daily cronjob.

firefly-restore

This restores a .tar.gz backup of the firefly database to a docker volume. The script takes the filename of the backup as an argument and assumes a static location where those files are found.

@ErikFontanel
ErikFontanel / filter-youtube-domains.sh
Last active Jan 18, 2023
Pi-hole Youtube ad blocking
View filter-youtube-domains.sh
#!/bin/sh
# This script will fetch the Googlevideo ad domains and append them to the Pi-hole block list.
# Run this script daily with a cron job (don't forget to chmod +x)
# More info here: https://discourse.pi-hole.net/t/how-do-i-block-ads-on-youtube/253/136
# File to store the YT ad domains
FILE=/etc/pihole/youtube.hosts
# Fetch the list of domains, remove the ip's and save them
curl 'https://api.hackertarget.com/hostsearch/?q=googlevideo.com' \
@ErikFontanel
ErikFontanel / apfd.conf
Last active Jan 4, 2020
Time Capsule on optware
View apfd.conf
;
; Netatalk 3.x configuration file
;
[Global]
; Global server settings
; Inspiration and background:
; http://blog.khubla.com/freebsd/time-machine-backups-using-freebsd-zfs
;
; create group tmusers, add users
@ErikFontanel
ErikFontanel / instructions.md
Last active Jan 9, 2020
run jottacloud-command-line-tool on busybox/optware
View instructions.md
  1. Install ca-bundle opkg update && opkg install ca-bundle if not already installed for https
  2. Download the binary from https://repo.jotta.us/archives/linux/ and untar in /opt/jotta-cli
  3. cd into the jotta-cli dir
  4. Modify source=/usr/share/jottad to source="/opt/usr/share/jottad" /in ./usr/share/jottad/install.sh
  5. run ./usr/share/jottad/install.sh and ./usr/share/jottad/install-path.sh
  6. modify group=jottad to group=tmusers and add umask=0002 in /etc/init.d/jottad
  7. create the jottad data directory mkdir -p /opt/.jottad
  8. Start jottad with start-stop-daemon -b -x /opt/bin/jottad slow lowmem datadir /opt/.jottad -S (add this to /etc/rc.local to start automatically)
  9. Login jotta-cli login
@ErikFontanel
ErikFontanel / karabiner.json
Last active Oct 20, 2017
Varmilo VA68 Mac keyboard layout. Sets the command, option and control keys in the right place. Changes insert to home too. Add this under 'Simple Modifcations' to you keyboard profile for your Varmilo keyboard in karabiner.json.
View karabiner.json
"simple_modifications": [
{
"from": {
"key_code": "insert"
},
"to": {
"key_code": "home"
}
},
{
@ErikFontanel
ErikFontanel / TimberPatternLabLoader.php
Created Jul 28, 2017
Wordpress Timber Pattern Lab Pattern Loader
View TimberPatternLabLoader.php
/**
* Custom PatternLab Loader for Timber
*
* How to use:
* Place this somewhere in your functions.php, make sure Timber WordPress plugin is installed and activated.
* This code assumes Pattern Lab is installed in the same directory as your theme.
* Change $patternlabSource below if you want to use a different path to Pattern Lab.
*
* This code hooks into Timber when Timber initialises the Twig_Loader_Filesystem
* uses default Timber loader if Pattern Lab patterns aren't found.
@ErikFontanel
ErikFontanel / README.md
Created Dec 13, 2016 — forked from zenorocha/README.md
A template for Github READMEs (Markdown) + Sublime Snippet
View README.md

Project Name

TODO: Write a project description

Installation

TODO: Describe the installation process

Usage