Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View cmer's full-sized avatar

Carl Mercier cmer

  • Toronto, ON, Canada
View GitHub Profile
@cmer
cmer / haproxy.cfg
Last active April 15, 2024 09:54
Simple, no bullshit TCP port forwarding using HAProxy
listen l1
bind 0.0.0.0:443
mode tcp
timeout connect 4000
timeout client 180000
timeout server 180000
server srv1 host.example.com:9443
@cmer
cmer / LICENSE
Last active April 15, 2024 08:59
Tom-Select.js Tailwind UI theme
Copyright 2023 Carl Mercier
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 furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHE
@cmer
cmer / focal-master.sh
Created January 22, 2022 04:48
Installation script for Mail Piler (open source version) on Ubuntu 20.04 Focal
#!/bin/bash
#
#
# This script installs the latest open source version of Mail Piler (mailpiler.org) from the master
# branch on Bitbucket by compiling it from source. It also installs all dependencies, including a MySQL database.
#
# You should run this script as root on a vanilla Ubuntu 20.04 installation.
#
#
set -o errexit
@cmer
cmer / proxmox-fresh.sh
Last active January 4, 2024 10:40
Proxmox fresh install starter pack
#!/bin/bash
apt update -y
apt install -y lsb-release sudo vim screen curl htop
RELEASE=`lsb_release -sc`
# Install no-nag
cd /tmp
curl -s https://api.github.com/repos/Jamesits/pve-fake-subscription/releases/latest \
| grep "browser_download_url.*deb" \
@cmer
cmer / config.ru
Last active December 31, 2023 15:34
Gem In a Box basic authentication & authorization rackup file
#
# This is a simple rackup file for geminabox. It allows simple role-based authorization.
#
# roles:
# - developer
# - upload
# - delete
# - admin (can do anything)
#
# For example, a developer who can access the service and upload new gems would have the following roles: `%w(developer upload)
@cmer
cmer / waketv.lua
Last active September 21, 2023 10:08
Wake TV when MacOS wakes from sleep (Hammerspoon)
-- -------------------------------------------------------------------
-- THIS SCRIPT IS NOW DEPRECATED IN FAVOR OF A MORE ROBUST SOLUTION --
-- Please refer to https://github.com/cmer/lg-tv-control-macos/
-- -------------------------------------------------------------------
local tv_identifier = "LG TV"
local mac_address = "aa:bb:cc:dd:ee:ff"
local tv_found = (hs.screen.find(tv_identifier) ~= nil)
local debug = false -- Set to true to enable debug messages
@cmer
cmer / git-completion.sh
Created January 2, 2011 17:24
GIT Bash Prompt Awesomeness -- Shortened directory name, uncommitted changes indicator, commits not pushed indicator
#
# bash completion support for core Git.
#
# Copyright (C) 2006,2007 Shawn O. Pearce <spearce@spearce.org>
# Conceptually based on gitcompletion (http://gitweb.hawaga.org.uk/).
# Distributed under the GNU General Public License, version 2.0.
#
# The contained completion routines provide support for completing:
#
# *) local and remote branch names
@cmer
cmer / ping_check.sh
Last active March 9, 2023 17:12
Auto reboot pfSense if Internet is down
#!/bin/sh
#
# /usr/local/bin/ping_check.sh
#
# First sleep for 3 mins so that we don't run this code if box has only just booted and PPPoE not up yet.
/bin/sleep 180
test_http() {
url=${1:-http://captive.apple.com}
@cmer
cmer / whitelist_telnyx_ip.sh
Created November 13, 2021 14:13
Whitelist IP with Telnyx (cronjob)
#!/bin/bash
# This simple bash script will auto-update Telnyx with the network's public IP address when it changes.
# Simply add a cron job to call it every minute or so.
#
# requirements: apt install curl dnsutils jq
#
API_KEY="{{ API_KEY_HERE }}"
@cmer
cmer / .solargraph.yml
Created March 14, 2021 12:39
Default .solargraph.yml for solargraph-rails-init gem
include:
- "app/**/*.rb"
- "lib/**/*.rb"
exclude:
- spec/**/*
- test/**/*
- vendor/**/*
- ".bundle/**/*"
require: []
domains: []