Skip to content

Instantly share code, notes, and snippets.

View jwarwick-bry's full-sized avatar

Justin Warwick jwarwick-bry

View GitHub Profile
@jrwarwick
jrwarwick / one-liners.sh
Last active August 15, 2025 14:29
Potpourri of handy shell one-liners/gems/nuggets for really specific tasks
# just keep running count of seconds gone by, printing to console periodicially.
# Useful as rough "stopwatch" when you need to prove to your netadmin that your ssh sessions are getting disconnected regularly.
BEGIN=$(date "+%Y%m%d%H%M%S") ; while [ 1=1 ] ; do echo "$(( $(date '+%Y%m%d%H%M%S') - $BEGIN ))" ; sleep 300 ; done
# Quick and dirty terminal-based test of (HTTPS) SSL connectivity and get the cert expiry properties
echo | openssl s_client -showcerts -connect foohost.bardomain.tld:443 | openssl x509 -noout -dates
## Thought: what belongs in here versus .profile as an alias/function?
## Probably anything that you aren't going to call often enough to warrant spending neurons on memroizing even the alias/func name.
## in which case most of what follows should actually go elsewhere.
using namespace System.Net.Sockets
using namespace System.Net.Security
using namespace System.Security.Cryptography.X509Certificates
function ConvertFrom-X509Certificate {
param(
[Parameter(ValueFromPipeline)]
[X509Certificate2]$Certificate
)
@boredzo
boredzo / skew.scad
Created January 5, 2016 06:02
Skew operator for OpenSCAD
/*skew takes an array of six angles:
*x along y
*x along z
*y along x
*y along z
*z along x
*z along y
*/
module skew(dims) {
matrix = [
@willurd
willurd / web-servers.md
Last active December 5, 2025 14:02
Big list of http static server one-liners

Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.

Discussion on reddit.

Python 2.x

$ python -m SimpleHTTPServer 8000