Skip to content

Instantly share code, notes, and snippets.

@andybotting
andybotting / gist:8838691d0266ef56e8d42ef2fa603717
Created March 22, 2023 22:52
Dump all Ansible variables on a host
ansible localhost -m setup
@andybotting
andybotting / gist:dd4f4c38284e99332ec9c7f0c2b82653
Created October 26, 2022 04:59
Ubuntu nspawn container on Arch Linux
# as root
NAME=jammy1
pacman -S ubuntu-keyring debootstrap
mkdir -p /var/lib/machines
cd /var/lib/machines
@andybotting
andybotting / bulk-import-images-to-impress.py
Created June 23, 2022 03:39
LibreOffice Python macro for bulk import of SVG images into an Impress document for uploading into Google Slides as scalable vectors
#!/usr/bin/env python3
#
# Script for bulk import of images into a LibreOffice presentation
# for allowing SVG images to be usable as vectors in Google Docs.
#
# Andy Botting <andy@andybotting.com> 2022
#
# Steps:
# 1) Start LibreOffice impress with:
# /usr/lib/libreoffice/program/soffice.bin --impress \
@andybotting
andybotting / pull.md
Last active August 14, 2023 22:37
cherry-pick a GitHub pull request locally
  1. add the GitHub repo as a remote
$ git remote add github https://github.com/<org>/myrepo.git
  1. fetch PRs
$ git fetch github

Keybase proof

I hereby claim:

  • I am andybotting on github.
  • I am andybotting (https://keybase.io/andybotting) on keybase.
  • I have a public key ASDRIcvFbZdql39imHl8dNsPZtmGligDzdehM2JWR9kXKwo

To claim this, I am signing this object:

@andybotting
andybotting / generate-accounts.sh
Created October 27, 2020 22:24
Bash script for generating training accounts with friendly passwords
#!/bin/bash -eu
ADJECTIVES="ablaze accented alive ashen ashy atomic attractive beaming beautiful better bitter blazing bleached bleak blended blotchy bold brash breezy bright brilliant broad bumpy burnt careful checkered chilly chromatic chubby classic clean clever colored colorful colorless colossal contrasting cool creamy crisp crooked cuddly curved damaged dappled dark dayglo dazzling deep delicate delicious digital dim dirty dotted drab dreary dull dusty earth electric elegant faded faint famous fancy festive fiery flabby flaky flashy flattering fluffy freezing fresh frosty gifted gigantic glamorous glistening glittering glowing gorgeous greasy great hallowed handsome harsh hazy helpful hollow hot hued icy illuminated immense important intense juicy large light little loose loud luminous majestic mammoth massive matte medium mellow melted milky mingled miniature mixed moldy motley mottled muddy murky muscular mushy narrow natural neutral nutty opaque pale pastel patchwork patchy patterned perfect petite
#EXTM3U
#EXTINF:0,NHK World TV
https://nhkworld.webcdn.stream.ne.jp/www11/nhkworld-tv/global/2003458/live.m3u8
@andybotting
andybotting / dns_openstack.sh
Last active July 2, 2020 23:41
OpenStack Designate DNS plugin for acme.sh
#!/usr/bin/bash
# OpenStack Designate API plugin
#
# This requires you to have OpenStackClient and python-desginateclient
# installed, with the appropriate OpenStack credentials available, whether
# that is a clouds.yaml file or environment variables.
#
# Author: Andy Botting <andy@andybotting.com>
@andybotting
andybotting / puppet-agent-noop-test.sh
Created May 22, 2019 00:15
Run puppet in no-op while disabled
puppet agent --test --noop --agent_disabled_lockfile=/dummy
@andybotting
andybotting / uvcvideo-settings.md
Last active August 17, 2022 03:34
Setting uvcvideo settings automatically for webcams on Linux

If you ever wanted to set some default config settings for your webcam on Linux, here's a way you might do it with UDEV.

For example, in this case, I'm disabling auto-focus, setting the focus to 6 and then setting the powerline frequency to 50Hz.

In this case, I'm applying it to a Microsoft® LifeCam Cinema(TM), where lsusb says it's vendor:id value is 045e:0812

Add a new file (for example) /etc/udev/rules.d/83-uvcvideo-settings.rules

SUBSYSTEM=="video4linux", KERNEL=="video[0-9]*", ATTR{index}=="0", ATTRS{idVendor}=="045e", ATTRS{idProduct}=="0812", RUN+="/usr/bin/v4l2-ctl -d $devnode --set-ctrl=power_line_frequency=1"