Skip to content

Instantly share code, notes, and snippets.

View RichardBronosky's full-sized avatar

Bruno Bronosky RichardBronosky

View GitHub Profile
@RichardBronosky
RichardBronosky / README.MD
Last active April 26, 2024 08:21
cb - A leak-proof tee to the clipboard - Unify the copy and paste commands into one intelligent chainable command.

cb

A leak-proof tee to the clipboard

This script is modeled after tee (see [man tee][2]) and works on Linux, macOS, Cygwin, WSL/WSL2

It's like your normal copy and paste commands, but unified and able to sense when you want it to be chainable.

This project started as an answer to the StackOverflow question: [How can I copy the output of a command directly into my clipboard?][3]

@RichardBronosky
RichardBronosky / pep8_cheatsheet.py
Created December 27, 2015 06:25
PEP-8 cheatsheet
#! /usr/bin/env python
# -*- coding: utf-8 -*-
"""This module's docstring summary line.
This is a multi-line docstring. Paragraphs are separated with blank lines.
Lines conform to 79-column limit.
Module and packages names should be short, lower_case_with_underscores.
Notice that this in not PEP8-cheatsheet.py
@RichardBronosky
RichardBronosky / touchid_sudo.sh
Last active April 18, 2024 03:17
Use TouchID for sudo on modern MacBook Pro machines
#!/bin/bash
# curl -sL https://gist.githubusercontent.com/RichardBronosky/31660eb4b0f0ba5e673b9bc3c9148a70/raw/touchid_sudo.sh | bash
# This script is ready to copy-paste in whole, or just the line above (without the leading #)
# Use TouchID for sudo on modern MacBook Pro machines
# This script adds a single line to the top of the PAM configuration for sudo
# See: https://apple.stackexchange.com/q/259093/41827 for more info.
touchid_sudo(){
@RichardBronosky
RichardBronosky / 0-TLDR.md
Last active March 23, 2024 15:09 — forked from datagrok/git-serve.md
How to easily launch a temporary one-off git server from any local repository, to enable a peer-to-peer git workflow.

User 1

remote_server=172.31.0.1
git daemon --verbose --export-all --base-path=.git --reuseaddr --strict-paths .git/ > /tmp/git-serve.log 2>&1 &
ssh -R 9418:localhost:9418 ec2-user@$remote_server
git clone git://localhost/ local-repo-name

Repo from workstation is cloned onto server.

User 2

@RichardBronosky
RichardBronosky / BOILERPLATE.sh
Last active March 19, 2024 01:22
tools-rpi is a bash script full Raspberry Pi tools
#! /usr/bin/env bash
_setup_env() {
_env_blrplate
# Perform env setup by defining an _env function in calling script
if _is_function _env; then _env; fi
}
_env_blrplate() {
# ctrl chars for terminal colorizing
@RichardBronosky
RichardBronosky / rpi-3-1.txt
Created March 17, 2024 10:05
Arducam 16MP Autofocus install failure
bruno@rpi-3-1:~ $ chmod +x ardu-test.sh
bruno@rpi-3-1:~ $ cat ardu-test.sh
#! /usr/bin/env bash
set -x
uname -a
sudo cat /etc/os-release
@RichardBronosky
RichardBronosky / mkpasswd.py
Last active February 15, 2024 12:35
Platform independant what of generating Linux compatible crypt(3) sha512 hashes ($6$ style). For systems (like macOS/OSX) where you can't `mkpasswd -m sha-512`.
#!/usr/bin/env python3
# Because OSX doesn't have mkpasswd...
# Based on https://stackoverflow.com/a/17992126/117471
# python3 -c "from passlib.hash import sha512_crypt; print(sha512_crypt.encrypt(input()))" <<< bruno # NOQA
# Usage:
#
# $ ./mkpasswd.py
@RichardBronosky
RichardBronosky / README.md
Last active February 12, 2024 17:57
A homebrew formula to build vim with support for pyenv version of python

A homebrew formula to build vim with support for pyenv version of python

Build

  1. Patch /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/vim.rb
  2. Build
    brew reinstall --verbose --debug --build-from-source vim
  3. Locate your dynamic library with find /Users/bronoric/.pyenv/ -name '*libpython3*.dylib'
    • It's probably going to contain darwin in the path.
#!/bin/bash -e
# Quick start-stop-daemon example, derived from Debian /etc/init.d/ssh
NAME=blink
DIR=/home/pi
PIDFILE=/home/pi/$NAME.pid
DAEMON=/home/pi/pi_gpio_hack.py
DAEMON_ARGS="[[31,0,37,1],[31,1,37,0]]"
STOP_SIGNAL=INT
@RichardBronosky
RichardBronosky / Nutrichef Sous Vide Cooker Instructions.txt
Last active January 20, 2024 23:57
Simple instructions for the inexpensive sous vide with the terrible interface that everyone hates. I've owned it for over 2 years and I still have to open this every time I use it!
Plug in cooker.
Cooker powers on momentarily and is unusable.
Fill water to MAX port.
Touch POWER button for 5 seconds.
Cooker powers on and is usable.
Touch POWER and SET.
SET TEMP field flashes.
Units toggle between °C & °F.
Turn wheel.
Field value changes.