View aria2.daemon
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
continue | |
dir=/var/www/downloads | |
file-allocation=falloc | |
max-connection-per-server=4 | |
max-concurrent-downloads=2 | |
max-overall-download-limit=0 | |
min-split-size=25M | |
rpc-allow-origin-all=true | |
rpc-secret=YouShouldChangeThis | |
input-file=/var/tmp/aria2c.session |
View pe-backup.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 | |
# | |
# Puppet Enterprise backup script | |
# | |
# Limits retained backup archives | |
# Optionally creates a backup of the PE service secure keys | |
# | |
# All arguments supplied via environment variables. | |
# | |
# License: MIT |
View resolv.rb
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
# local resolver configuration | |
require 'resolv' | |
Facter.add('resolv') do | |
setcode do | |
Resolv::DNS::Config.default_config_hash | |
end | |
end |
View loggertest.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 | |
TMPFILE=$(mktemp) | |
finish() { | |
rm -f "${TMPFILE}" | |
} | |
trap 'finish' EXIT | |
UNIQ_LINES=20 |
View region_tzinfo.rb
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
Facter.add('region_tzinfo') do | |
ec2m = Facter.value(:ec2_metadata) | |
# aws instances that have not been powercycled in 2+ years | |
# will not have region in the metadata | |
aws_zone = ec2m.dig('placement', 'availability-zone') | |
iana_tz = case aws_zone | |
when %r{^ap-southeast-1} | |
'Asia/Singapore' | |
when %r{^ap-southeast-2} | |
'Australia/Sydney' |
View catalog.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
puppet plugin download --verbose | |
puppet facts upload --verbose | |
curl "https://$(puppet config print server):8140/puppet/v3/catalog/$(hostname -f)?environment=$(puppet config print environment)" \ | |
--cert $(puppet config print hostcert) \ | |
--cacert $(puppet config print localcacert) \ | |
--key "$(puppet config print hostprivkey)" \ | |
--silent | jq . > catalog.json | |
jq '.resources[] | select(.parameters.recurse == true )' catalog.json |
View test.pp
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
exec { 'override-service-unit': | |
provider => 'shell', | |
environment => ['SYSTEMD_EDITOR=tee'], | |
command => 'echo "[Service]\nPrivateTmp=no\n" | script -qefc "systemctl edit nutcracker.service" /dev/null', | |
unless => '/usr/bin/env systemctl show nutcracker.service --property=PrivateTmp | grep "=no"', | |
notify => Service['nutcracker'], | |
} |
View Crosstool NG 1.22, Raspberry PI
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
$ git clone -b 1.22 https://github.com/crosstool-ng/crosstool-ng.git | |
$ cd crosstool-ng | |
$ ./bootstrap | |
$ ./configure --prefix=/usr/local | |
$ make | |
$ sudo make install | |
$ cd .. | |
$ mkdir ctng | |
$ cd rpi1 | |
$ ct-ng menuconfig |
View mingw-copy-deps.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
#!/usr/bin/env bash | |
# | |
# Copyright: © 2015 Jeffrey Clark <https://github.com/h0tw1r3/> | |
# License: GPLv3 (http://www.gnu.org/licenses/gpl-3.0.html) | |
# | |
set -o errtrace | |
error() { | |
echo "ERROR in $0 : line $1 exit code $2" | |
exit $2 |
View docker_cleanup_beaker.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
# clean up all beaker containers and images | |
# useful when using BEAKER_destroy=no | |
function docker-cleanup-beaker() { | |
while read i; do | |
X=($i) | |
echo -n "Cleaning up ${X[2]}: stopping container" | |
docker stop "${X[0]}" >/dev/null | |
echo -n ", removing container" | |
docker rm "${X[0]}" >/dev/null | |
echo -n ", removing images" |
NewerOlder