Skip to content

Instantly share code, notes, and snippets.

View tamsky's full-sized avatar

Marc Tamsky tamsky

View GitHub Profile
@tamsky
tamsky / txt.md
Last active November 29, 2024 05:12
how to query cross-account peering traffic using AWS CUR (cost usage reporting)
#!/usr/bin/env bash
# Map Caps Lock key to Left Control key
# https://developer.apple.com/library/content/technotes/tn2450/_index.html
# This doesnt work. Reverts on restart
# hidutil property --set '{"UserKeyMapping":[{"HIDKeyboardModifierMappingSrc":0x700000039,"HIDKeyboardModifierMappingDst":0x7000000E0}]}'
# References:
# https://github.com/mathiasbynens/dotfiles/issues/310
# https://gist.github.com/scottstanfield/0f8ce63271bebfb5cf2bb91e72c71f91
# The last link didnt work for me on Sierra or High Sierra. I could not find IOHIDKeyboard but
"don't write code that is easy to extend, write code that is easy to delete"
@tamsky
tamsky / audacity_rescue2.sh
Created November 10, 2023 05:26 — forked from javierwilson/audacity_rescue2.sh
recover audacity 2.0 crash data
#!/bin/bash
#Recover from an Audacity 2.0 crash by reassembling the saved data files
#Based on https://gist.github.com/912222
if [ $# != 2 ]; then
echo "ERROR: Not enough arguments"
echo "$0 [SOURCE PATH] [DESTINATION]"
exit 1
fi
@tamsky
tamsky / audacity_rescue.js
Created November 10, 2023 05:26 — forked from mauritslamers/audacity_rescue.js
audacity rescue script nodejs with stereo support
// recover from audacity crash
// usage:
// node audacity_rescue.js [sourcedir] [result_file.wav] [mono|stereo]
// the mono or stereo option is optional, the default is mono.
//
// Description:
// This script will sort all files on modification date.
// If you create a backup, make sure you use `cp -a` to preserve the modification date
// or create a zip.
locals {
# Replace a terraform-aws-provider sts assumed role with the equivalent iam role, i.e:
# arn:aws:sts::<account-id>:assumed-role/<role-name>/<numeric-session-id>
# =>
# arn:aws:iam::<account-id>:role/<role-name>
# This allows a user to simply pass `role_arn = "${data.aws_caller_identity.this.arn}"`
role_arn = replace(
var.role_arn,
"/(.*):sts:(.*):assumed-role/(.*)/[0-9]*$/",
"$1:iam:$2:role/$3",
# SEARCH ENGINES FOR PENTESTERS
1. shodan.io (Server)
2. google.com (Dorks)
3. wigle.net (WiFi Networks)
4. grep.app (Codes Search)
5. app.binaryedge (Threat Intelligence)
6. onyphe.io (Server)
7. viz.greynoise.io (Threat Intelligence)
8. censys.io (Se
@tamsky
tamsky / note.md
Created June 23, 2022 03:01
sad trackpad palm rejection on the sad butterfly keyboard MacBook Pro 15" series
;;; typo-dark-theme.el --- Typographic (not color) Theme
;; Copyright (C) 2017 Bastian Bechtold
;; Author: Bastian Bechtold
;; URL: https://github.com/bastibe/.emacs.d/tree/master/lisp
;; This program is free software; you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
;; the Free Software Foundation, either version 3 of the License, or
$ cd "path to your SSL"
$ mkdir -p Fingerprints
$ openssl req -x509 -nodes -days 365 -subj /CN=barrier -newkey rsa:4096 -keyout barrier.pem -out barrier.pem
$ openssl x509 -fingerprint -sha1 -noout -in barrier.pem > Fingerprints/Local.txt
$ sed -e "s/.*=//" -i Fingerprints/Local.txt