Skip to content

Instantly share code, notes, and snippets.

@usmcfiredog
usmcfiredog / ulagen.py
Created March 20, 2021 05:34
IPv6 ULA Generation for VPN server
#!/usr/bin/env python3
import hashlib
import time
import uuid
def get_eui64():
mac = uuid.getnode()
eui64 = mac >> 24 << 48 | 0xfffe000000 | mac & 0xffffff
eui64_canon = "-".join([format(eui64, "02X")[i:i+2] for i in range(0, 18, 2)])
@gene1wood
gene1wood / postfix-debconf-get-selections.txt
Last active April 15, 2021 07:09
postfix debconf-get-selections using myhost.example.com as an example domain name
# Internet protocols to use:
# Choices: all, ipv6, ipv4
postfix postfix/protocols select all
# System mail name:
postfix postfix/mailname string myhost.example.com
# Add a 'mydomain' entry in main.cf for upgrade?
postfix postfix/mydomain_warning boolean
# Correct tlsmgr entry in master.cf for upgrade?
postfix postfix/tlsmgr_upgrade_warning boolean
# Root and postmaster mail recipient:
@artizirk
artizirk / debug.md
Last active June 20, 2024 23:32
Debug WireGuard Linux kernel module
@liorazi
liorazi / Font+MonospacedDigits.swift
Created February 11, 2018 15:19
Font Extension for Monospaced Digits (Swift 4.0)
import UIKit
extension UIFont {
var monospacedDigitFont: UIFont {
let oldFontDescriptor = fontDescriptor
let newFontDescriptor = oldFontDescriptor.monospacedDigitFontDescriptor
return UIFont(descriptor: newFontDescriptor, size: 0)
}
@klaasnotfound
klaasnotfound / jekyll-multiple-languages-plugin.rb
Last active May 27, 2019 09:40
This is a modified version of the most popular Jekyll i18n plugin. It puts the default language in its own subfolder (like the other languages), uses a base.html file as the central index.html (for language-based redirects) and properly translates custom collection documents and links.
=begin
Jekyll Multiple Languages is an internationalization plugin for Jekyll. It
compiles your Jekyll site for one or more languages with a similar approach as
Rails does. The different sites will be stored in sub folders with the same name
as the language it contains.
Please visit https://github.com/screeninteraction/jekyll-multiple-languages-plugin
for more details.
@andrewlkho
andrewlkho / debian-strongswan.md
Last active January 3, 2024 03:39
Setting up a secure VPN with strongSwan on debian

With heightening concern regarding the state of internet privacy (fuelled in part by the passing of the Investigatory Powers Act in the UK), I have set up a VPN server on the virtual server I have hosted with Mythic Beasts. This uses strongSwan and certificate-based IKEv2 authentication.

Assumptions:

  • Debian Jessie server already set up and accessible via debian.example.com, a public IPv4 of 203.0.113.1 and a public IPv6 of 2001:db8::1
  • Client username of me
  • Clients are running the latest versions of macOS and iOS (Sierra and 10 respectively at the time of writing)
  • No need to support any other operating systems (although the setup is easily translated)

For automated deployment of a similar setup, albeit Ubuntu-based and using ansible for deployment, I recommend you take a look at Algo VPN. I used that project as a basis for my configuration.

@jamesmacwhite
jamesmacwhite / Workarounds for Netflix and the blocking of IPv6 tunnels.md
Last active June 24, 2024 20:05
Prevent proxy/VPN streaming error messages from Netflix when using a Hurricane Electric IPv6 tunnel.

Workarounds for Netflix and the blocking of Hurricane Electric IPv6 tunnels

The dreaded "You seem to be using an unblocker or proxy." error message. Cool story bro.

This gist was essentially created out of my own rant about Netflix being hostile to IPv6 tunnel services since June 2016. You are welcome to read my opinion on the matter, this is the more technical side to the issue and how to combat it within your own network.

Since I wrote this, various GitHub users have contributed their thoughts and ideas which has been incorporated into this gist. Thank you to everyone who have contributed their own methods and implementations.

The problem

Netflix now treats IPv6 tunnel brokers (such as Hurricane Electric) as proxy servers. A while ago it became apparent to users and Netflix that somewhat by accident, IPv6 tunnel users were being served content outside of their geolocation because of the way Netflix was identifyi

@remarkablemark
remarkablemark / hide-status-bar-in-iphone-simulator.md
Created July 13, 2016 00:16
How to hide the status bar in the iPhone Simulator.

Hide status bar in iPhone Simulator

  1. Open Info.plist.
  2. Add row with key View controller-based status bar appearance and value NO if not present.
  3. Add row with key Status bar is initially hidden with value YES if not present.
  4. Save and run the project.

Source

@shmup
shmup / torrents.md
Last active July 15, 2024 20:36
transmission blocklist guide

Transmission Blocklist

The Transmission torrent client has an option to set a Blocklist, which helps protect you from getting caught and having the DMCA send a letter/email.

It's as simple as downloading and installing the latest client:

@u0d7i
u0d7i / disable_vim_auto_visual_on_mouse.txt
Last active July 26, 2024 06:24
Disable vim automatic visual mode on mouse select
Disable vim automatic visual mode on mouse select
issue: :set mouse-=a
add to ~/.vimrc: set mouse-=a
my ~/.vimrc for preserving global defaults and only changing one option:
source $VIMRUNTIME/defaults.vim
set mouse-=a