Skip to content

Instantly share code, notes, and snippets.

View tyrm's full-sized avatar

Tyr Mactire tyrm

View GitHub Profile
#!/bin/bash
. /etc/default/backup
S3PATH=do/ptzo-backups/ptzo/files/$(date +%u)
TARGETFILE=ptzo_files.tar.xz
WORKDIR=/scratch
DATADIR=/opt/docker/cdn-ptzo/data
SELECT c.id, c.name, array_agg(p.phone_number_id ORDER BY p.phone_number_id) as phone_number_ids
FROM public.sms_conversations as c
INNER JOIN public.sms_conversation_participants as p
ON c.id = p.sms_conversation_id
GROUP BY c.id
HAVING array_agg(p.phone_number_id ORDER BY p.phone_number_id) = ARRAY[1,2];
# update prompt
## Load version control information
autoload -Uz vcs_info
zstyle ':vcs_info:*' enable git svn
zstyle ':vcs_info:git:*' formats '(%b)'
precmd() { vcs_info }
## Set up the prompt (with git branch name)
setopt PROMPT_SUBST
export PROMPT='%F{cyan}ᛏ%F{reset} %F{7}%1~%F{reset}%F{yellow}${vcs_info_msg_0_}%F{reset} %# '
#!/bin/sh
PATH=$PATH:~/go/bin
test_fmt() {
hash gofmt 2>&- || { echo >&2 "gofmt not in PATH."; exit 1; }
IFS='
'
for file in `git diff --cached --name-only --diff-filter=ACM | grep '\.go$'`
do
@tyrm
tyrm / index.html
Last active November 16, 2021 17:06
park page
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>PettingZoo Network</title>
<style>
html,
body {
blueprint:
name: Zooz ZEN34 Remote scene control
description: |
Use the Zooz ZEN34 remote to trigger Scenes and control devices based on varying scenes.
This Blueprint is currently configured for the zwaveJS platform.
domain: automation
input:
export DOCKER_CLI_EXPERIMENTAL=enabled
IMAGE_NAME=tyrm/mastodon
sed -i 's/install -g yarn/install -g --unsafe-perm yarn/g' Dockerfile
echo $DIO_PASS | docker login --username $DIO_USER --password-stdin
docker buildx build --platform linux/arm64,linux/amd64 -t $IMAGE_NAME:$BUILD . --push
@tyrm
tyrm / .env.mastodon
Last active April 28, 2022 03:34
Mastodon Docker
# Generated with mastodon:setup on 2019-06-09 21:39:02 UTC
LOCAL_DOMAIN=<your domain>
SINGLE_USER_MODE=false
S3_ENABLED=true
S3_BUCKET=<digital ocean bucket name>
AWS_ACCESS_KEY_ID=<digital ocean bucket access key>
AWS_SECRET_ACCESS_KEY=<digital ocean bucket secret key>
S3_PROTOCOL=https
1. 🇮🇹 Italy: Mahmood & Blanco – “Brividi”
2. 🇬🇧 United Kingdom: Sam Ryder – “Space Man”
3. 🇦🇲 Armenia: Rosa Linn - “Snap”
4. 🇳🇴 Norway: Subwoolfer – “Give That Wolf a Banana”
5. 🇵🇱 Poland: Ochman – “River”
package metrics
// Collector collects metrics from the feditools.
type Collector interface {
Close() error
NewDBQuery(name string) DBQuery
NewDBCacheQuery(name string) DBCacheQuery
NewGRPCRequest(method string) GRPCRequest
NewHTTPRequest(method, path string) HTTPRequest