Skip to content

Instantly share code, notes, and snippets.

@adotagarwal
adotagarwal / rpi-network-watchdog.sh
Last active January 8, 2024 15:39 — forked from tblong/rpi-network-watchdog.sh
[Daemon] Checks a pingable source and attempts to recover WiFi when connection has been interrupted by having the kernel reload the SDIO drivers
#!/bin/bash
#
# Original Source Attribution:
# Location: https://gist.github.com/SandroMachado/87e591fc42f368636b251b566485ae46
# Author: Sandro Machado
# Date of retrieval: 2020-01-25
#
# Script Summary:
# This script checks a pingable source and when the failure
# limit is reached the host is restarted. No files are written
@heaths
heaths / Move-WixPackageCache.ps1
Last active December 30, 2017 20:31
How to relocate the Package Cache
<#
This license governs use of the accompanying software. If you use the software, you
accept this license. If you do not accept the license, do not use the software.
1. Definitions
The terms "reproduce," "reproduction," "derivative works," and "distribution" have the
same meaning here as under U.S. copyright law.
A "contribution" is the original software, or any additions or changes to the software.
A "contributor" is any person that distributes its contribution under this license.
"Licensed patents" are a contributor's patent claims that read directly on its contribution.
<?php
header("Cache-Control: no-cache, must-revalidate");
header("Expires: Sat, 26 Jul 1997 05:00:00 GMT");
header("Pragma: no-cache");
function human_filesize($bytes, $decimals = 2) {
$sz = 'BKMGTP';
$factor = floor((strlen($bytes) - 1) / 3);
return sprintf("%.{$decimals}f", $bytes / pow(1024, $factor)) . @$sz[$factor];
}