Control an iLedClock 16×32 matrix clock (the one the CoolLED1248 app talks to) from a Raspberry Pi.
sudo apt install -y python3-venv bluetooth bluez
python3 -m venv ~/clock-venv
~/clock-venv/bin/pip install bleak pillow| #!/bin/bash | |
| # Credit: https://fitzcarraldoblog.wordpress.com/2018/08/06/how-to-move-a-mouse-pointer-automatically-in-linux-to-simulate-user-activity/ | |
| # Script to keep mouse pointer moving so that, for example, Suspend to RAM timeout does not occur. | |
| # | |
| # The mouse pointer will move around its current position on the screen, i.e. around any position | |
| # on the screen where you place the pointer. However, if you prefer it to move around the centre | |
| # of the screen then change mousemove_relative to mousemove in the xdotool command below. | |
| # | |
| # Set LENGTH to 0 if you do not want the mouse pointer to actually move. | |
| # Set LENGTH to 1 if you want the mouse pointer to move just a tiny fraction. |
| $data = [ | |
| { | |
| "certname" => "server1", | |
| "parameters" => { | |
| "port" => 1234, | |
| "job" => "job1" | |
| } | |
| }, | |
| { | |
| "certname" => "server2", |
| #!/usr/bin/env bash | |
| # ensure we were given two command line arguments | |
| if [[ $# -ne 2 ]]; then | |
| echo 'usage: vault-cp SOURCE DEST' >&2 | |
| exit 1 | |
| fi | |
| source=$1 | |
| dest=$2 |
| //The global script scope | |
| def ctx = context(scope: scriptScope()) | |
| //What things can be on the script scope | |
| contributor(ctx) { | |
| method(name: 'pipeline', type: 'Object', params: [body: Closure]) | |
| property(name: 'params', type: 'org.jenkinsci.plugins.workflow.cps.ParamsVariable') | |
| property(name: 'env', type: 'org.jenkinsci.plugins.workflow.cps.EnvActionImpl.Binder') | |
| property(name: 'currentBuild', type: 'org.jenkinsci.plugins.workflow.cps.RunWrapperBinder') | |
| property(name: 'scm', type: 'org.jenkinsci.plugins.workflow.multibranch.SCMVar') |
| #!/usr/bin/env bash | |
| set -e | |
| set -o pipefail | |
| plugin_repo_url="http://updates.jenkins-ci.org/download/plugins" | |
| plugin_dir="/var/lib/jenkins/plugins" | |
| include_optionals=false | |
| showUsage() { |
| Host gitlab.com | |
| Hostname altssh.gitlab.com | |
| User git | |
| Port 443 | |
| PreferredAuthentications publickey | |
| Host github.com | |
| Hostname ssh.github.com | |
| User git | |
| Port 443 | |
| PreferredAuthentications publickey |
| require 'yaml' | |
| mypath = File.expand_path(File.dirname(__FILE__)) | |
| # Load configuration from config.yml | |
| conf = YAML::load_file("#{mypath}/Puppetfile.yml") | |
| forge_conf = conf.fetch('forge', nil) | |
| if forge_conf.nil? | |
| forge = "" |
| package org.gradle.training | |
| import org.gradle.api.tasks.Input | |
| import org.gradle.api.tasks.OutputDirectory | |
| import org.gradle.api.tasks.TaskAction | |
| import org.gradle.api.DefaultTask | |
| import org.gradle.util.GFileUtils | |
| import org.gradle.api.artifacts.Configuration | |
| import org.gradle.api.artifacts.component.ModuleComponentIdentifier | |
| import org.gradle.maven.MavenModule |
Every so often I have to restore my gpg keys and I'm never sure how best to do it. So, I've spent some time playing around with the various ways to export/import (backup/restore) keys.
cp ~/.gnupg/pubring.gpg /path/to/backups/
cp ~/.gnupg/secring.gpg /path/to/backups/
cp ~/.gnupg/trustdb.gpg /path/to/backups/