Skip to content

Instantly share code, notes, and snippets.

hiorws /
Last active Jul 17, 2021 — forked from m-radzikowski/
Ubuntu 20.04 Server Initialization Script includes Docker & Docker Compose Installation
#!/usr/bin/env bash
set -Eeuo pipefail
script_dir=$(cd "$(dirname "${BASH_SOURCE[0]}")" &>/dev/null && pwd -P)
usage() {
cat <<EOF
hiorws /
Created May 12, 2020 — forked from bookjan/
Using python opencv to detect face and send the frames to FFmpeg to create HLS(HTTP Live Streaming)
import numpy as np
import cv2
import sys
cap = cv2.VideoCapture(0)
face_cascade = cv2.CascadeClassifier('<PATH_TO_CASCADES_FOLDER>/haarcascade_frontalface_default.xml')
# Capture frame-by-frame
hiorws / sketch_hires_lores.pde
Last active Dec 13, 2020 — forked from jorgenys/sketch_hires_lores.pde
High resolution rendering with Processing, Part 2
View sketch_hires_lores.pde
PGraphics render;
int printWidth = 10;
int printHeight = 6;
int printDpi = 300;
int previewDpi = 72;
boolean renderHighRes = false;
boolean firstFrame = true;
hiorws /
Created Dec 10, 2020 — forked from kawsark/
A guide for configuring Vault's SSH-CA

SSH CA use-case with Vault

In this scenario we are going to set up Vault to sign SSH keys using an internal CA. We will configure the SSH secrets engine and create a CA within Vault. We will then configure an SSH server to trust the CA key we just created. Finally we will attempt to SSH using a private key, and a public key signed by Vault SSH CA.


  • This guide assumes you have already provisioned a Vault server, SSH host using OpenSSH server, and a SSH client machine.
  • The client system must be able to reach the Vault server and the OpenSSH server.
  • We will refer to these systems respectively as:
hiorws /
Created Oct 16, 2020 — forked from spalladino/
Backup and restore a mysql database from a running Docker mysql container
# Backup
docker exec CONTAINER /usr/bin/mysqldump -u root --password=root DATABASE > backup.sql
# Restore
cat backup.sql | docker exec -i CONTAINER /usr/bin/mysql -u root --password=root DATABASE
View Remove Sophos from Mac without tamper protection
cd /Library/Preferences
sudo rm com.sophos.sav.plist

cd /Library/Application\ Support/Sophos/cloud/
sudo ./InstallationDeployer —force_remove
hiorws / cron-sendy-backup
Created Sep 16, 2020 — forked from nickjj/cron-sendy-backup
An example of creating a database backup and restore script for MySQL, MariaDB and PostgreSQL. It is focused on backing up and restoring a Sendy database (working example from but you can apply it for any database with slight modifications.
View cron-sendy-backup
30 0 * * * root /usr/local/bin/sendy-backup > /dev/null 2>&1
hiorws /
Created Jul 28, 2020 — forked from willurd/
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
hiorws / PrintTemplate.pde
Created Aug 19, 2019
Processing High Resolution Output Generator Template
View PrintTemplate.pde
import processing.pdf.*;
* Processing High Resolution Output Generator Template
* Taken from:
* Thanks to: @sighack
int seed;
hiorws /
Created May 23, 2020 — forked from KdotJPG/
Visually axis-decorrelated coherent noise algorithm based on the Simplectic honeycomb.
* OpenSimplex Noise in Java.
* by Kurt Spencer
* v1.1 (October 5, 2014)
* - Added 2D and 4D implementations.
* - Proper gradient sets for all dimensions, from a
* dimensionally-generalizable scheme with an actual
* rhyme and reason behind it.
* - Removed default permutation array in favor of