Skip to content

Instantly share code, notes, and snippets.

View sarcasticadmin's full-sized avatar

Robert James Hernandez sarcasticadmin

View GitHub Profile
@wolfeidau
wolfeidau / template.yaml
Last active August 22, 2025 22:56
Firehose to datadog
AWSTemplateFormatVersion: '2010-09-09'
Description: "wolfeidau: Notifications stream which sends events to datadog"
Parameters:
Environment:
Type: String
AllowedValues: [prod, nonprod]
DatadogHttpEndpointUrl:
Type: String
Default: https://aws-kinesis-http-intake.logs.datadoghq.com/v1/input
@csobankesmarki
csobankesmarki / convert private key
Last active July 18, 2024 17:12
Convert OpenSSH ED25519 to OpenSSL ED25519
(printf \\x30\\x2e\\x02\\x01\\x00\\x30\\x05\\x06\\x03\\x2b\\x65\\x70\\x04\\x22\\x04\\x20;egrep -v "^-" | tr -d '\n' | base64 -d | dd bs=161 skip=1 2>/dev/null | dd bs=32 count=1 2>/dev/null) | openssl pkey -inform der -outform pem
#!/bin/bash
set -eu
usage() {
cat >&2 <<'EOF'
usage: ./difflog $out1 $out2
Compare two Nix build logs, normalizing out boring differences.
This can be useful to test the effect of a change to build scripts,
with builtins;
let
pkgs = import ../nixpkgs { overlays = []; config={oraclejdk.accept_license = true;}; };
# clean evals
cc1 = pkgs.lib.mapAttrs (n: v: (builtins.tryEval v).value ) (pkgs.recurseIntoAttrs pkgs);
# Only top level derivations
cc2 = pkgs.lib.filterAttrs (n: v: pkgs.lib.isDerivation v) cc1;
# Filter for meta tags
@talawahtech
talawahtech / docker-hub-api.sh
Last active January 16, 2022 14:15
Docker Hub - Create repo with automated build for TechEmpower benchmark
#!/bin/sh
export UNAME=""
export UPASS=""
export DOCKERHUB_NAMESPACE="techempower"
export FRAMEWORK_LANG="C"
export FRAMEWORK="libreactor"
export GITHUB_ORG="TechEmpower"
export GITHUB_REPO="FrameworkBenchmarks"
#Authenticate
@dan82840
dan82840 / udhcpc.user
Created October 16, 2018 03:50
Put udhcpc.user to /etc/udhcpc.user
#!/bin/sh
#
echo "$@" >>/tmp/udhcpc.dump
echo "========================" >> /tmp/udhcpc.dump
set >> /tmp/udhcpc.dump
echo "========================" >> /tmp/udhcpc.dump
@ravron
ravron / README.md
Last active November 29, 2025 11:09
Options to prevent accidental Yubikey OTP triggering

Tired of spamming Yubikey one-time password (OTP) codes into Slack? Here are two options to help prevent that. You can do either or both. Both require ykman, the Yubikey CLI configuration manager. Get it with Homebrew:

brew install ykman

If you…

@mario21ic
mario21ic / socat_examples
Created June 23, 2017 17:42
Examples for using socat (and filan)
// Examples for using socat (and filan)
//"$" means normal user, "#" requires privileges, "//" starts a comment
///////////////////////////////////////////////////////////////////////////////
// similar to netcat
// connect to 10.1.1.1 on port 80 and relay to and from stdio
@j-keck
j-keck / nixos-as-bhyve-guest.md
Last active July 19, 2025 01:09
nixos as bhyve guest

create a vm

root@main:~ # vm create -t debian -s 100G nixos
root@main:~ # vm iso /stuff/downloads/nixos-graphical-18.03.132192.ce0d9d638de-x86_64-linux.iso 
root@main:~ # vm -f install nixos nixos-graphical-18.03.132192.ce0d9d638de-x86_64-linux.iso

boot the image

determine the 'init' executable path from '(cd0)/isolinux/isolinux.cfg'. look for a line which start's with: 'APPEND init=/nix/store/.....'

@fstab
fstab / MATRIX.md
Last active January 5, 2022 12:31
How to use matrix.org and vector.im as an IRC client

How to use matrix.org and vector.im as an IRC client

How to Join an IRC Channel on matrix.org

Join the room #freenode_<#channel>:matrix.org, replacing <#channel> with the name of the IRC channel. For example, in order to join the #prometheus IRC channel, join the room #freenode_#prometheus:matrix.org on matrix.org.

In vector.im, rooms can be joined with the directory symbol on the bottom left.