Skip to content

Instantly share code, notes, and snippets.

@mr337
mr337 / Make
Created December 1, 2023 21:10
Make help
.PHONY: help
help: ## Print the help documentation
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'
icloudbackup_lee:
image: boredazfcuk/icloudpd
container_name: icloudbackup_lee
restart: always
healthcheck:
test: /usr/local/bin/healthcheck.sh
start_period: 30s
volumes:
- ${HOME}/docker/icloudbackup_lee/config:/config
- ${HOME}/photo/Lee/icloud_backup:/data
@mr337
mr337 / keychron_linux.md
Created February 22, 2023 15:18 — forked from andrebrait/keychron_linux.md
Keychron keyboards on Linux + Bluetooth fixes

Here is the best setup (I think so :D) for K-series Keychron keyboards on Linux.

Most of these commands have been tested on Ubuntu 20.04 and should also work on most Debian-based distributions. If a command happens not to work for you, take a look in the comment section.

Make Fn + F-keys work

Keychron Keyboards on Linux use the hid_apple driver (even in Windows/Android mode), both in Bluetooth and Wired modes. By default, this driver uses the F-keys as multimedia shortcuts and you have to press Fn + the key to get the usual F1 through F12 keys.

@mr337
mr337 / delete_deployment.sh
Created June 27, 2022 20:13
Delete IoT Deployments Revisions
for i in {1..40}; do aws greengrassv2 list-deployments | jq '.deployments[] | select(.targetArn == "DEPLOYMENT_ARN") | .deploymentId' | xargs -I {} aws greengrassv2 delete-deployment --deployment-id {}; done
@mr337
mr337 / ubxconfig.sh
Created February 3, 2022 04:30 — forked from hdoverobinson/ubxconfig.sh
Configure u-blox GPS/GNSS modules with Bash
#!/bin/bash
###AUTHOR###
#Harry Dove-Robinson 5/8/2017
#[email protected]
#https://gist.github.com/hdoverobinson
#https://github.com/hdoverobinson
###USAGE###
#This is a script used to configure u-blox GPS/GNSS modules from a text file generated by u-center.
@mr337
mr337 / config.py
Last active September 25, 2020 22:13
Qtile Config
import os
from libqtile.config import EzKey, Key, Group, Drag, Click, Screen
from libqtile.command import lazy
from libqtile import layout, bar, widget
mod = 'mod1'
keys = [
#EzKey('A-h', lazy.layout.left()),
@mr337
mr337 / Dockerfile
Created March 25, 2020 17:57
Nginx Docker File (custom config and static assets)
FROM nginx:1.17.4-alpine
# configure nginx
RUN rm /etc/nginx/conf.d/default.conf
COPY nginx.conf /etc/nginx/conf.d
# copy static assets so nginx container serves them
WORKDIR /srv/portal/
COPY ./assets /srv/portal/static
@mr337
mr337 / ssl_checker.py
Created September 27, 2018 17:46
Utility script to help check a list of domains in Route53 to determine if they use HTTPs and if their certificate will expire in less than 30 days
#! /usr/bin/env python
import datetime
import socket
import ssl
import boto3
r53 = boto3.client('route53')
from libqtile.config import EzKey, Key, Group, Drag, Click, Screen
from libqtile.command import lazy
from libqtile import layout, bar, widget
mod = 'mod1'
keys = [
#EzKey('A-h', lazy.layout.left()),
#EzKey('A-l', lazy.layout.right()),
EzKey('A-j', lazy.layout.down()),
@mr337
mr337 / gist:03a6b3b6ddcc8d2f7de8876c2fabd574
Last active October 22, 2017 18:58
XResources for Qtile on Lenovo X1
! Fonts {{{
Xft.antialias: true
Xft.hinting: true
Xft.rgba: rgb
Xft.hintstyle: hintfull
Xft.dpi: 210
! }}}
Xcursor.size: 16