Skip to content

Instantly share code, notes, and snippets.

View 61131's full-sized avatar

Rob Casey 61131

  • Melbourne, Australia
View GitHub Profile
@skeeto
skeeto / summarize.c
Created March 5, 2023 20:44
P-square summary
// Summarize a numeric sequence
// Ref: https://old.reddit.com/r/commandline/comments/11hw06b
// Ref: https://github.com/ahmedakef/summarize
// This is free and unencumbered software released into the public domain.
#include <float.h>
#include <stdio.h>
#include <stdlib.h>
typedef struct {
double sum, err;
@FreddieOliveira
FreddieOliveira / docker.md
Last active July 6, 2025 23:29
This tutorial shows how to run docker natively on Android, without VMs and chroot.

Docker on Android πŸ‹πŸ“±

Edit πŸŽ‰

All packages, except for Tini have been added to termux-root. To install them, simply pkg install root-repo && pkg install docker. This will install the whole docker suite, left only Tini to be compiled manually.


Summary

@mutin-sa
mutin-sa / Top_Public_Time_Servers.md
Last active July 2, 2025 20:56
List of Top Public Time Servers

Google Public NTP [AS15169]:

time.google.com

time1.google.com

time2.google.com

time3.google.com

@jdarpinian
jdarpinian / C and shell polyglot.cmd
Last active June 2, 2025 20:17
Polyglot files that can run on Windows, Linux, and Mac using bash, cmd, and C.
#if 0 // 2>NUL & GOTO :startbatch
COMPILER_OPTIONS="-g -Wall -Wextra --std=c99 -O1";THIS_FILE="$(cd "$(dirname "$0")"; pwd -P)/$(basename "$0")";OUT_FILE="/tmp/build-cache/$THIS_FILE";mkdir -p "$(dirname "$OUT_FILE")";test "$THIS_FILE" -ot "$OUT_FILE" || $(which clang || which gcc) $COMPILER_OPTIONS -xc "$THIS_FILE" -o "$OUT_FILE" || exit;exec "$OUT_FILE" "$@"
:startbatch
@echo off
setlocal enableextensions enabledelayedexpansion
md %TEMP%%~p0 2>NUL
rem Use xcopy to test if this file is newer than the cached executable.
for /f %%i in ('xcopy %0 %TEMP%%~pnx0.exe /D /Y /Q') do set copied=%%i
if "%copied:~0,1%" neq "0" (
rem Search for Visual Studio env vars. These are set globally if VS <2017 is installed.
@jpillora
jpillora / rdiff-example.sh
Created July 6, 2017 06:41
rdiff file example
# $ apt install rdiff
# $ rdiff --help
# Usage: rdiff [OPTIONS] signature [BASIS [SIGNATURE]]
# [OPTIONS] delta SIGNATURE [NEWFILE [DELTA]]
# [OPTIONS] patch BASIS [DELTA [NEWFILE]]
# Options:
# -v, --verbose Trace internal processing
# -V, --version Show program version
# -?, --help Show this help message
@reyoung
reyoung / KVCache.h
Created December 23, 2015 06:43
A C++ 11 key-value object instance cache.
#include <memory>
#include <unordered_map>
#include <functional>
#include <mutex>
#include <glog/logging.h>
/**
* Key-Value Cache Helper.
*
* It store a object instance global. User can invoke get method by key and a
@plentz
plentz / nginx.conf
Last active June 25, 2025 06:48
Best nginx configuration for improved security(and performance)
# to generate your dhparam.pem file, run in the terminal
openssl dhparam -out /etc/nginx/ssl/dhparam.pem 2048