Skip to content

Instantly share code, notes, and snippets.

Living the dream

Jeffrey Clark h0tw1r3

Living the dream
View GitHub Profile
robinsmidsrod /
Last active Dec 2, 2021
Bootstrapping full iPXE native menu with customizable default option with timeout (also includes working Ubuntu 12.04 preseed install)

Add the following chunk to your existing ISC dhcpd.conf file.

if exists user-class and ( option user-class = "iPXE" ) {
    filename "http://boot.smidsrod.lan/boot.ipxe";
else {
    filename "undionly.kpxe";

(or see for a more elaborate setup

samhocevar / gist:00eec26d9e9988d080ac
Last active Nov 25, 2021
Configure sshd on MSYS2 and run it as a Windows service
View gist:00eec26d9e9988d080ac
# — configure sshd on MSYS2 and run it as a Windows service
# Please report issues and/or improvements to Sam Hocevar <>
# Prerequisites:
# — MSYS2 itself:
# — admin tools: pacman -S openssh cygrunsrv mingw-w64-x86_64-editrights
cerebrate /
Last active Nov 20, 2021
Recompile your WSL2 kernel - support for snaps, apparmor, lxc, etc.


See below before doing anything else.

Recompile your WSL2 kernel - support for snaps, apparmor, lxc, etc.

Yes, I've done this, and yes, it works. It is, however, entirely unsupported and assembled through reasonable guesswork, so if you try this and it explodes your computer, brain, career, relationships, or anything else, you agree that you take sole responsibility for doing it, that I never claimed it was a good idea, and that you didn't get these instructions from me .


Installing multipath tools on PVE Cluster with shared storage

This cheatsheet shows how to install and configure multipath tools on Proxmox PVE Cluster where multiple nodes share single storage with multipath configuration, for example SAN storage connected to each of the nodes by two independent paths.

Proxmox PVE version

This cheatsheet has been tested on Proxmox 5.x.

Note about sudo

I do not prepend sudo command to any of commands listed here, but keep in mind that nearly all commands requires su privileges, so use sudo if your account happen to not have root access.

Twinklebear / main.cpp
Last active Oct 8, 2021
Example of render to texture with SDL2
View main.cpp
#include <iostream>
#ifdef __linux__
#include <SDL2/SDL.h>
#elif defined(_WIN32)
#include <SDL.h>
const int WIN_WIDTH = 640;
const int WIN_HEIGHT = 480;
fernandoaleman /
Created Nov 18, 2011
How to sign your custom RPM package with GPG key
# How to sign your custom RPM package with GPG key
# Step: 1
# Generate gpg key pair (public key and private key)
# You will be prompted with a series of questions about encryption.
# Simply select the default values presented. You will also be asked
# to create a Real Name, Email Address and Comment (comment optional).
# If you get the following response:
LiamHaworth / notifyAddrChange.go
Created Jun 22, 2017
A simple go program leveraging the Window API to listen for IPv4 network address change events
View notifyAddrChange.go
package main
import (
cjthompson / RobustPDO.php
Created Feb 3, 2014
Extended PDO class that detects dropped connections and reconnects
View RobustPDO.php
class RobustPDO extends PDO
/** Call setAttribute to set the session wait_timeout value */
/** @var array */
protected $config = [];
/** @var bool For lazy connection tracking */
tnolet /
Last active May 13, 2021
PuppetDB is awesome. Here's some tips on accessing the data in the Postgresql database...most of 'm just reminders for myself.

NB: The following examples where done on Puppet Enterprise 3.0 running on Centos 6. Should be similar for open source versions, except for some file locations.

1. Logging into the PuppetDB PostgresQL database on Linux

The easiest way to snoop around in de actual PuppetDB postgres database is using the command prompt. You have to be the peadmin user though. Couldn't get it working just under root.

[root@master bin]# sudo su - pe-postgres -s /bin/bash
-bash-4.1$ /opt/puppet/bin/psql
psql (9.2.4)
Type "help" for help.
larsch / PrecompiledHeader.cmake
Last active Mar 18, 2021
cmake module for setting up precompiled headers (MSVC & GCC)
View PrecompiledHeader.cmake
# Function for setting up precompiled headers. Usage:
# add_library/executable(target
# pchheader.c pchheader.cpp pchheader.h)
# add_precompiled_header(target pchheader.h
# [SOURCE_C pchheader.c]
# [SOURCE_CXX pchheader.cpp])