Skip to content

Instantly share code, notes, and snippets.

Avatar

Jerry Jacobs xor-gate

View GitHub Profile
@xor-gate
xor-gate / MailinatorAliases
Created Mar 13, 2020 — forked from nocturnalgeek/MailinatorAliases
A list of alternate domains that point to @mailinator.com
View MailinatorAliases
@binkmail.com
@bobmail.info
@chammy.info
@devnullmail.com
@letthemeatspam.com
@mailinater.com
@mailinator.net
@mailinator2.com
@notmailinator.com
@reallymymail.com
View FreeBSD Jails with VLAN HOWTO.md

This is an outdated draft that was used to review the content with FreeBSD contributors. For the latest revision, vist http://shawndebnath.com/articles/2016/03/27/freebsd-jails-with-vlan-howto.html.


FreeBSD Jails with VLAN HOWTO

This article discusses how to set up jails on a FreeBSD 11-CURRENT system utilizing VIMAGE (aka VNET) to provide a virtualized independent network stack for each jail with support for VLAN tagging.

Prerequisites

@xor-gate
xor-gate / Jenkinsfile
Created Oct 2, 2019 — forked from merikan/Jenkinsfile
Some Jenkinsfile examples
View Jenkinsfile
Some Jenkinsfile examples
View Jenkinsfile
def getProjectName() {
return 'JenkinsPipeline'
}
def getJDKVersion() {
return 'jdk1.8.0_101'
}
def getMavenConfig() {
return 'maven-config'
View armv6-alpine-linux-musleabihf-llvm.cmake
# CMake Toolchain file for cross compilation to Alpine 3.7 running on a Raspberry Pi via LLVM.
# Dec. 2017, Oliver Kuckertz <oliver.kuckertz@mologie.de>
# https://mologie.github.io/blog/programming/2017/12/25/cross-compiling-cpp-with-cmake-llvm.html
# License: MIT
# Where did you create the Alpine sysroot? Oliver has his cross-toolchains in ~/Toolchains.
SET(CMAKE_SYSROOT "$ENV{HOME}/Toolchains/sysroots/alpine-armhf")
# Where is LLVM/clang installed on your host? These are defaults for common platforms:
IF(APPLE)
@xor-gate
xor-gate / popen3_2007.c
Created May 29, 2019 — forked from mike-bourgeous/popen3_2007.c
Two implementations of a popen3() function in POSIX/C providing stdin, stdout, and stderr (http://blog.mikebourgeous.com/2011/06/12/programmatic-process-control-in-c-popen3/)
View popen3_2007.c
/*
* This implementation of popen3() was created in 2007 for an experimental
* mpg123 frontend and is based on a popen2() snippet found online. This
* implementation may behave in unexpected ways if stdin/stdout/stderr have
* been closed or modified. No warranty of its correctness, security, or
* usability is given. My modifications are released into the public domain,
* but if used in an open source application, attribution would be appreciated.
*
* Mike Bourgeous
* https://github.com/mike-bourgeous
View effective_modern_cmake.md

Effective Modern CMake

Getting Started

For a brief user-level introduction to CMake, watch C++ Weekly, Episode 78, Intro to CMake by Jason Turner. LLVM’s CMake Primer provides a good high-level introduction to the CMake syntax. Go read it now.

After that, watch Mathieu Ropert’s CppCon 2017 talk Using Modern CMake Patterns to Enforce a Good Modular Design (slides). It provides a thorough explanation of what modern CMake is and why it is so much better than “old school” CMake. The modular design ideas in this talk are based on the book [Large-Scale C++ Software Design](https://www.amazon.de/Large-Scale-Soft

@xor-gate
xor-gate / Jenkinsfile.groovy
Created May 8, 2019 — forked from Faheetah/Jenkinsfile.groovy
Jenkinsfile idiosynchrasies with escaping and quotes
View Jenkinsfile.groovy
node {
echo 'Results included as an inline comment exactly how they are returned as of Jenkins 2.121, with $BUILD_NUMBER = 1'
echo 'No quotes, pipeline command in single quotes'
sh 'echo $BUILD_NUMBER' // 1
echo 'Double quotes are silently dropped'
sh 'echo "$BUILD_NUMBER"' // 1
echo 'Even escaped with a single backslash they are dropped'
sh 'echo \"$BUILD_NUMBER\"' // 1
echo 'Using two backslashes, the quotes are preserved'
sh 'echo \\"$BUILD_NUMBER\\"' // "1"
@xor-gate
xor-gate / create-ssh-node.sh
Created May 2, 2019 — forked from Evildethow/create-ssh-node.sh
Jenkins: Create SSH node, using bash and curl
View create-ssh-node.sh
#!/usr/bin/env bash
set -o nounset -o errexit -o pipefail
usage() {
cat <<EOM
Usage:
$(basename $0) [OPTIONS]
$(basename $0) [ -j | --jenkins-url | -n | --node-name | -s | -d | --desc | --slave-home | -e | --executors | -sh | --ssh-host | -sp | --ssh-port
| -c | --cred-id | -l | --labels | -u | --user-id | -p | --password | -h | --help ]
@xor-gate
xor-gate / DumpHex.c
Created Apr 10, 2019 — forked from ccbrown/DumpHex.c
Compact C Hex Dump Function w/ASCII
View DumpHex.c
#include <stdio.h>
void DumpHex(const void* data, size_t size) {
char ascii[17];
size_t i, j;
ascii[16] = '\0';
for (i = 0; i < size; ++i) {
printf("%02X ", ((unsigned char*)data)[i]);
if (((unsigned char*)data)[i] >= ' ' && ((unsigned char*)data)[i] <= '~') {
ascii[i % 16] = ((unsigned char*)data)[i];