Skip to content

Instantly share code, notes, and snippets.

View HarlemSquirrel's full-sized avatar

Kevin McCormack HarlemSquirrel

View GitHub Profile
@HarlemSquirrel
HarlemSquirrel / bundler.rb
Created November 27, 2017 15:41
Warbler 2.0.4 and Bundler 1.16.0 missing bundler.gemspec hack for lib/warbler/traits/bundler.rb
#--
# Copyright (c) 2010-2012 Engine Yard, Inc.
# Copyright (c) 2007-2009 Sun Microsystems, Inc.
# This source code is available under the MIT license.
# See the file LICENSE.txt for details.
#++
module Warbler
module Traits
# The Bundler trait uses Bundler to determine gem dependencies to
@HarlemSquirrel
HarlemSquirrel / site_status.sh
Created February 15, 2018 20:29
Montior the status and duration of a endpoint with a GET request
#!/bin/bash
GREEN='\033[0;32m'
RED='\033[0;31m'
NC='\033[0m' # No Color
if [ $# -eq 0 ]; then
printf "Usage:\n"
printf " $0 http://example.com [interval]\n"
exit 1
@HarlemSquirrel
HarlemSquirrel / pulseaudio-dlna.service
Last active September 20, 2023 22:03
a pulseaudio-dlna Unit file for systemd
## Systemd user unit file for pulseaudio-dlna
# Copy to: ~/.config/systemd/user/pulseaudio-dlna.service
# Enable: systemctl --user enable pulseaudio-dlna
[Unit]
Description=PulseAudio-DLNA Service
[Install]
WantedBy=default.target
@HarlemSquirrel
HarlemSquirrel / build_nitrogen_ubuntu_1604.sh
Last active May 15, 2018 02:10
Build Nitrogen on Ubuntu 16.04
# Building Nitrogen on Ubuntu 16.04
# https://github.com/l3ib/nitrogen
# Install dependencies
sudo apt-get install autoconf autopoint libgtk2.0-dev libgtkmm-2.4-dev libglib2.0-dev
# Download
cd ~/Downloads
wget https://github.com/l3ib/nitrogen/releases/download/1.6.1/nitrogen-1.6.1.tar.gz
@HarlemSquirrel
HarlemSquirrel / hydrapaper.desktop
Last active April 14, 2021 20:22
HydraPaper desktop menu entry for GNOME and flatpak
[Desktop Entry]
# Place this file in ~/.local/share/applications/
Name=hydrapaper
GenericName=HydraPaper
Comment=A Gtk utility to set two different backgrounds for each monitor on GNOME
Exec=flatpak run org.gabmus.hydrapaper
Terminal=false
Type=Application
StartupNotify=true
# https://github.com/GabMus/HydraPaper/raw/master/data/icons/org.gabmus.hydrapaper.svg
@HarlemSquirrel
HarlemSquirrel / 50unattended-upgrades
Created August 28, 2018 22:53
Raspbian Unattended Upgrades
// /etc/apt/apt.conf.d/50unattended-upgrades
// Unattended-Upgrade::Origins-Pattern controls which packages are
// upgraded.
//
// Lines below have the format format is "keyword=value,...". A
// package will be upgraded only if the values in its metadata match
// all the supplied keywords in a line. (In other words, omitted
// keywords are wild cards.) The keywords originate from the Release
// file, but several aliases are accepted. The accepted keywords are:
// a,archive,suite (eg, "stable")
@HarlemSquirrel
HarlemSquirrel / install_hydrapaper_u18.04.sh
Last active February 2, 2021 19:26
Install HydraPaper on Ubuntu 18.04
#!/bin/bash
# Install HydraPaper on Ubuntu 18.04
# No super user access required if flatpak is installed
# HarlemSquirrel.github.io
# Install flatpak
sudo apt install -y flatpak gnome-software-plugin-flatpak
# Add flathub repo for the current user
flatpak --user remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo
@HarlemSquirrel
HarlemSquirrel / PKGBUILD
Created September 15, 2018 06:01
ArchLinux PKGBUILD for rocm-opencl
# Maintainer: Kevin McCormack <harlemsquirrel@gmail.com
pkgname=rocm-opencl
pkgver=1.2.0
pkgverdate=2018090737
pkgrel=2
_debfile=rocm-opencl_${pkgver}-${pkgverdate}_amd64.deb
pkgdesc="ROCm Platform Runtime: Closed source opencl"
arch=('x86_64')
url="https://github.com/RadeonOpenCompute/ROCm"
license=('EULA')
@HarlemSquirrel
HarlemSquirrel / haproxy.cfg
Created November 29, 2018 02:27
HAProxy config with SSL for OctoPi Raspbian Stretch
# /etc/haproxy/haproxy.cfg
global
maxconn 4096
user haproxy
group haproxy
daemon
log 127.0.0.1 local0 debug
# Default SSL material locations
ca-base /etc/ssl/certs
@HarlemSquirrel
HarlemSquirrel / type_on_wayland.py
Created February 5, 2020 00:20
Sample test sending keys on Wayland from string to emulate typing.
import sys
import time
# https://pypi.org/project/evdev/
import evdev
string = 'We are typing this 1!'
with evdev.UInput() as ui:
escape = False