Skip to content

Instantly share code, notes, and snippets.

View taxilian's full-sized avatar

Richard Bateman taxilian

View GitHub Profile
@taxilian
taxilian / zsh_aliases.sh
Last active May 28, 2020 20:44
Handy aliases that I use on all my systems
# This makes the dark blue color lighter so you can read it
export CLICOLOR=1
export LSCOLORS=ExFxCxDxBxegedabagacad
# Mac version
alias du1='du -d 1 -h'
# Linux version
alias du1='du --max-depth=1 -h'
@taxilian
taxilian / instructions.md
Last active December 2, 2019 22:43
Creating a case sensitive code volume on macOS which auto mounts inside your home directory

Create /Users/<username>/code (or wherever you want it)

  1. Open Disk Utility; create a new volume:

    • APFS (Case Sensitive, Encrypted)
    • Put in the password; it won’t save yet
  2. Open terminal, run: sudo diskutil apfs list

    • Find the volume you created in the list; it’s probably the last item. Looks like this (volume CodeFS):

Volume disk1s6 19927108-1370-4A52-840F-3AF7B9F5FB6D

@taxilian
taxilian / README.md
Created November 9, 2019 22:13
Mongodb scripts for incremental backup

Introduction

I can't take credit for much of the work here -- I adapted it from this blog post: https://tech.willhaben.at/mongodb-incremental-backups-dff4c8f54d58

My main contribution was to make it a little easier to use with docker as well as numerous little cleanup tasks. I also made it gzip the oplog backups and added support for SSL connections

Note that I havne't yet tested the point in time restore script; it likely needs work, particularly to make things work with the gzipped oplog files

Keybase proof

I hereby claim:

  • I am taxilian on github.
  • I am taxilian (https://keybase.io/taxilian) on keybase.
  • I have a public key ASDsiYtIpWt3hzefcfi-R69kG2_2iBIiP71p1JYbBUvkzAo

To claim this, I am signing this object:

@taxilian
taxilian / 1- README.md
Last active July 9, 2019 15:24
Example nginx config to reverse proxy to three different octoprint servers from one domain

Purpose

I have three printers; each uses a raspberry pi that runs OctoPrint. I wanted to be able to give people a single page to see all of the webcams, what they are printing with ETL (est time left), and what the current temperatures are.

This demonstrates how I did that. Email me at richard@hamstudy.org if you'd like to see a live demo -- I don't want every bot on the web looking at my cameras and using CPU cycles.

License

@taxilian
taxilian / test.html
Created December 6, 2016 01:39
possibly out of date example for using fb2.0
<html>
<head>
<title>FireBreath 2.0 Chrome Extension</title>
</head>
<body>
<script>
var mimetype = "application/x-echotestplugin"
var plugin = null;
/* jshint esversion: 6 */
"use strict";
const Benchmark = require('benchmark');
let suite = new Benchmark.Suite;
class Thingy {
constructor(obj) {
this.obj = obj;
}
@taxilian
taxilian / .gitconfig
Created June 1, 2016 04:07
git aliases
[alias]
pr = pull --rebase
unadd = reset HEAD
#co = checkout
co = "!f(){ git checkout \"$@\" && git submodule update --init --recursive; }; f"
cp = cherry-pick
st = status
stat = status
br = branch
info = "!sh -c '[ $# -ne 0 ] && git remote show $1 && exit 0 || [ $# = 0 ] && git remote show origin && exit 0' -"
@taxilian
taxilian / MixinPlugin.ts
Last active June 19, 2019 11:19
Mongoose.js helper library using typescript decorators to define models
import 'reflect-metadata';
import {Schema} from 'mongoose';
let excludeStatics = ['length', 'name', 'prototype'];
let excludeMethods = ['constructor'];
function shouldIgnore(obj: any, propertyKey: string) {
return propertyKey.substr(0, 3) == '_$_' || !!Reflect.getMetadata('schema:ignore', obj, propertyKey) as boolean;
}
@taxilian
taxilian / mongoose.d.ts
Last active May 23, 2016 18:55
better mongoose.d.ts
// Type definitions for Mongoose 3.8.5
// Project: http://mongoosejs.com/
// Definitions by: horiuchi <https://github.com/horiuchi/>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
// tslint:disable
///<reference path="../../typings/main.d.ts" />
///<reference path="../mongodb/mongodb.d.ts" />
declare module "mongoose" {