Skip to content

Instantly share code, notes, and snippets.

@Gowee
Gowee / uacme-cloudflare-hook.sh
Last active March 9, 2024 01:29
DNS-01 challenge hook script of uacme for Cloudflare
#!/bin/sh
# Copyright (C) 2020 Michel Stam <michel@reverze.net>
# Copyright (C) 2021 Hung-I Wang <whygowe@gmail.com>
#
# The script is adatped from:
# https://github.com/ndilieto/uacme/blob/5edec0eea1bcf6f454ec1787297c2408c2f2e97a/nsupdate.sh
#
# Licensed under the the GNU General Public License <http://www.gnu.org/licenses/>.
# The script is meant to be used as a hook script of uacme to update TXT records for acme challenges.
# IDA (disassembler) and Hex-Rays (decompiler) plugin for Apple AMX
#
# WIP research. (This was edited to add more info after someone posted it to
# Hacker News. Click "Revisions" to see full changes.)
#
# Copyright (c) 2020 dougallj
# Based on Python port of VMX intrinsics plugin:
# Copyright (c) 2019 w4kfu - Synacktiv
create table tweet (
id serial,
in_reply_to integer references tweet(id)
);
insert into tweet (id, in_reply_to)
values (1, NULL),
(2, NULL),
(3, 2),
(4, 3),
@jpmens
jpmens / profile.sh
Created April 5, 2019 22:36
tmux autostart via ssh
# .profile
...
# try to attach to tmux session or create a new one. When
# tmux exits (e.g. detach) we exit this session.
sname="t-$(hostname)"
if [[ -z "$TMUX" ]] && [ "$SSH_CONNECTION" != "" ]; then
@pkirkovsky
pkirkovsky / yubikey-reset.sh
Last active October 20, 2023 21:57
Utility for resetting a Yubikey to factory defaults using gpg-connect-agent. This will wipe out any stored keys and reset PINs to default values.
# Adapted from https://developers.yubico.com/ykneo-openpgp/ResetApplet.html
gpg-connect-agent <<EOF
/hex
scd serialno
scd apdu 00 20 00 81 08 40 40 40 40 40 40 40 40
scd apdu 00 20 00 81 08 40 40 40 40 40 40 40 40
scd apdu 00 20 00 81 08 40 40 40 40 40 40 40 40
scd apdu 00 20 00 81 08 40 40 40 40 40 40 40 40
scd apdu 00 20 00 83 08 40 40 40 40 40 40 40 40
scd apdu 00 20 00 83 08 40 40 40 40 40 40 40 40
@allanmac
allanmac / sha256.cu
Last active November 10, 2023 01:26
A CUDA SHA-256 subroutine using macro expansion
// -*- compile-command: "nvcc -m 32 -arch sm_35 -Xptxas=-v,-abi=no -cubin sha256.cu"; -*-
//
// Copyright 2013 Allan MacKinnon <allanmac@alum.mit.edu>
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to