Skip to content

Instantly share code, notes, and snippets.

View 4np's full-sized avatar

Jeroen Wesbeek 4np

  • ServiceNow
  • The Netherlands
View GitHub Profile
@4np
4np / WireGuard iOS HOWTO.md
Last active March 29, 2024 11:06
Setting up WireGuard to secure iPhone traffic

WireGuard

How to set up WireGuard as an iOS VPN configuration in order to tunnel all traffic from an iOS or iPadOS device through a Linux server.

While there are many configurations possible, my intentation was to secure the traffic from my iOS device by routing it securely through a Linux server. As such, this HowTo will show you how to set-up an initial working configuration, which you can customize afterward.

Most likely things will be missing, such as how to configure the firewall or the init scripts on your Linux distribution. As it won't be possible to cover all Linux flavors this HowTo will attempt to give you a working WireGuard configuration, leaving it up to you to fill-in the blanks. Feel free to write a comment to touch upon your specific situation to help others that might stumble upon this HowTo :)

Note: In these configuration examples I use 10.8.0.1/24 and 10.8.0.2/24. However, as WireGuard IPs may not overlap your other network interfaces

@4np
4np / Podfile
Created July 28, 2022 09:54
Podfile with customized Xcode sandbox sync messages if the sandbox is not in sync with Podfile.lock
source 'https://cdn.cocoapods.org/'
platform :ios, '15.0'
inhibit_all_warnings!
use_frameworks!
target 'MyApp' do
pod 'SomePod', '~> 1.0'
end
@4np
4np / Netherlands-Corona-Check-Info.sh
Last active July 28, 2022 09:56
Netherlands Corona Check Info
# Configuration
curl -s https://verifier-api.coronacheck.nl/v4/verifier/config | jq -r .payload | base64 -d | jq .
# Public keys
curl -s https://verifier-api.coronacheck.nl/v4/verifier/public_keys | jq -r .payload | base64 -d | jq .
@4np
4np / remove-ios-simulators.sh
Created December 9, 2021 11:16
Remove all installed iOS Simulators
rm -rf ~/Library/*/CoreSimulator
@4np
4np / macOS-beta-enrollment.md
Last active November 23, 2020 13:16
Fix macOS beta opt out / unenrollment

Sometimes unenrolling from the macOS beta feed does not work properly.

macOS Beta Channel

You can fix this by enrolling / unenrolling through Terminal:

sudo /System/Library/PrivateFrameworks/Seeding.framework/Versions/A/Resources/seedutil enroll DeveloperSeed
sudo /System/Library/PrivateFrameworks/Seeding.framework/Versions/A/Resources/seedutil unenroll
@4np
4np / RetainCyclePlayground.swift
Last active May 15, 2020 08:21
A Swift Playground demonstrating why you need to again weekly capture self in nested closures after unwrapping self.
import Cocoa
class TestClass {
var name = ""
var block1: (() -> Void)?
var block2: (() -> Void)?
var retainCount: Int {
CFGetRetainCount(self)
}
@4np
4np / ValueTypePlayground.swift
Created May 15, 2020 07:48
Swift value type memory management
import Cocoa
func address(of object: UnsafeRawPointer) -> String {
let addr = Int(bitPattern: object)
return String(format: "%p", addr)
}
struct Foo {
public var baz: String
}
@4np
4np / named.conf
Created October 15, 2019 20:42 — forked from cpswan/named.conf
Unbound/BIND config for DNS over TLS to 1.1.1.1
options {
directory "/tmp";
listen-on-v6 { none; };
forwarders {
127.0.0.1 port 2053;
};
auth-nxdomain no; # conform to RFC1035
@4np
4np / README.md
Last active February 13, 2023 00:45
How to block adware and malware using bind.

Block adware and malware using DNS

Install bind

For Gentoo Linux:

emerge bind
@4np
4np / Gentoo-NFTables-Readme.md
Last active January 16, 2023 18:28
Gentoo Linux NFTables

Basic firewall / network router using Gentoo Linux.

After compiling the 4.19.66-gentoo kernel, udev renamed the network interfaces of my home linux Router / Firewall and my iptables setup stopped working due ip-conntrack kernel deprecations. I decided to move over to nftables, the new packet classification framework that replaces the existing {ip,ip6,arp,eb} tables infrastructure.

Even though nftables has been in the Linux kernel since 2014, the documentation is extremely sparse. As such this gist :)

Subjectively, using nftables setting up connections to my machine seems to be more responsive compared to using iptables. Connections seem to be made more quickly and ssh-ing into my machine seems more responsive. There always used to be a bit of a lag when I was using iptables, not anymore.

Preperations