Skip to content

Instantly share code, notes, and snippets.

@richb-hanover
richb-hanover / QueryChinook.md
Last active January 10, 2023 04:37
Narrative for PRQL queries in the Chinook database

PRQL Tutorial

The PRQL language allows you to build a pipeline from a series of SQL-like commands, then compile those commands to correct SQL that can be used to make actual queries.

The PRQL Playground provides a way to, well, play with entering PRQL statements to see the resulting SQL. Enter the PRQL in the middle column, see the resulting SQL on the right. (Click output.sql)

@richb-hanover
richb-hanover / unifi-docker.md
Last active July 4, 2022 11:38
test of unifi-docker README in Github Markdown

Unifi-in-Docker (unifi-docker)

This repo contains a Dockerized version of Ubiqiti Network's Unifi Controller.

No more hassling with Controller, Java, or OS updates: a Docker container simplifies the installation procedure and eliminates problems with dependencies and versions.

The current version is Unifi Controller 7.1.66. This container has been tested on Ubuntu, Debian, and even Raspberry Pi hardware.

@richb-hanover
richb-hanover / wrong-speeds.md
Created May 22, 2022 11:06
Incorrect BPS readings at very low link speeds

I have used up my data cap on my LTE wifi hotspot, consequently, my cell provider is only giving speeds much lower than 100 kbps download. This is evidenced by these tests from Speedtest.net and betterspeedtest.sh

  1. Speedtest.net shows 0.6/3.6 mbps - https://www.speedtest.net/result/13183816484

  2. Betterspeedtest.sh shows 0.4/3.25 mbps

    √ OpenWrtScripts % sh betterspeedtest.sh -t 20 -p 4.2.2.1 -H netperf-west.bufferbloat.net -n 1
    2022-05-21 21:43:10 Testing against netperf-west.bufferbloat.net (ipv4) with 1 simultaneous sessions while pinging 4.2.2.1 (20 seconds in each direction)
    ........................
    

Installing YAMon on OpenWrt

The following steps will install the YAMon (Yet Another MONitor) software on your OpenWrt router. This procedure requires use of an SSH connection to your router.

Note: The procedure below has been tested with OpenWrt 19.07.

Prepare a USB drive for the router

You need external storage (for example, a USB memory stick) to hold the data collected by YAMon.

@richb-hanover
richb-hanover / conedata.js
Created June 22, 2020 03:05
Generate a "cone of data" - 24 "hours" of 30-second samples that have increasing variance
/**
* Generate a "cone of data" centered around a median value
*
* There will be 24 rows of data, each containing 120 samples.
* Each row is centered around a "median" value of 50
* Each row's sample is a random value multiplied by the "hour" so that
* later hours have a larger spread.
*
* This should have an obvious appearance in a plot
*/
@richb-hanover
richb-hanover / setup_accounts.yml
Created April 7, 2020 11:24
Ansible playbook for the *very first* connection to a newly-provisioned VPS
---
##############################################################
#
# setup_accounts.yml
#
# This Ansible playbook configures the accounts for an initial
# connection to a newly provisioned VPS. It performs the following tasks:
#
# 1. Log into the target server using the root password (not public key)
@richb-hanover
richb-hanover / how-to-install-astra-child-theme.md
Created April 30, 2018 11:50
"How to Install Astra Child Theme" suggestion

Child theme makes it easy to customize the theme files without having to worry about any updates breaking the changes you have made in the theme files.

You can generate a child theme for Astra from here.

  1. Enter the name you wish to give your child theme.
  2. If you want to add your own branding, click on advanced options and where you can edit the Theme name, version, author, author URL, description, folder name and screenshot.
  3. Once done, click on Generate. The child theme you just generated gets downloaded on your computer.
  4. You can now install it like any other WordPress theme.
  5. Feel free to copy any necessary Astra theme files in this child theme and customize them as you need.

In Astra Theme, the default header breakpoint is 921px. That means mobile header will be triggered at 921px screen size.

To change the default header breakpoint, edit the astra_header_break_point in a child theme. In the example below, the mobile header will be triggered at 1120px screen size. Change 1120 to the screen size of your choice.

/**
 * Change the breakpoint of the Astra Header Menus
 * 
 * @return int Screen width when the header should change to the mobile header.
 */
@richb-hanover
richb-hanover / Installing_Homenet.md
Last active January 6, 2021 09:32
Installing Homenet on LEDE/OpenWrt (DRAFT)

Installing Homenet on your Router

This set of instructions configures a fresh LEDE installation to run Homenet. They will likely work on a current build of OpenWrt.

There's lots of good info about Homenet elsewhere. See the External References section (below).

The general strategy is to connect your computer to the router's LAN Ethernet, convert the wireless and WAN interfaces to run Homenet, and test the changes so far. After things are working, configure the LAN Ethernet to Homenet through connect one of the (now Homenet) wireless interfaces.

  1. Install LEDE on your router. See the main Getting Started with LEDE page for details.