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 / 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 / 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 / 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 / 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: []
@cmer
cmer / update_iptables.sh
Created November 8, 2020 02:22
Script to port-forward to a dynamic IP address. Run in CRON.
#!/bin/bash
HOST=myhost.example.com
IP=`dig +short $HOST | sed -e '1d'`
LAST_IP_FILE=/tmp/LAST_IP
LAST_IP=`cat $LAST_IP_FILE 2> /dev/null`
tcpPorts=(8080 8880 8843 8443)
udpPorts=(3478 10001)
@cmer
cmer / install_last.sh
Created June 16, 2020 19:05
Install last downloaded file on macOS
#/bin/bash
# Install the last downloaded file on macOS
dl_path=~/Downloads
last_dl=`ls -tl -A1 $dl_path/*.{dmg,pkg} | head -n1`
if [[ $last_dl == *.dmg ]]; then
echo "Installing DMG: $last_dl..."
VOLUME=$(hdiutil attach -nobrowse "$last_dl" | cut -f3 | tail -n1 ; exit ${PIPESTATUS[0]}) && (rsync -a "$VOLUME"/*.app /Applications/; SYNCED=$?
@cmer
cmer / pump.sh
Created May 1, 2020 17:26
Control Kraken pump from OSX
#!/bin/bash -xe
# brew install libusb
# pip3 install git+https://github.com/jonasmalacofilho/liquidctl
# https://github.com/jonasmalacofilho/liquidctl/blob/master/docs/nzxt-kraken-x-3rd-generation.md
liquidctl set pump speed 100
liquidctl set ring color covering-marquee FC5C7D 6A82FB 1EFF48 C2F970 564D80
liquidctl set logo color breathing FC5C7D 6A82FB 4E5166 44344F
@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 / gen-ssl.md
Last active May 30, 2020 02:25
Generating a wildcard self-signed SSL cert with custom Certificate Authority