Skip to content

Instantly share code, notes, and snippets.

Travis Paul travispaul

Block or report user

Report or block travispaul

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
travispaul /
Last active Aug 3, 2019
Setting a default value for $@ (sh vs dash vs ksh vs bash)
somefn() {
local args="${@:-something}"
echo "Value of \$args: $args"
View notes.txt
httpd -X
<b>Warning</b>: PHP Startup: Unable to load dynamic library '' (tried: /opt/pkg/lib/php/20170718/ (dlopen(/opt/pkg/lib/php/20170718/, 9): Symbol not found: _executor_globals
Referenced from: /opt/pkg/lib/php/20170718/
Expected in: flat namespace
in /opt/pkg/lib/php/20170718/, /opt/pkg/lib/php/20170718/ (dlopen(/opt/pkg/lib/php/20170718/, 9): image not found)) in <b>Unknown</b> on line <b>0</b><br />
php72-pdo_mysql-7.2.4 = PHP extension for PHP Data Objects (MySQL)
php72-pdo-7.2.4 = PHP extension for PHP Data Objects (base)
php72-mysqli-7.2.4 = PHP5 extension for MySQL 4.1 and later databases
View local-pkgin.txt
root@netbsd# pkgin -v
pkgin 0.10.1 for NetBSD-7.1.2 x86_64 (using SQLite
root@netbsd# pkgin -f -y in rsync
pkg_summary.bz2 0% 0 0.0KB/s --:-- ETA
cleaning database from entries...
pkg_summary.bz2 100% 39KB 39.1KB/s 00:00
empty available packages list
nothing to do.
travispaul /
Created May 11, 2018
Prevent crash on NetBSD and OpenBSD when no swap is configured.
--- salt/grains/ 2018-05-11 13:12:38.000000000 +0000
+++ salt/grains/
@@ -450,11 +450,13 @@ def _bsd_memdata(osdata):
mem = __salt__['']('{0} -n hw.physmem64'.format(sysctl))
grains['mem_total'] = int(mem) // 1024 // 1024
travispaul /
Last active Jan 26, 2018
module.exports how to return a function value?

The return value of getAOLDataCount is undefined. You're returning the aolCount variable from within an anonymous function in your .then() call and it's not being returned.

It's basically the same as this:

module.exports = {
    getAOLDataCount:  function () {
        wd = new WeeklyData(sequelize, Sequelize.DataTypes);
        wd.count({where: {week:201740, project: 8}}).then(function (aolCount) {
            return aolCount;
travispaul /
Created Oct 2, 2017
Alias for copying commits between forks
copycommit () {
if [ $# -lt 2 ]; then
echo -e "Usage:\n copycommit /path/to/repo commithash1 commithash2 ..."
return 1
shift 1
if [ ! -d "$repo" ]; then
echo "$repo is not a git repo"
return 1
travispaul / cowsay9k.js
Created Jul 13, 2017
Cowsay test bot for MatterMost outgoing webhook
View cowsay9k.js
var express = require('express');
var cowsay = require('cowsay');
var bodyparser = require('body-parser');
var app = express();
app.use(bodyparser.urlencoded({ extended: true }));
app.get('/', function (req, res) {
res.end('<pre>'+ cowsay.say({text: 'Moo'}) + '</pre>');
travispaul /
Created May 1, 2017
Networking config for Beaglebone Black
# ifconfig
lo0: flags=0x8049<UP,LOOPBACK,RUNNING,MULTICAST> mtu 33180
        inet6 ::1/128 flags 0x20<NODAD>
        inet6 fe80::1%lo0/64 flags 0x0 scopeid 0x1
        inet flags 0x0
cpsw0: flags=0x8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> mtu 1500
        address: c8:a0:30:aa:65:c4
        media: Ethernet autoselect (100baseTX full-duplex)
        status: active
travispaul / npf.conf
Created Mar 30, 2017
Example npf config to redirect ports 80/443 to unprivileged ports
View npf.conf
$ext_if = "vioif0"
$ext_v4 = inet4(vioif0)
map $ext_if dynamic XXX.XXX.XXX.XXX port 8080 <- $ext_v4 port 80
map $ext_if dynamic XXX.XXX.XXX.XXX port 4443 <- $ext_v4 port 443
group default {
pass final on lo0 all
pass final on $ext_if all
travispaul /
Created Feb 9, 2017
Create an RBAC policy with ALL rules (for testing)
sdc-policy create --name='kitchensink' --rules='can putdirectory' --rules='can getdirectory' --rules='can deletedirectory' --rules='can putobject' --rules='can getobject' --rules='can deleteobject' --rules='can putlink' --rules='can createjob' --rules='can listjobs' --rules='can getjob' --rules='can managejob' --rules='can getaccount' --rules='can updateaccount' --rules='can listkeys' --rules='can getkey' --rules='can createkey' --rules='can deletekey' --rules='can listusers' --rules='can getuser' --rules='can createuser' --rules='can updateuser' --rules='can changeuserpassword' --rules='can deleteuser' --rules='can listroles' --rules='can getrole' --rules='can createrole' --rules='can updaterole' --rules='can deleterole' --rules='can setroletags' --rules='can listpolicies' --rules='can getpolicy' --rules='can createpolicy' --rules='can updatepolicy' --rules='can deletepolicy' --rules='can listuserkeys' --rules='can getuserkey' --rules='can createuserkey' --rules='can deleteuserkey' --rules='can listdatacente
You can’t perform that action at this time.