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 <[email protected]> | |
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) |
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" ) && |
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 <[email protected]> | |
#include <stdbool.h> | |
#include <ctype.h> | |
char * | |
snake_to_camel(char * string) { | |
bool upper = true; | |
char * camel = string; |
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 <[email protected]> | |
#include <cmath> | |
template <typename T = double> | |
class welford { | |
public: | |
welford() : _count(0), _mean(T(0.0)), _squared_distance(T(0.0)) { } |
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 <[email protected]> | |
# | |
# /etc/rc.local: xinit /usr/lib/kiosk.sh & | |
# | |
# http://rss-glx.sourceforge.net/ | |
# https://github.com/PromyLOPh/pianobar | |
# https://github.com/FD-/RPiPlay |
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 |
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 <[email protected]> | |
for arg in "$@"; do | |
shift | |
case "$arg" in | |
# default = 144.390M | |
--iss|--ariss|--aprsat) FREQUENCY=145.825M ;; | |
--nz|--newzealand) FREQUENCY=144.575M ;; |
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 <[email protected]> | |
sync && | |
echo 3 > /proc/sys/vm/drop_caches && | |
echo 1 > /proc/sys/vm/compact_memory && | |
true | |
# |
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 <[email protected]> | |
exec git log --oneline "$@" @{u}.. | |
# |
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