Skip to content

Instantly share code, notes, and snippets.

@ramcq
ramcq / main.yml
Last active March 28, 2023 22:04
Ansible role to configure borgmatic with the MariaDB and Postgres instances running in Docker
---
- name: Update APT cache
apt: update_cache=yes cache_valid_time=3600
- name: Ensure required docker dependencies
package:
name: python3-docker
- name: Get running container IDs
community.docker.docker_host_info:
@ramcq
ramcq / .env
Last active January 26, 2022 18:59
sshd+tmux+weechat in docker
LOCALE=en_GB.UTF-8
SSH_KEY="ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAIEA151ak/oQeooHn7TGqzELD+X84eoakFznQEFdz5YlqP8n2PC7KxK07oQ5N9ZDOE3nxqKSLvdG5UkzKSGVBDh7E6TnulHDK4Qu8+M2J/+IqHx1WQrMVrM47avHjpfTQuL8ON44pOPn2weQsvZPPK7DEM4FUlmjIWdvBwN3axNZhY0= robot101@theta"
TZ=Europe/London
{
"id" : "com.github.gerry136.highlighterpdf",
"runtime" : "org.freedesktop.Platform",
"runtime-version" : "19.08",
"sdk" : "org.freedesktop.Sdk",
"command" : "highlighterpdf",
"modules" : [
{
"name" : "openjdk",
"buildsystem" : "simple",
@ramcq
ramcq / README.md
Last active May 27, 2020 15:57
prelim Flatpak for NetSurf

to build/install/test:

  • flatpak-builder --install-deps-from=flathub --repo=repo --ccache --force-clean --user build org.netsurf_browser.NetSurf.yaml
  • flatpak build-update-repo repo
  • flatpak remote-add --no-gpg-verify --user netsurf-test repo
  • flatpak install --user netsurf-test org.netsurf_browser.NetSurf
  • flatpak run org.netsurf_browser.NetSurf
[Unit]
Description=ZeroTier One Container
[Service]
Restart=on-failure
ExecStartPre=/usr/bin/rm -f /var/run/containers/storage/overlay-containers/adcb78cc8fddb7587ad694e5d8a6aa434ab946fce4aeb6a57414f82ea2aa5935/userdata/conmon.pid
ExecStart=/usr/bin/podman start adcb78cc8fddb7587ad694e5d8a6aa434ab946fce4aeb6a57414f82ea2aa5935
ExecStop=/usr/bin/podman stop -t 10 adcb78cc8fddb7587ad694e5d8a6aa434ab946fce4aeb6a57414f82ea2aa5935
KillMode=none
Type=forking
@ramcq
ramcq / seccomp-with-request_key.json
Created June 27, 2019 13:00
add request_key syscall to default docker seccomp policy
{
"defaultAction": "SCMP_ACT_ERRNO",
"archMap": [
{
"architecture": "SCMP_ARCH_X86_64",
"subArchitectures": [
"SCMP_ARCH_X86",
"SCMP_ARCH_X32"
]
},
@ramcq
ramcq / edu.mit.scratch.ScratchDesktop.json
Created April 10, 2019 00:52
Flatpak manifest for Scratch Desktop 3.0
{
"app-id": "edu.mit.scratch.ScratchDesktop",
"runtime": "org.freedesktop.Platform",
"runtime-version": "18.08",
"base": "org.electronjs.Electron2.BaseApp",
"base-version": "18.08",
"sdk": "org.freedesktop.Sdk",
"command": "scratch-desktop",
"separate-locales": false,
"finish-args": [
@ramcq
ramcq / repo.conf
Created December 19, 2018 21:19
flathub nginx conf.d fragment for ostree repo TTLs
location ~ ^/repo/summary(\.sig)?$ {
root /srv/repo;
expires 1h;
add_header Cache-Control "public";
add_header Surrogate-Control "stale-if-error=86400";
}
location /repo/refs {
root /srv/repo;
expires 1m;
add_header Cache-Control "public";
@ramcq
ramcq / appstream-validator.py
Created September 12, 2018 14:28
Endless script to check appstream files for common appdata invalidity
#!/usr/bin/env python3
# This script parses all the local appstream data
# to check for apps that are missing important metadata
# that is required for proper display in gnome-software.
#
# It is recommended to run `flatpak update --apstream`
# prior to this script.
@ramcq
ramcq / packet-configure-network.py
Created August 21, 2018 09:51
Reads Packet.net metadata JSON and writes out RedHat style /etc/sysconfig/network-scripts config
#!/usr/bin/env python3
import argparse
import glob
import ipaddress
import json
import os
import requests
PACKET_BOND_OPTIONS = 'miimon=100 downdelay=200 updelay=200 xmit_hash_policy=1 lacp_rate=1'