Skip to content

Instantly share code, notes, and snippets.

View arcticlinux's full-sized avatar

Michael Best arcticlinux

  • Arctic Linux
  • Edmonton, Alberta
View GitHub Profile
@arcticlinux
arcticlinux / HowTo
Created April 26, 2021 19:12 — forked from s3rj1k/HowTo
Ubuntu 20.04.2 AutoInstall
# Docs:
- https://wiki.ubuntu.com/FoundationsTeam/AutomatedServerInstalls
- https://wiki.ubuntu.com/FoundationsTeam/AutomatedServerInstalls/ConfigReference
- https://cloudinit.readthedocs.io/en/latest/topics/datasources/nocloud.html
- https://discourse.ubuntu.com/t/please-test-autoinstalls-for-20-04/15250/53
# Download ISO Installer:
wget https://ubuntu.volia.net/ubuntu-releases/20.04.2/ubuntu-20.04.2-live-server-amd64.iso
# Create ISO distribution dirrectory:
@arcticlinux
arcticlinux / Acceptance.php
Last active December 21, 2020 17:52 — forked from SimonEast/Acceptance.php
Codeception - how to test for redirects
<?php
// Simply place the following two functions in _support/Helper/Acceptance.php
// Then you can call $I->verifyRedirect(...) inside your tests
//
// 2020-12-21 Updated from https://gist.github.com/SimonEast/b550e04300ac56cb5ac8eea704fccdfa
// - tested using Codeception v4.1.12
// - change backwards order of arguments in asserts, expected argument should be first
// - add additional type hints
// - add exception types
// - make asserts type safe
@arcticlinux
arcticlinux / bootstrap_size_indicator.html
Last active July 28, 2020 19:27 — forked from csim/bootstrap_size_indicator.html
Bootstrap 4 size indicator
<div style="position: fixed; top: 0; left: 0; z-index: 10000;">
<button class="d-block d-sm-none">Extra Small (xs)</button>
<button class="d-none d-sm-block d-md-none">Small (sm)</button>
<button class="d-none d-md-block d-lg-none">Medium (md)</button>
<button class="d-none d-lg-block d-xl-none">Large (lg)</button>
<button class="d-none d-xl-block">X-Large (xl)</button>
</div>
@arcticlinux
arcticlinux / notify.sh
Last active June 10, 2024 12:54 — forked from ElliotNB/notify.sh
Email sysadmin on every login from a new IP address
#!/bin/bash
##
## New IP login notification script
## 2009-11-20 00:28 Samuele ~redShadow~ Santi
## 2018-06-04 12:53 ElliotNB
## 2018-10-17 17:55 ElliotNB - bug fixes for non-interactive sessions and `sudo su` commands
## 2019-08-27 16:15 mbest - update geoip lookup awk syntax, add mktemp for temporary directory,
## - add delete TMP_DIR function and trap to delete it for assurance,
## - change emails to example.com, add xargs to trim output
## Licensed under GPL
@arcticlinux
arcticlinux / esp8266-basis.ino
Created December 19, 2018 20:32 — forked from mhelff/esp8266-basis.ino
Basic Arduino sketch for ESP8266 including WifiManager and OTA update
#include <ESP8266WiFi.h>
#include <ESP8266mDNS.h>
#include <ArduinoOTA.h>
#include <WiFiManager.h>
void setup() {
Serial.begin(115200);
Serial.println("Booting");
WiFiManager wifiManager;
@arcticlinux
arcticlinux / pg_extract.sh
Created August 14, 2017 02:50 — forked from brock/pg_extract.sh
Extract all databases (or one by name) from a sql file created by pg_dumpall
#!/bin/bash
# extract all postgres databases from a sql file created by pg_dumpall
# this script outputs one .sql file for each database in the original .sql file
# unless you pass the name of a database in the dump
if [ $# -lt 1 ]
then
echo "Usage: $0 <postgresql sql dump> [dbname]" >&2
exit 1
fi
@arcticlinux
arcticlinux / check_postgres_replication.py
Created July 18, 2012 16:27 — forked from jacobian/check_postgres_replication.py
Nagios plugin to check PostgreSQL 9 streaming replication lag.
#!/usr/bin/env python
"""
Nagios plugin to check PostgreSQL 9 streaming replication lag.
Requires psycopg2 and nagiosplugin (both installable with pip/easy_install).
MIT licensed:
Copyright (c) 2010 Jacob Kaplan-Moss. All rights reserved.