Skip to content

Instantly share code, notes, and snippets.

@craigfrancis
craigfrancis / childcare-strangers.md
Created April 19, 2025 21:06
Childcare: Strangers

Childcare: Strangers

No need to do all of these, more of a list of ideas…


Checks:

  • Hunger
  • Thirst
@craigfrancis
craigfrancis / check.sh
Created February 17, 2020 12:56
Check www-data folder and crontab permissions
#!/bin/bash
set -u;
root="/opt/permission-tester/";
output=`mktemp -t permission-tester.XXXXXXXXXX`;
#--------------------------------------------------
# Check excluded folders exist, and are noexec
#--------------------------------------------------
@craigfrancis
craigfrancis / base64-random-keys.php
Created January 6, 2018 12:28
Why you need to be careful when using base64 encoding to get a random key from random_bytes()
<?php
$characters = [];
for ($k = 0; $k < 500000; $k++) {
$key = base64_encode(random_bytes(32)); // 32 bytes results in "=" padding; try changing to 30 to fix.
foreach (str_split($key) as $c) {
if (!isset($characters[$c])) {