Skip to content

Instantly share code, notes, and snippets.

View colstrom's full-sized avatar

Chris Olstrom colstrom

View GitHub Profile
@colstrom
colstrom / gistpkg.zpl
Last active December 9, 2016 19:21
smf-minecraft: an SMF service manifest for minecraft
name = smf-minecraft
author = Chris Olstrom
license = MIT
provides = smf/minecraft
requires
command/java
#!/bin/sh
# The MIT License (MIT)
# Copyright (c) 2016 Chris Olstrom <[email protected]>
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
@colstrom
colstrom / docker-flatten-image.sh
Last active December 9, 2016 19:59
docker-flatten-image.sh: flattens docker images
#!/bin/sh
# The MIT License (MIT)
# Copyright (c) 2016 Chris Olstrom <[email protected]>
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
@colstrom
colstrom / gistpkg.zpl
Last active December 9, 2016 18:53
import-services: imports services from mounted persistence to ephemeral rootfs
name = import-services
author = Chris Olstrom
license = MIT
provides = command/import-services
requires
command/execlineb
@colstrom
colstrom / gistpkg.zpl
Last active December 9, 2016 19:55
service-ssh-tunnel: creates an SSH tunnel
name = ssh-tunnel
author = Chris Olstrom
license = MIT
provides = service/ssh-tunnel
requires
command/execlineb
@colstrom
colstrom / commands-in-apk.fish
Last active December 9, 2016 06:41
commands-in-apk.fish: prints a list of commands in an Alpine .apk package
function commands-in-apk
for package in $argv
apk info --contents {$package} | string match --all --regex '^(usr/)?s?bin/.*'
end
end
@colstrom
colstrom / empty.fish
Last active December 9, 2016 06:43
empty.fish: sugar for test with less surprising results
function empty
switch (count $argv)
case 0
true
case '*'
for string in $argv
test -z "$string"
and return (true)
end
end
@colstrom
colstrom / gistpkg.zpl
Last active December 9, 2016 06:44
unset.fish: compatibility shim for bash unset
name = unset
author = Chris Olstrom
license = MIT
provides = fish/functions/unset
requires
fish/builtin/end
@colstrom
colstrom / gistpkg.zpl
Last active December 9, 2016 06:57
status-to-bool.fish: converts exit statuses into boolean values
name = status-to-bool
author = Chris Olstrom
license = MIT
provides = fish/functions/status-to-bool
requires
fish/builtin/and
@colstrom
colstrom / gistpkg.zpl
Last active December 9, 2016 06:40
string-to-bool.fish: coerces strings into fixed true/false values
name = string-to-bool
author = Chris Olstrom
license = MIT
provides = fish/functions/string-to-bool
requires
fish/builtin/case