Skip to content

Instantly share code, notes, and snippets.

View onlineth's full-sized avatar
:shipit:

Thomas Hein onlineth

:shipit:
  • Illinois, United States
View GitHub Profile
@onlineth
onlineth / gist:154c0aed039479a1f079238c1c37a706
Created January 11, 2021 23:37 — forked from jamesgmarks/gist:56502e46e29a9576b0f5afea3a0f595c
MySQL/MariaDB BIN_TO_UUID and UUID_TO_BIN Polyfill
DELIMITER //
CREATE FUNCTION BIN_TO_UUID(b BINARY(16))
RETURNS CHAR(36)
BEGIN
DECLARE hexStr CHAR(32);
SET hexStr = HEX(b);
RETURN LOWER(CONCAT(
SUBSTR(hexStr, 1, 8), '-',
SUBSTR(hexStr, 9, 4), '-',
#!/bin/bash
# Setup and enable auditd
# MUST REBOOT AFTER SETUP
#
# FUNCTIONALITIES:
#
# * Auditing user TTY
# aureport --tty
#
# * Auditing root commands (real uid)
@onlineth
onlineth / gzip_str.py
Created June 3, 2020 17:52 — forked from Garrett-R/gzip_str.py
Demo of how to gzip and gunzip a string in Python 3
import gzip
import io
def gzip_str(string_):
out = io.BytesIO()
with gzip.GzipFile(fileobj=out, mode='w') as fo:
fo.write(string_.encode())
bytes_obj = out.getvalue()
@onlineth
onlineth / Using Github Deploy Key.md
Last active January 10, 2019 22:24 — forked from zhujunsan/Using Github Deploy Key.md
Using Github Deploy Key

What / Why

Deploy key is a SSH key set in your repo to grant client read-only (as well as r/w, if you want) access to your repo.

As the name says, its primary function is to be used in the deploy process, where only read access is needed. Therefore keep the repo safe from the attack, in case the server side is fallen.

How to

  1. Generate a ssh key