View CMakeLists.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# SPDX-License-Identifier: Unlicense | |
# Author: Derrick Lyndon Pallas <derrick@pallas.us> | |
cmake_minimum_required(VERSION 3.1) | |
cmake_policy(SET CMP0076 NEW) | |
set(default_build_type "Release") | |
if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES) | |
set(CMAKE_BUILD_TYPE "${default_build_type}" CACHE | |
STRING "Choose the type of build." FORCE) |
View spamhaus-update.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Author: Derrick Pallas | |
# License: zlib | |
BASE='spamhaus-set' | |
TEMP=${BASE}$$ | |
ipset create -exist "$BASE" hash:net || exit 1 | |
iptables -w 300 -nL INPUT | grep -q "$BASE" || | |
( | |
( iptables -N "$BASE" || iptables -F "$BASE" ) && |
View snake_to_camel.c
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// SPDX-License-Identifier: Unlicense | |
// Author: Derrick Lyndon Pallas <derrick@pallas.us> | |
#include <stdbool.h> | |
#include <ctype.h> | |
char * | |
snake_to_camel(char * string) { | |
bool upper = true; | |
char * camel = string; |
View welford.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// SPDX-License-Identifier: MIT | |
// Author: Derrick Lyndon Pallas <derrick@pallas.us> | |
#include <cmath> | |
template <typename T = double> | |
class welford { | |
public: | |
welford() : _count(0), _mean(T(0.0)), _squared_distance(T(0.0)) { } |
View kiosk.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# SPDX-License-Identifier: Unlicense | |
# Author: Derrick Lyndon Pallas <derrick@pallas.us> | |
# | |
# /etc/rc.local: xinit /usr/lib/kiosk.sh & | |
# | |
# http://rss-glx.sourceforge.net/ | |
# https://github.com/PromyLOPh/pianobar | |
# https://github.com/FD-/RPiPlay |
View tmux.conf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
unbind C-b | |
set -g prefix C-a | |
bind-key a send-prefix | |
bind-key C-c new-window | |
bind-key C-a last-window | |
bind-key C-n next-window | |
bind-key C-p previous-window | |
bind-key C-d detach-client | |
setw -g aggressive-resize on |
View aprs.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# SPDX-License-Identifier: Unlicense | |
# Author: Derrick Lyndon Pallas <derrick@pallas.us> | |
for arg in "$@"; do | |
shift | |
case "$arg" in | |
# default = 144.390M | |
--iss|--ariss|--aprsat) FREQUENCY=145.825M ;; | |
--nz|--newzealand) FREQUENCY=144.575M ;; |
View spring-cleaning.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# SPDX-License-Identifier: Unlicense | |
# Author: Derrick Lyndon Pallas <derrick@pallas.us> | |
sync && | |
echo 3 > /proc/sys/vm/drop_caches && | |
echo 1 > /proc/sys/vm/compact_memory && | |
true | |
# |
View git-me.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# SPDX-License-Identifier: Unlicense | |
# Author: Derrick Lyndon Pallas <derrick@pallas.us> | |
exec git log --oneline "$@" @{u}.. | |
# |
View fancy_debug.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// SPDX-License-Identifier: Unlicense | |
bool global_debug = false; | |
#define DEBUG(format, ...) do { \ | |
if (global_debug) \ | |
fprintf(stderr, "%s:%d %s " format "\n", __FILE__, __LINE__, __FUNCTION__, ## __VA_ARGS__); \ | |
} while(false) |
NewerOlder