Skip to content

Instantly share code, notes, and snippets.

@a7ul
a7ul / jamf.md
Last active March 29, 2024 09:47
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 March 19, 2024 17:24 — 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 April 25, 2024 01:54
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"
@jahewson
jahewson / smartos-on-a-budget.sh
Last active March 9, 2024 07:27
Installing and Configuring SmartOS on a budget server (with a /29)
# Licensed under CC BY 3.0 http://creativecommons.org/licenses/by/3.0/
# Derived works must attribute https://gist.github.com/4492300 at the beginning, and the date.
##################################################################
Installing and Configuring SmartOS on a budget server (with a /29)
##################################################################
# if you find this gist useful, please star it
# please be aware that budget hosting companies usually cut corners somewhere,