Skip to content

Instantly share code, notes, and snippets.

View robcowie's full-sized avatar

Rob Cowie robcowie

  • Recycleye
  • Leeds/London, United Kingdom
View GitHub Profile
@robcowie
robcowie / agx_xavier_tips-and-tricks.md
Created May 4, 2023 21:28 — forked from andrewssobral/agx_xavier_tips-and-tricks.md
Tips and Tricks for Jetson AGX Xavier
@robcowie
robcowie / Readme.md
Created October 3, 2021 09:51 — forked from dornfeder/Readme.md
Git Branching Diagram Template

Git Branching Diagram Template for diagrams.net

This is my own variant of a git branching diagram template based on Bryan Braun's great template.

You can use this diagram as a template to create your own git branching diagrams. Here's how:

  1. Create a new diagram with diagrams.net (formerly draw.io)
  2. Go to File > Open From > URL
  3. Insert this url (it points to the xml data below): https://gist.githubusercontent.com/dornfeder/13abff279de357f048e474d4ed6c692d/raw/f5efc838bd34429e59e38063bd348b7a86457d18/git-diagram-template.xml
  4. Customize as needed for your team.
@robcowie
robcowie / git-branching-diagram.md
Created May 4, 2021 17:42 — forked from bryanbraun/git-branching-diagram.md
Example Git Branching Diagram

Example Git Branching Diagram

You can use this diagram as a template to create your own git branching diagrams. Here's how:

  1. Create a new diagram with diagrams.net (formerly draw.io)
  2. Go to File > Open From > URL
  3. Insert this url (it points to the xml data below): https://gist.githubusercontent.com/bryanbraun/8c93e154a93a08794291df1fcdce6918/raw/0378fda86483def0a9680270c02907a9cbaf7615/template-data.xml
  4. Customize as needed for your team.

@robcowie
robcowie / README.md
Created April 16, 2021 10:36 — forked from sandys/Fastapi-sqlalchemy-pydantic-dataclasses-reloadable-logging.md
fastapi with python 3.7 dataclasses - used to create both sqlalchemy and pydantic models simultaneously

cmdline

poetry run gunicorn testpg:app -p 8080 --preload --reload --reload-engine inotify -w 10 -k uvicorn.workers.UvicornWorker --log-level debug --access-logfile - --error-logfile - --access-logformat "SSSS - %(h)s %(l)s %(u)s %(t)s \"%(r)s\" %(s)s %(b)s \"%(f)s\" \"%(a)s"

How to quickly run postgres (using docker)

docker run --network="host" -it --rm --name some-postgres -e POSTGRES_PASSWORD=mysecretpassword -e PGDATA=/var/lib/postgresql/data/pgdata -v /tmp/pgdata2:/var/lib/postgresql/data -e POSTGRES_USER=test postgres

This command will quickly start postgres on port 5432 and create a database test with user test and password mysecretpassword

@robcowie
robcowie / hdfs-ha-namenode-failback.sh
Created October 15, 2017 20:22 — forked from salekseev/hdfs-ha-namenode-failback.sh
Script to check that both NameNodes are alive in HDFS HA configuration and will force failover to the preferred NameNode
#!/bin/bash
#
# This script will check that both NameNodes are alive in HDFS HA
# configuration and will force failover to the preferred NameNode.
#
# Author: Stas Alekseev <me@salekseev.com>
#
ACTIVE_NAMENODE=nn1
STANDBY_NAMENODE=nn2
@robcowie
robcowie / growl_log.py
Created November 23, 2011 15:28 — forked from minimal/knotify_log.py
Growl (GNTP) logging handler
"""Growl (GNTP) logging handler"""
import logging
import gntp.notifier
class GrowlHandler(logging.Handler):
"""Log messages to growl"""
def __init__(self, level=logging.NOTSET):