Skip to content

Instantly share code, notes, and snippets.

View robdaemon's full-sized avatar

Robert Roland robdaemon

View GitHub Profile
@robdaemon
robdaemon / swapcaps.ps1
Created April 11, 2021 22:43
swap ctrl and capslock on windows 10
$hexified = "00,00,00,00,00,00,00,00,03,00,00,00,1d,00,3a,00,3a,00,1d,00,00,00,00,00".Split(",") | % { "0x$_"};
$kbLayout = 'HKLM:\SYSTEM\CurrentControlSet\Control\Keyboard Layout';
New-ItemProperty -Path $kbLayout -Name "Scancode Map" -PropertyType Binary -Value ([byte[]]$hexified)
@robdaemon
robdaemon / docker-compose.yml
Created February 28, 2021 02:45
HomeAssistant + zwavejs2mqtt + Mosquitto
version: '3'
services:
homeassistant:
container_name: homeassistant
image: homeassistant/home-assistant:stable
volumes:
- /home/rroland/homeassistant/config:/config
- /etc/localtime:/etc/localtime:ro
restart: unless-stopped
networks:
@robdaemon
robdaemon / gist:6c383c2f4c6e3d495e14dd8cdbb9bdc3
Last active March 24, 2021 22:06
block twitter sidebar stuff
twitter.com##:xpath(//span[(text()='Trends for you')]/../../../..)
twitter.com##:xpath(//span[(text()="What’s happening")]/../../../../..)
twitter.com##:xpath(//span[(text()="Who to follow")]/../../../../..)
twitter.com##:xpath(//span[(text()="Topics to follow")]/../../../../..)
@robdaemon
robdaemon / README.md
Last active February 13, 2023 01:14
NextCloud docker compose setup

I can't take credit for the systemd unit files, I found those examples ages ago. I've updated them to use the newer Docker Compose plugin.

Each file has its folder locations in a comment at the top. Place the various files in their locations, and then:

systemctl daemon-reload
systemctl enable docker-compose@swag
systemctl enable docker-compose@mediaserver
systemctl enable docker-compose@nextcloud
systemctl enable docker-compose-reload.timer
rroland@vala:/snap/emacs/799$ du -h > ~/emacs-snap
512 ./etc/X11/Xreset.d
512 ./etc/X11/Xresources
9.0K ./etc/X11/Xsession.d
25K ./etc/X11/app-defaults
0 ./etc/X11/xkb
58K ./etc/X11
0 ./etc/avahi/services
3.5K ./etc/avahi
0 ./etc/dbus-1/session.d
@robdaemon
robdaemon / nils.go
Created September 5, 2018 22:32
nil handling may surprise you
package main
import (
"fmt"
"reflect"
)
func main() {
var myint interface{}
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
#define NUM_CARDS 52
int deck[NUM_CARDS];
/*
@robdaemon
robdaemon / gen.sh
Created June 27, 2017 21:42
script to generate a CA and server key
#!/bin/bash
set -e
usage() {
echo "the following environment variables are required:"
echo "COUNTRY - Country code"
echo "STATE - State / Province"
echo "CITY - City"
echo "ORG - Organization"
@robdaemon
robdaemon / gemstash.conf
Created September 8, 2016 04:20
Upstart script for Gemstash
# Upstart script for Gemstash
respawn
respawn limit 15 5
start on runlevel [2345]
stop on runlevel [06]
script
su - gemstash -c "/usr/local/bin/gemstash start --no-daemonize"
@robdaemon
robdaemon / updated-ui.yml
Created July 1, 2016 19:44
Updated Kubernetes UI definition that creates a load balancer
# Copyright 2015 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,