Skip to content

Instantly share code, notes, and snippets.

@isaac-ped
isaac-ped / capture.lua
Created March 18, 2019 14:27
Moongen script to capture packets at high rate with accurate timestamps
-- Capture packets on a port with high rate and accurate timestamps
local lm = require "libmoon"
local device = require "device"
local log = require "log"
local memory = require "memory"
local stats = require "stats"
local pcap = require "pcap"
function configure(parser)
parser:argument("dev_in", "Device on which to capture from"):args(1):convert(tonumber)
@isaac-ped
isaac-ped / capture.lua
Created March 18, 2019 14:27
Moongen script to capture packets at high rate with accurate timestamps
-- Capture packets on a port with high rate and accurate timestamps
local lm = require "libmoon"
local device = require "device"
local log = require "log"
local memory = require "memory"
local stats = require "stats"
local pcap = require "pcap"
function configure(parser)
parser:argument("dev_in", "Device on which to capture from"):args(1):convert(tonumber)
Time for the annual unnecessary-analysis-of-isaac’s-text-messages:
This year, the relatively-most-common words:
Me Alex Abhi Julia George Deborah Emily Ocko
0 hahah julia's upto kk okey hahaa watcha na
1 till downstairs aite dunno dokey hihi bitch subway
2 tired gotcha sixers alex didnt hbu porch megs
3 headed janki walnut thanks thats lololol dope meg
4 hah julia pm ha dont etc suburbs st
5 naw ken quizzo guys its hooray science breakfast
6 hahahah min otherwise well im stephen comin
@isaac-ped
isaac-ped / trash
Last active January 14, 2021 20:14
Trash, don't remove!
#!/bin/bash -e
usage() {
echo "Move to trash directory without deleting"
echo "Usage: $(basename $0) [-v] thing-to-trash1 [thing-to-trash2 ...]"
}
VERBOSE=0
POSITIONAL=""
while (( "$#" )); do # While there are arguments left
def log_exception(msg: str, e: Exception) -> None:
"""Log detailed exception info.
Only the exception stack logs to logging.critical
Local variales are also appended to logging.debug
:param msg: A message to prefix the exception output
:param e: An exception object to inspect for local variables
"""
@isaac-ped
isaac-ped / wifi-qrcode.sh
Created April 13, 2023 20:05
Create WIFI QRCode
#!/usr/bin/env nix-shell
#! nix-shell -i bash -p qrencode
usage() {
echo "Usage: $0 <SSID> <PASSWORD> [-e ENCODING] [-o OUTPUT] -- Passthrough to qrencode"
echo "ENCODING defaults to WPA, but can also be WEP"
echo "OUTPUT defaults to <SSID>.png"
}
ssid=""
@isaac-ped
isaac-ped / local.nix
Last active February 25, 2025 20:15
Nix file defining additional packages to import to darwin-configuration.nix
{ pkgs, ... } :
{
environment.systemPackages = [
pkgs.jq # Query json output from the CLI
pkgs.tree # Prettier directory output listings
pkgs.rename # Mass-rename files
pkgs.k8s # K9s is a super useful CLI utility for interacting with kubernetes
pkgs.gh # The github command-line tool
pkgs.unixtools.watch # The 'watch' command
];
@isaac-ped
isaac-ped / index.html
Created April 29, 2023 21:15
gibbering attempts
This file has been truncated, but you can view the full file.
<html>
<head><meta charset="utf-8" /></head>
<body>
<div> <script type="text/javascript">window.PlotlyConfig = {MathJaxConfig: 'local'};</script>
<script type="text/javascript">/**
* plotly.js v2.20.0
* Copyright 2012-2023, Plotly, Inc.
* All rights reserved.
* Licensed under the MIT license
*/
@isaac-ped
isaac-ped / ResourceGroup.py
Last active May 8, 2023 21:30
Automatic instantiation of single-use component resources
"""
Automatically define singleton resource groups
The structure of the python pulumi library is such that many properties
of resources are not easily modifyable after initialization.
This module functions by delaying the creation of resource attributes
within the ResourceGroup class until the class has been fully instantiated.
"""
from typing import Any, ClassVar, Iterable, TypeVar, Generic
@isaac-ped
isaac-ped / enable-touchbar-sudo.sh
Last active June 22, 2023 17:05
Enable touch-id authentication for sudo privileges on mac OS
#!/usr/bin/env bash
# From: https://it.digitaino.com/use-touchid-to-authenticate-sudo-on-macos/
# Check if it's already done
if grep 'auth[[:space:]]*sufficient[[:space:]]*pam_tid.so' /etc/pam.d/sudo; then
echo "Already done"
else
# One-liner to do it
sudo sed -i.backup 's/\(auth[[:space:]]*sufficient[[:space:]]*pam_smartcard.so\)/\1\nauth sufficient pam_tid.so/' /etc/pam.d/sudo
fi