Skip to content

Instantly share code, notes, and snippets.

@mr337
mr337 / delete_deployment.sh
Created Jun 27, 2022
Delete IoT Deployments Revisions
View delete_deployment.sh
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 Feb 3, 2022 — forked from hdoverobinson/ubxconfig.sh
Configure u-blox GPS/GNSS modules with Bash
View ubxconfig.sh
#!/bin/bash
###AUTHOR###
#Harry Dove-Robinson 5/8/2017
#harry@doverobinson.me
#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 Sep 25, 2020
Qtile Config
View config.py
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 Mar 25, 2020
Nginx Docker File (custom config and static assets)
View Dockerfile
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 Sep 27, 2018
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
View ssl_checker.py
#! /usr/bin/env python
import datetime
import socket
import ssl
import boto3
r53 = boto3.client('route53')
View QTile Config
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 Oct 22, 2017
XResources for Qtile on Lenovo X1
View gist:03a6b3b6ddcc8d2f7de8876c2fabd574
! Fonts {{{
Xft.antialias: true
Xft.hinting: true
Xft.rgba: rgb
Xft.hintstyle: hintfull
Xft.dpi: 210
! }}}
Xcursor.size: 16
@mr337
mr337 / .tmux.conf
Last active May 25, 2021
My Tmux conf - emulates screen keys since they are burned into my brain.
View .tmux.conf
set-option -g history-limit 100000
bind r source-file ~/.tmux.conf
# turning this off since it will capture the standard mouse interactions such as right click
# and paster buffer using mouse3
set -g mouse off
set-window-option -g mode-keys vi
bind-key -T copy-mode-vi 'v' send -X begin-selection
@mr337
mr337 / gist:bbcf3be444e4743a3447c0eaa3830303
Created Aug 7, 2016
Handy way to mointor serial traffic with socat
View gist:bbcf3be444e4743a3447c0eaa3830303
socat /dev/ttyUSB0,raw,echo=0 SYSTEM:'tee input.txt | socat - "PTY,link=/tmp/ttyV0,raw,echo=0,waitslave" | tee output.txt'
@mr337
mr337 / HTTPSClient.java
Created Apr 4, 2016
Java SSL client tester
View HTTPSClient.java
import java.net.*;
import java.io.*;
import java.security.*;
import javax.net.ssl.*;
public class HTTPSClient {
public static void main(String[] args) {
if (args.length == 0) {