Skip to content

Instantly share code, notes, and snippets.

View attilagyorffy's full-sized avatar
🦜
A UDP packet bar walks a into...

Attila Györffy attilagyorffy

🦜
A UDP packet bar walks a into...
View GitHub Profile
@attilagyorffy
attilagyorffy / proton_opn_wg.md
Created July 3, 2023 21:12 — forked from morningreis/proton_opn_wg.md
OPNsense + ProtonVPN + Wireguard Configuration Guide

OPNsense + ProtonVPN + Wireguard

Published: 16 December 2022

Reference: https://docs.opnsense.org/manual/how-tos/wireguard-selective-routing.html

Goal: Set up one or more Wireguard connections from ProtonVPN on OPNsense, with policy based routing, and optional Killswitch.

I'm writing this guide first as a reference for my future self for when I inevitably forget how to do this, but also to help others out. I found there were not many guides on this specific configuration, particularly not with multiple concurrent connections, and these were some steps which were not at all obvious. I did begin with the guide in the official OPNsense documentation, but even that was missing info to make ProtonVPN work. If you are a pfSense user, it is very similar to OPNsense, and you should be able to follow along with some success, but I have not tested it myself.

@attilagyorffy
attilagyorffy / the % notation in ruby.md
Created April 29, 2022 11:40 — forked from jakimowicz/the % notation in ruby.md
%Q, %q, %W, %w, %x, %r, %s, %I, %i

%Q, %q, %W, %w, %x, %r, %s, %i

Perl-inspired notation to quote strings: by using % (percent character) and specifying a delimiting character.

Any single non-alpha-numeric character can be used as the delimiter, %[including these], %?or these?, %~or even these things~.

Strings

% or %Q

@attilagyorffy
attilagyorffy / bigsur_release_availability.rb
Created November 12, 2020 18:07
Excited about the imminent availability of Big Sur but tired of checking the software update pane in System Preferences? Use this Ruby script to automate it and get a notification once it's available in your region.
# NOTE: This script assumes that you system is otherwise updated, ie no other update is pending.
# You can add this script into crontab to run every 5 mins: */5 * * * *
require 'open3'
Open3.popen3("softwareupdate -l --force") do |_stdin, _stdout, stderr, _thread|
unless stderr.read.match? /No new software available./
exec(%q{osascript -e "display notification \"You have an update available.\""})
end
end
@attilagyorffy
attilagyorffy / arch-xhyve.sh
Created September 18, 2020 08:03 — forked from ChaosJohn/arch-xhyve.sh
Run Arch Linux in xhyve
#!/bin/bash
tmp=$(mktemp -d)
pushd "$tmp"
iso=/Users/lloeki/Downloads/archlinux-2015.08.01-dual.iso
echo "fixing disk"
dd if=/dev/zero bs=2k count=1 of=tmp.iso
dd if=$iso bs=2k skip=1 >> tmp.iso
echo "mounting disk"
@attilagyorffy
attilagyorffy / Duotone Dark.tmTheme
Created September 3, 2020 22:27 — forked from simurai/Duotone Dark.tmTheme
DuoTone dark theme for TextMate
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<!-- Generated by: TmTheme-Editor -->
<!-- ============================================ -->
<!-- app: http://tmtheme-editor.herokuapp.com -->
<!-- code: https://github.com/aziz/tmTheme-Editor -->
<plist version="1.0">
<dict>
<key>name</key>
<string>Duotone Dark</string>
@attilagyorffy
attilagyorffy / tux.output
Created February 18, 2018 12:58
tux output in luma.examples on a nanopi neo air
root@NanoPi-NEO-Air:~# git clone https://github.com/rm-hull/luma.core.git
Cloning into 'luma.core'...
remote: Counting objects: 1338, done.
remote: Compressing objects: 100% (29/29), done.
remote: Total 1338 (delta 12), reused 15 (delta 5), pack-reused 1304
Receiving objects: 100% (1338/1338), 376.52 KiB | 0 bytes/s, done.
Resolving deltas: 100% (791/791), done.
Checking connectivity... done.
root@NanoPi-NEO-Air:~# cd luma.core
root@NanoPi-NEO-Air:~/luma.core# pip install -e .
@attilagyorffy
attilagyorffy / gist:66552d48dd6f281b6c3a335f1d184074
Created January 27, 2018 11:40
Connect to Neo Air (or anything really) over serial. On a windows machine.

For Windows:

  • Download and install Putty

  • Connect your USB to UART adapter from your computer to your Nano Pi Neo Air (or any COM device)

  • Make sure you connect TX>RX and RX>TX (Sending/Receiving), otherwise both your devices are talking at the same time and neither one is being heard.

  • On Windows OS, pull up the Device Manager

    • Run Windows (WinKey+R) and type in devmgmt.msc
@attilagyorffy
attilagyorffy / Dockerfile
Last active May 2, 2021 20:51
Ruby 2.4.3 on Alpine Linux using jemalloc Segmentation fault during make
FROM alpine:3.7
RUN apk add --update-cache gcc libc-dev curl jemalloc-dev make linux-headers
RUN mkdir -p /usr/src/ruby
RUN cd /usr/src/ruby
RUN curl "https://cache.ruby-lang.org/pub/ruby/2.4/ruby-2.4.3.tar.gz" | tar -xz
RUN cd ruby-2.4.3 && ./configure --enable-shared --with-jemalloc --disable-install-doc && make
@attilagyorffy
attilagyorffy / gist:5def7f6677e027ea421e933380698067
Created September 18, 2017 21:14 — forked from ChickenProp/gist:3183960
Expanding the Raspberry Pi's GPIO capabilities with the MCP23017

Introduction

The MCP23017 is an I/O expander chip. It has 16 GPIO pins which you can control using an I2C interface using two pins from a Raspberry Pi, plus a power source and sink (which can also come from the Pi). It's not quite as simple as directly controlling the Pi's GPIO pins, but it's not complicated, either.

You need to install i2c-tools, which is probably in your distribution's package manager. You also need a kernel with I2C support; you might need to modprobe i2c-dev. It would presumably be possible to do without either of these things, and bitbang the I2C protocol over GPIO, but I don't understand the protocol well enough to try.

On pin numbering: if you like, you can refer to the datasheet for the MCP23017. There's a small dot in one corner of the chip, with a semi-circular cut-out at that end. The pin near