Skip to content

Instantly share code, notes, and snippets.

@bgrewell
bgrewell / he-ipv6-udm-pro.md
Last active July 2, 2025 22:33
This gist explains how to set up IPv6 connectivity on your Ubiquiti UDM Pro or similar Ubiquiti devices using a Hurricane Electric (TunnelBroker) tunnel. Enable free IPv6 access to your network without relying on ISP support.

Setup IPv6 Tunnel on Unifi Dream Machine Pro

In order to use IPv6 via a Hurricane Electric tunnel you need to sign up for their free Tunnel Broker service at https://tunnelbroker.net/

Setup Address Allocation

Navigate to https://unifi.ui.com and go to your network management page. Navigate to Settings -> Networks and select the network you wish to enable IPv6 on such as Default then click on the IPv6 button.

  1. Select static for interface type
  2. Under Gateway IP/Subnet enter your Routed IPv6 Prefix from the HE management page
@a7ul
a7ul / jamf.md
Last active May 16, 2025 07:56
removing all restrictions on jamf managed macos device - Provided you have root access.

REMOVE JAMF RESTRICTIONS ON MAC

REMOVE ONLY RESTRICTIONS

sudo jamf removeMDMProfile removes all restrictions

sudo jamf manage brings back all restrictions and profiles

REMOVE ALL RESTRICTIONS AND DISABLE JAMF BINARIES WHILE KEEPING YOUR ACCESS TO VPN AND OTHER SERVICES

sudo jamf removeMDMProfile removes all restrictions

@mimoo
mimoo / curve25519.sage
Created November 16, 2017 13:21
Curve25519 with sage
# create curve
ec = EllipticCurve(GF(2**255-19), [0,486662,0,1,0])
base_point = ec.lift_x(9)
point_at_infinity = ec(0)
# all elements of order 4
G4s = ec.lift_x(1, True)
G4 = ec.lift_x(1) # just the first element
# the element of order 2
defp gen_jwk_set do
{:ok, pem} = genrsa(2048)
pem
|> JOSE.JWK.from_pem()
|> JOSE.JWK.to_public()
|> JOSE.JWK.to_record()
|> List.wrap()
|> :jose_jwk_set.to_map(%{})
|> Poison.encode()
@atoponce
atoponce / gist:07d8d4c833873be2f68c34f9afc5a78a
Last active June 19, 2025 00:39 — forked from tqbf/gist:be58d2d39690c3b366ad
Cryptographic Best Practices

Cryptographic Best Practices

Putting cryptographic primitives together is a lot like putting a jigsaw puzzle together, where all the pieces are cut exactly the same way, but there is only one correct solution. Thankfully, there are some projects out there that are working hard to make sure developers are getting it right.

The following advice comes from years of research from leading security researchers, developers, and cryptographers. This Gist was [forked from Thomas Ptacek's Gist][1] to be more readable. Additions have been added from

@studzien
studzien / beam.md
Created September 9, 2015 11:38
An example analysis of a BEAM process core dump

This post shows an example of a BEAM process' core dump analysis to backtrack what was the root cause of its crash.

Start gdb by pointing out the BEAM executable that generated the core dump and the core dump file. Optionally, you can provide a directory with the VM's source code:

gdb erts-6.3/bin/beam.smp -core core.14747 -d /home/azureuser/otp_src_17.4/erts/emulator

gdb should tell you what caused the crash and where in code this happened:

@deserat
deserat / gist:8245275
Last active January 2, 2016 03:39
Node JS Benchmarks Amazon AWS vs Joyent

The script:

var http = require('http')
var fs = require('fs')


http.createServer(function (req, res) {
  res.writeHead(200, {'Content-Type': 'text/plain'})
  res.end("hello world")
}).listen(3000);
@notmatt
notmatt / hello.c
Last active December 27, 2015 06:39 — forked from AlainODea/hello.c
#include<stdio.h>
main()
{
printf("Hello World");
}
@willurd
willurd / web-servers.md
Last active July 14, 2025 21:19
Big list of http static server one-liners

Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.

Discussion on reddit.

Python 2.x

$ python -m SimpleHTTPServer 8000
@mdrobnak
mdrobnak / smartos-autoprovision.diff
Created January 19, 2013 03:49
Diff of stock smartos_prompt_config.sh vs with autoprovisioning. This has no formatting cleanups except for one small section. admin_mac is passed via a boot parameter in iPXE - autoprovision="true",admin_mac=${netX/mac} is added to the boot parameters to activate this code.
--- stock-smartos_prompt_config.sh 2012-12-28 02:38:25.657297000 +0000
+++ smartos_prompt_config.sh 2013-01-19 03:31:54.001819025 +0000
@@ -10,6 +10,12 @@
load_sdc_sysinfo
load_sdc_config
+if /bin/bootparams | grep "^autoprovision=true" >/dev/null; then
+ autoprovision="true"
+else
+ autoprovision="false"