Skip to content

Instantly share code, notes, and snippets.

View orgcontrib's full-sized avatar
:octocat:
contributing

Org Contrib orgcontrib

:octocat:
contributing
View GitHub Profile
@stenuto
stenuto / hls.sh
Created November 7, 2024 16:58
HLS ffmpeg script
#!/bin/bash
# Function to display usage information
usage() {
echo "Usage: $0 /path/to/input.mp4 [ /path/to/output_directory ]"
exit 1
}
# Check if at least one argument (input file) is provided
if [ $# -lt 1 ]; then
@timothyham
timothyham / ipv6guide.md
Last active November 14, 2024 21:08
A Short IPv6 Guide for Home IPv4 Admins

A Short IPv6 Guide for Home IPv4 Admins

This guide is for homelab admins who understand IPv4s well but find setting up IPv6 hard or annoying because things work differently. In some ways, managing an IPv6 network can be simpler than IPv4, one just needs to learn some new concepts and discard some old ones.

Let’s begin.

First of all, there are some concepts that one must unlearn from ipv4:

Concept 1

@brianwoo
brianwoo / README.MD
Last active November 3, 2024 22:17
KVM Guest Tools

Debian or Kali Linux installed to as KVM (libvirtd) guests do not automatically have qemu-guest-agent or spice-vdagent installed. This will prevent seamless movement of the mouse cursor between the guest and host desktop in Virtual Machine Manager (requiring the use of a Ctrl-Alt to release the cursor from the guest window).

To cure this, install both qemu-guest-agent and spice-vdagent on each guest and reboot (the guests).

sudo apt install qemu-guest-agent
sudo apt install spice-vdagent
sudo apt install xserver-xorg-video-qxl
vSphere 6 Enterprise Plus:
1C20K-4Z214-H84U1-T92EP-92838
1A2JU-DEH12-48460-CT956-AC84D
MC28R-4L006-484D1-VV8NK-C7R58
5C6TK-4C39J-48E00-PH0XH-828Q4
4A4X0-69HE3-M8548-6L1QK-1Y240
vSphere with Operations Management 6 Enterprise:
4Y2NU-4Z301-085C8-M18EP-2K8M8
1Y48R-0EJEK-084R0-GK9XM-23R52
@YuriyGuts
YuriyGuts / install-persistent-touch-id-sudo.sh
Last active February 2, 2022 13:04
Installs a PAM configuration script as a macOS launch daemon so that Touch ID for sudo is always available and persists across OS updates
#!/usr/bin/env bash
# This script installs a PAM configuration script as a macOS launch daemon
# so that Touch ID for sudo is always available and persists across OS updates.
# NOTE: You might need to allow /usr/bin/env in Security & Privacy > Full Disk Access.
set -euo pipefail
PACKAGE_NAME="com.yuriyguts.persistent-touch-id-sudo"
CONFIG_SCRIPT_INSTALL_PATH="/usr/local/bin/${PACKAGE_NAME}.sh"
@Gowee
Gowee / uacme-cloudflare-hook.sh
Last active March 9, 2024 01:29
DNS-01 challenge hook script of uacme for Cloudflare
#!/bin/sh
# Copyright (C) 2020 Michel Stam <[email protected]>
# Copyright (C) 2021 Hung-I Wang <[email protected]>
#
# The script is adatped from:
# https://github.com/ndilieto/uacme/blob/5edec0eea1bcf6f454ec1787297c2408c2f2e97a/nsupdate.sh
#
# Licensed under the the GNU General Public License <http://www.gnu.org/licenses/>.
# The script is meant to be used as a hook script of uacme to update TXT records for acme challenges.
@CHSuworatrai
CHSuworatrai / VMware vSphere 6.x Licence Keys
Created April 8, 2021 09:20 — forked from DVSB/VMware vSphere 6.x Licence Keys
VMware vSphere 6 and 7 Licence Keys
VMware vSphere 6 Enterprise Plus
1C20K-4Z214-H84U1-T92EP-92838
1A2JU-DEH12-48460-CT956-AC84D
MC28R-4L006-484D1-VV8NK-C7R58
5C6TK-4C39J-48E00-PH0XH-828Q4
4A4X0-69HE3-M8548-6L1QK-1Y240
VMware vSphere with Operations Management 6 Enterprise
4Y2NU-4Z301-085C8-M18EP-2K8M8
1Y48R-0EJEK-084R0-GK9XM-23R52
@alexg0
alexg0 / auto_sudo_via_watch_and_tid.sh
Last active February 2, 2022 13:04 — forked from carlosonunez/auto_sudo_via_watch_and_tid.sh
Enable support for sudo via Apple Watch and Touch ID
#! /bin/bash
APPLE_WATCH_PAMID_LIBPATH=/usr/local/lib/pam/pam_watchid.so.2
APPLE_WATCH_PAMID_URL=https://github.com/msanders/pam-watchid
APPLE_WATCH_PAMID_PATH=$HOME/src/pamid-applewatch
enable_sudo_with_apple_watch_and_touch_id() {
trap 'popd' EXIT INT HUP
enable_apple_watch() {
if ! test -f $APPLE_WATCH_PAMID_LIBPATH
@edwintorok
edwintorok / rdrand.c
Created January 11, 2021 23:13
gcc rdrand.c -O2 -o rdrand -fopenmp -Wall
/* SPDX-License-Identifier: LGPL-2.1-or-later */
#if defined(__i386__) || defined(__x86_64__)
#include <cpuid.h>
#endif
#include <errno.h>
#include <limits.h>
#include <stdbool.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#!/bin/bash
set -eu
# Based on:
# https://gist.githubusercontent.com/bboozzoo/d4b142229b1915ef7cc0cf8593599ad9/raw/367f593d7ef61a3659951f42c699e86820a8db75/reproduce.sh
export LC_ALL=C
LOOPS=40
COUNT="${COUNT-20}"