Skip to content

Instantly share code, notes, and snippets.

View balupton's full-sized avatar
🧙‍♀️
Working on Dorothy, a dotfile ecosystem

Benjamin Lupton balupton

🧙‍♀️
Working on Dorothy, a dotfile ecosystem
View GitHub Profile
#!/usr/bin/env bash
counter=1
echo "demo: error state"
while [ $counter -le 25 ]; do
printf "\x1b]9;4;2;${counter}\x07"
((counter++))
sleep 0.1
done
echo "demo: normal state"
@Kaptensanders
Kaptensanders / vs
Last active April 9, 2025 13:26
Open VSCode .code-workspace file from within devcontainer - from terminal
#!/usr/bin/env bash
if [ "$1" == "--help" ]; then
cat << EOF
Run from project folder, auto opens vscode in some mode depending on folder contents:
* Folder contains .devcontainer/devcontainer.json and <name>.code-workspace file: vscode opens in devcontainer, workspace file is loaded
* Folder contains .devcontainer/devcontainer.json: vscode opens in devcontainer
* Folder contains <name>.code-workspace file: Workspace is opened in vscode
@mvandermeulen
mvandermeulen / accessing-apple-screen-time-data.md
Created July 29, 2023 21:30 — forked from 0xdevalias/accessing-apple-screen-time-data.md
Some notes on accessing / exporting Apple's Screen Time data

Accessing / Exporting Apple's Screen Time Data

Some notes on accessing / exporting Apple's Screen Time data

  • From ChatGPT (Ref):
    • Note: This seems to be wrong, at least on macOS Ventura.. not sure if it was ever correct.
    • On macOS, the Screen Time data is stored in a SQLite database located at:

    • ~/Library/Application Support/ScreenTimeAgent/Database/CoreDuetData.db

    • To access this database, you can use a SQLite browser tool, such as DB Browser for SQLite, which is a free, open-source tool that can be downloaded from their website at https://sqlitebrowser.org/.

  • > Once you have installed DB Browser for SQLite, you can open the CoreDuetData.db file and browse the tables to view the Screen Time data. Note that the data is stored in a compressed format, so you may need to use a SQLite extension or command-line tool to decompress the data for viewing.
@balupton
balupton / readme.md
Last active May 3, 2025 04:15
Debugging Ubuntu VPN/Bridge Networking

Networking on my Ubuntu machines is being flaking:

  • docker bridge interface failing
  • traffic not going to vpns
  • when vpn or docker bridge does work it knocks out all dns resolutions

Here are all the things I have tried or yet to try.

docker failures

import * as coda from "@codahq/packs-sdk";
export const pack = coda.newPack();
pack.setUserAuthentication({
type: coda.AuthenticationType.OAuth2,
authorizationUrl: "https://id.twitch.tv/oauth2/authorize",
tokenUrl: "https://id.twitch.tv/oauth2/token",
scopes: ["user:read:email", "channel:manage:schedule", "user:read:follows"],
additionalParams: { response_type: "code" },
scopeDelimiter: " ",
@ynott
ynott / multipass-on-bridged-network.md
Last active December 29, 2024 03:29
Instructions for running multipass on a bridge network

1. Environmental information

  • OS: Ubuntu 20.04.2 LTS (GNU/Linux 5.8.0-59-generic x86_64)
  • Network: 192.168.xxx.0/24
  • Ubuntu multipass host machine IP: 192.168.xxx.yyy(static IP)
  • NIC: enp2s0(bridge host NIC)
  • Bridge NIC:br0

2. Prerequisites

@balupton
balupton / scale.md
Last active January 16, 2021 00:03
Massively Scalable Web Infrastructure

Massively Scalable Web Infrastructure

Todo

These items still need to be categorised below:

@WebReflection
WebReflection / my-libraries-in-bytes.md
Last active September 24, 2021 22:03
My libraries in bytes

Toward better libraries

I am recently re-branding my libraries as µ (micro), refactoring these when necessary, dropping IE < 11 support, improving the logic where possible, or providing a better, more robust, or faster, API.

In few words, on the right there is the modern version of libraries I've used for the last ~5 years in production or for side projects, and I suggest anyone having one of the earlier dependencies, to have a look at their modern, micro, counterpart.

How to read these tables

All sizes are minified, brotli compressed, and representing these two files, when possible:

@dvalfrid
dvalfrid / gist:72a203931a928dbc67e2da568b4c5547
Last active November 5, 2020 17:00
Control the POE fan with ubuntu

Rasparry PI - how to control your POE-fan in Ubuntu

Check if you have the POE-fan

cat /sys/class/thermal/cooling_device0/type

should give rpi-poe-fan

Create file

sudo vi /etc/udev/rules.d/50-rpi-fan.rules

@loganvolkers
loganvolkers / ExampleHook.ts
Last active October 19, 2020 22:47
Stencil Hooks
import { Component, h } from '@stencil/core';
import { useState } from 'haunted';
import { useHook } from './stencil-hooks';
@Component({
tag: 'example-hook',
})
export class ExampleHook {
render = useHook(this, () => {