Skip to content

Instantly share code, notes, and snippets.

@thehunmonkgroup
thehunmonkgroup / node-app
Last active June 1, 2022 20:27
Redhat init script for managing a NodeJS app via forever
#!/bin/sh
##
## Redhat / Linux / LSB
##
# chkconfig: 345 85 15
# description: Startup script for Express / Node.js application with the \
## forever module.
##
## A modification of https://gist.github.com/1339289
##
@thehunmonkgroup
thehunmonkgroup / apply_sysctl.sh
Created January 14, 2015 06:37
Shell script to reload all files in /etc/sysctl.d/
#! /bin/bash
# Source function library.
. /etc/init.d/functions
apply_sysctl
@thehunmonkgroup
thehunmonkgroup / jekyll-git-push.sh
Created January 14, 2015 22:31
Deploy a Jekyll site to a non-bare repository via git push
#!/bin/bash
#
# Utility script which can be used to trigger rebuild of a jekyll site that is
# managed via a git repository. Most often, you would call this script in the
# post-receive hook of a full (non-bare) git repository, such that the rebuild
# happens after a push.
#
# Run with no arguments for usage.
#
@thehunmonkgroup
thehunmonkgroup / reroute-queued-email-messages.sh
Last active October 17, 2022 11:48
Resend Postfix messages stuck in mail queue to another address
#!/bin/bash
# This script allows sending of messages stuck in the Postfix queue to another
# email address. Useful if the original email address is bad.
if [ $# -ne 2 ]; then
echo "Usage: reroute-queued-email-messages.sh <oldaddress> <newaddress>"
exit 1
fi
#!/bin/bash
#
# chkconfig: 35 90 12
# description: Start node apps.
#
# This grabs the name of the init script. The weird string match handles
# the case when the init script is called on boot as /etc/rcN/S90[name].
INIT_SCRIPT_BASENAME=`basename $0`
SERVICE=${INIT_SCRIPT_BASENAME#S90}
#!/bin/bash
# Spins up a quick Vagrant box. Run without arguments for help.
vagrant_dir="${HOME}/vagrant"
box_dir="temp"
ssh_port="2202"
ssh_pubkey_path="${HOME}/.ssh/id_rsa.pub"
custom_script="${HOME}/bin/custom-server-tools.sh"
vagrant_public_box_url="https://app.vagrantup.com/boxes/search"
@thehunmonkgroup
thehunmonkgroup / monit-managed-service.sh
Last active September 29, 2015 15:35
Redhat-style init script to manage a service using monit commands
#!/usr/bin/env sh
#
# chkconfig: - 99 12
# description: Start apps, monit wrapper.
#
# This script uses the monit process to handle starting and stopping a
# service. This can be used in server configuration management software to
# manage the service programatically, in the case where it's already being
# managed via monit.
@thehunmonkgroup
thehunmonkgroup / conference.conf.xml
Last active March 6, 2024 08:53
ClueCon talk 2016 - Videoconferencing with Verto, example code/config/links/slides
<configuration name="conference.conf" description="Audio Conference">
<!-- Other conference config... -->
<profiles>
<profile name="video-mcu-stereo">
<!-- Other profile config... -->
<!-- Mux the inbound video streams into one outbound stream. -->
<param name="video-mode" value="mux"/>
<!-- Enable the live array, minimize outbound video encoding. -->
<param name="conference-flags" value="livearray-sync|livearray-json-status|minimize-video-encoding"/>
<!-- Use this video layout by default if no other is specified. -->
@thehunmonkgroup
thehunmonkgroup / customize
Last active March 14, 2017 07:27
Debian scripts for starting/stopping a ramdisk
#!/bin/sh
RAMDISK_SIZE="256m"
MOUNT_POINT="/mnt/ramdisk"
USER=root
GROUP=root
PERMISSIONS=775
PRE_STOP_SCRIPT="/usr/local/bin/stop_ramdisk.sh"
@thehunmonkgroup
thehunmonkgroup / resources.md
Last active October 4, 2022 01:20
ClueCon 2017 presentation, building a WebRTC testing framework with open source tools