Skip to content

Instantly share code, notes, and snippets.

View KenMacD's full-sized avatar

Kenny MacDermid KenMacD

  • Halifax, Nova Scotia, Canada
View GitHub Profile
@KenMacD
KenMacD / cluster.yaml
Created September 13, 2023 14:28
Kind cluster with podman
---
kind: Cluster
apiVersion: kind.x-k8s.io/v1alpha4
# If ipv4 only:
#networking:
# ipFamily: ipv4
kubeadmConfigPatches:
- |
apiVersion: kubeadm.k8s.io/v1beta3
kind: InitConfiguration
@KenMacD
KenMacD / resolve_tco_links.user.js
Created July 5, 2022 14:47 — forked from jix/resolve_tco_links.user.js
User script to resolve t.co links on twitter
@KenMacD
KenMacD / main.cpp
Created May 10, 2019 02:42
Particle.io Callback Variable Testing
#include <Particle.h>
static char* var_str = (char *)"ORIG STR";
static int var_int = 1;
static double var_double = 1.23;
static double override_double;
static const void* static_str_test(const char* name, Spark_Data_TypeDef type,
const void* var, void *reserverd) {
return "STATIC UPDATE";
@KenMacD
KenMacD / rekey.md
Last active October 21, 2015 15:22
How to set a new crypto key on your My Passport drive in Linux.

###Disclaimer: All risk is your own. In the best case this will erase everything on the disk forever.

Requirements

  • Make sure you want to wipe the drive.
  • Check that the sg_raw command works.
  • You'll likely have to run these as root or with sudo.
  • This should be done on a ramdisk to key data is left behind.
  • WD drive must be plugged in, and you must know the scsi device (check dmsg)
@KenMacD
KenMacD / keybase.md
Created May 19, 2014 18:30
Keybase proof

Keybase proof

I hereby claim:

  • I am kenmacd on github.
  • I am kenmacd (https://keybase.io/kenmacd) on keybase.
  • I have a public key whose fingerprint is CC7C 9BE4 F442 A854 E29D F256 9598 1B9F E3FB 7465

To claim this, I am signing this object:

@KenMacD
KenMacD / mega-dl.sh
Created September 4, 2013 01:36
Mega download script from http://hacktracking.blogspot.ca/2013/07/download-mega-files-from-command-line.html. Download with "./mega-dl.sh '<URL>' <file name>" (Note the single quotes around the URL, otherwise bash complains "event not found")
#!/bin/bash
url=$1
enc_file=$2.enc
out_file=$2
id=`echo $url | awk -F '!' '{print $2}'`
key=`echo $url | awk -F '!' '{print $3}' | sed -e 's/-/+/g' -e 's/_/\//g' -e 's/,//g'`
b64_hex_key=`echo -n $key | base64 --decode --ignore-garbage 2> /dev/null | xxd -p | tr -d '\n'`
key[0]=$(( 0x${b64_hex_key:00:16} ^ 0x${b64_hex_key:32:16} ))
@KenMacD
KenMacD / kali.sh
Last active December 15, 2020 15:23
Kali Sources
cat >/etc/apt/sources.list.d/kali.list <<EOF
deb http://http.kali.org/kali kali main contrib non-free
deb-src http://http.kali.org/kali kali main contrib non-free
deb http://security.kali.org/kali-security kali/updates main contrib non-free
deb-src http://security.kali.org/kali-security kali/updates main contrib non-free
EOF
sudo apt-key adv --keyserver pgp.mit.edu --recv-keys ED444FF07D8D0BF6
sudo apt-get update
@KenMacD
KenMacD / convert.py
Created October 9, 2012 19:00
Convert SARVAM image to binary
#!/usr/bin/env python
import Image
from sys import stdin, stdout
from StringIO import StringIO
for value in list(Image.open(StringIO(stdin.read())).getdata()):
stdout.write(chr(value))
@KenMacD
KenMacD / cmd.md
Created October 7, 2011 02:41
GPG Offline Master Key