Skip to content

Instantly share code, notes, and snippets.

View renderorange's full-sized avatar

Blaine Motsinger renderorange

View GitHub Profile
@code4you2021
code4you2021 / notification.swift
Created November 8, 2021 02:18
Deliver an OSX notification with Swift
// Remember: import UserNotifications
func sendNotification(title: String, body: String = "") {
let content = UNMutableNotificationContent()
content.title = title
if body.count > 0 {
content.body = body
}
@briandfoy
briandfoy / new_password
Last active May 22, 2020 12:34
(Perl) generate some random passwords
#!/Users/brian/bin/perl -CASD
use v5.30;
use open qw(:std :utf8);
use Math::Random::Secure qw(irand rand);
=encoding utf8
=head1 NAME
@cmlewis89
cmlewis89 / arp-monitor.sh
Last active September 25, 2023 20:11
Bash script to monitor any new device connects to a network using arp
#!/bin/bash
#
# arp-monitor, an ARP tables monitor
# inspired by https://gist.github.com/maugern/30ace2764aafc683a802de2ed82f91af
#
# This script is intended to start on launch and run on an always connected device on a network (eg: server).
# It scans the network with 'arp -a' and sends a notification webhook whenever recognizes a new mac address on the network.
#
# For auto-run on login you can rename the script to a .command and add it to your Login items on Mac OS or
# modify the script to remove the loop and take a look at crontab
@Ovid
Ovid / Boilerplate.pm
Last active August 11, 2020 01:49
use less boilerplate
package Less::Boilerplate;
use 5.26.0;
use strict;
use warnings;
use feature ();
@jc-torresp
jc-torresp / raspberry-pi-plex-server.md
Last active April 23, 2024 14:29
Setup a Raspberry Pi Plex Media Server (Including external storage media and Windows to Raspbian migration)

Raspberry Pi Plex Server

Installation

Ensure our operating system is entirely up to date:

sudo apt-get update
sudo apt-get upgrade
@hannesbe
hannesbe / install-google-drive-ocamlfuse-debian.sh
Last active September 6, 2023 15:01 — forked from OneCDOnly/gist:972755c5c5825ddd819cb2729a52b646
Install 'google-drive-ocamlfuse' on Debian Stretch & Buster
#/bin/bash
# Installs google-drive-ocamlfuse on Debian (Stretch & Buster)
#
# Run this oneliner to make it happen
# bash <(curl -sSL https://gist.github.com/hannesbe/6c110e9de6644f07a48eecfdbe6b728d/raw)
sudo apt install -y software-properties-common dirmngr
sudo cat > /etc/apt/sources.list.d/alessandro-strada-ubuntu-ppa-bionic.list << EOF
deb http://ppa.launchpad.net/alessandro-strada/ppa/ubuntu xenial main
@mrothNET
mrothNET / LetsEncrypt+certbot+UFW+postfix+dovecot.md
Last active October 27, 2023 00:36
Let's Encrypt / Dovecot / Postfix / UFW firewall / Certbot

Let's Encrypt / Dovecot / Postfix / UFW firewall / Certbot

This tutorial describes how to install TLS to a mail server consisting of Postfix and/or Dovecot by using Let's Encrypt certificates with automatic renewing and firewall management.

The system used for this tutorial was:

$ lsb_release -idrc
Distributor ID: Ubuntu
@freem
freem / twitter-killjunk.js
Last active December 28, 2022 22:22
disabling extraneous twitter features
/* NOTICE: THIS WAS MADE BACK IN 2017, OF COURSE IT'S NOT GOING TO WORK WELL NOW THAT TWITTER'S FUCKED THINGS UP */
@namespace url(http://www.w3.org/1999/xhtml);
@-moz-document domain("twitter.com") {
[data-component-context="suggest_recap"],
[data-component-context="suggest_who_to_follow"],
[data-component-context="suggest_activity"],
[data-component-context="suggest_activity_tweet"],
[data-component-context="suggest_recycled_tweet_inline"],
[data-component-context="suggest_recycled_tweet"]{
@heri16
heri16 / NetwatchGatewayStates.rsc
Last active December 19, 2021 11:13
Mikrotik RouterOS Script to do proper uplink failover/failback (more reliable than Netwatch)
# Mikrotik RouterOS Script to do proper uplink failover/failback (more reliable than Netwatch).
# Supports both Generic and PPPoE interfaces.
# Policy: read, write, policy, test
### Configuration ###
# Define Names of all Interfaces that will be checked:
:local "interface-names" { "internet-speedy";"internet-biznet" };
@winebarrel
winebarrel / pg_show_grants.sql
Last active July 12, 2022 00:28
show grants for PostgreSQL
select
pg_user.usename,
t1.nspname,
t1.relname,
relacl.privilege_type,
relacl.is_grantable
from (
select
pg_namespace.nspname,
pg_class.relname,