Skip to content

Instantly share code, notes, and snippets.


Andrew Ayer AGWA

View GitHub Profile
AGWA / fork_rand.c
Last active Oct 11, 2018
Demonstrates that LibreSSL's PRNG is not fork-safe on Linux. See
View fork_rand.c
* Demonstrates that LibreSSL's PRNG is not fork-safe on Linux.
* See
* This code is in the public domain.
#include <openssl/rand.h>
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
Last active Sep 11, 2019
Isolated OpenVPN routing table on Linux

Save the route script to /usr/local/lib/openvpn/route on the client. Make it executable with chmod +x.

Remove the push redirect-gateway option from the OpenVPN server config.

Add these options to the OpenVPN client config:

route-up /usr/local/lib/openvpn/route
Created Apr 14, 2017
Very simple Rust wrapper around pselect
/* Copyright (C) 2017 Andrew Ayer
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
* The above copyright notice and this permission notice shall be included
Last active Jan 16, 2021
Enable and disable the HDMI port on the Raspberry Pi: `rpi-hdmi on` to turn on, `rpi-hdmi off` to turn off. X is properly reinitialized when re-enabling.
# Enable and disable HDMI output on the Raspberry Pi
is_off ()
tvservice -s | grep "TV is off" >/dev/null
case $1 in