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 / 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 / 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 / install_ruby_1-9-3_ubuntu.sh
Created December 13, 2011 16:09
Install Ruby 1.9.3 on Ubuntu Lucid or Oneiric
#!/bin/sh
# Set up the environment. Respect $DISTRIB_CODENAME if it's set.
. /etc/lsb-release
# Fail fast if we're not on Lucid or Oneiric.
if [ $UID != 0 ]; then
echo "You are not root. Installing a package needs root privileges."
exit 1
fi
@attilagyorffy
attilagyorffy / application_helper.rb
Created June 11, 2017 14:31
Responsive Images in Rails applications
module ApplicationHelper
def responsive_image_tag(image, options = {})
content_tag(:picture) do
concat content_tag(:source, nil, media: '(max-width: 768px)', srcset: image.url(:thumbnail_mobile))
concat content_tag(:source, nil, media: '(max-width: 960px)', srcset: image.url(:thumbnail_tablet))
concat image_tag(image.url(:thumbnail_desktop), options)
end
end
end
@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 .