Skip to content

Instantly share code, notes, and snippets.

View brandonweeks's full-sized avatar

Brandon Weeks brandonweeks

View GitHub Profile
@dayreiner
dayreiner / log-all-zsh-bash-commands-syslog.md
Last active January 14, 2024 23:40
Log all users zsh / bash commands via syslog without 3rd-party tools or auditd

Sending Bash and ZSH Commands to Syslog

Also posted here: http://18pct.com/sending-bash-and-zsh-commands-to-syslog/

Your bash/zsh history is great if its complete, but it doesn't capture commands across all users, sudo's, root commands etc. In particular with test environments, someone may perform a "one-off" procedure and then months later it needs to be repeated. It would be nice to be able to look up what the user did at the time, and searching through multiple, possibly truncated history files is a pain.

Tools like typescript are great if you're actively documenting, but not something you would use all the time in practice and capture more than just a history of your commands. There are third-party tools like rootsh and Snoopy that can accomplish this, but third-party tools can be overkill if all you want is a quick reference in a re

@cthornton
cthornton / pkcs7_degenerate.rb
Last active September 12, 2017 21:53
Ruby PKCS#7 Certificate Only Degenerate (application/x-x509-ca-ra-cert)
# Creates a degenerate PKCS#7 certificate only in ruby (SCEP application/x-x509-ca-ra-cert)
# Inspiration: https://github.com/AppBlade/TestHub/blob/master/app/controllers/scep_controller.rb#L92-L112
#
# Tested Ruby 2.2.0 OSX 10.10, OpenSSL 1.0.1l
require 'openssl'
cert = OpenSSL::X509::Certificate.new File.read('some_cert.crt')
# Fails ruby 2.2, OpenSSL 1.0.1l!!
p7certs = OpenSSL::PKCS7.new
@rbsgn
rbsgn / openvpn-keychain.diff
Created October 23, 2011 17:17
Openvpn patch that allows loading of VPN certificate from Mac OS X keychain. Originally created by Brian Raderman (<brian@irregularexpression.org>).
From a53d19a34be1301c4f4c37e9767ca698885b84fb Mon Sep 17 00:00:00 2001
From: Roman Busyghin <nskboy@gmail.com>
Date: Sun, 23 Oct 2011 20:37:52 +0400
Subject: [PATCH] Ability to lookup OS X keychain to load VPN certificate
This patch is created by Brian Raderman <brian@irregularexpression.org> and modified a bit in order to be compiled with make instead of Xcode
---
Makefile.am | 9 +
cert_data.c | 631 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
cert_data.h | 44 ++++