Skip to content

Instantly share code, notes, and snippets.

View calebpower's full-sized avatar

Caleb L. Power calebpower

View GitHub Profile
@triplepoint
triplepoint / _sshd_port_juggling.yml
Last active January 19, 2024 21:12
Ansible - fall back to a default ssh port if the configured ssh port fails
---
# This task list is intended to be imported by playbooks, before any
# other tasks are performed. It lets us determine whether the configured SSH
# port is available, and lets us fall back to the default port if necessary.
#
# The use case here is when a role in the playbook is configured to change the
# sshd port, but the first time the role is executed the host is still
# listening on the default port. With this check in place, we can fall back
# to the default port on the first run, and then on subsequent runs use the
# configured port.
@bmc
bmc / stack.sh
Created October 28, 2011 21:04
A stack implementation, in bash
# A stack, using bash arrays.
# ---------------------------------------------------------------------------
# Create a new stack.
#
# Usage: stack_new name
#
# Example: stack_new x
function stack_new
{
@rwoeber
rwoeber / gist:1010044
Created June 6, 2011 10:25
rather minimalistic ipfw rule-script (FreeBSD)
#!/bin/sh
# inspired by 1fbsdguru's stuff at:
# http://www.cyberciti.biz/faq/howto-setup-freebsd-ipfw-firewall/
# do not forget to set right ip!
ip="my.ip.address"
IPF="ipfw -q add"
# Loopback