Skip to content

Instantly share code, notes, and snippets.

View chauncey-garrett's full-sized avatar

Chauncey Garrett chauncey-garrett

View GitHub Profile

Keybase proof

I hereby claim:

  • I am chauncey-garrett on github.
  • I am chaunceygarrett (https://keybase.io/chaunceygarrett) on keybase.
  • I have a public key ASAP3k--Ih-GRSY8KQlJOnu8TRgxGdgrzDrgKsSnsMYO5wo

To claim this, I am signing this object:

@chauncey-garrett
chauncey-garrett / vault_logrotate
Created January 31, 2020 19:18 — forked from soloradish/vault_logrotate
logrotate setting file for HashiCorp's Vault audit file
# Change the path below to your own audit log path.
/var/log/vault/audit.log {
rotate 30
daily
# Do not execute rotate if the log file is empty.
notifempty
missingok
compress
# Set compress on next rotate cycl to prevent entry loss when performing compression.
delaycompress
#!/bin/bash
OLDIFS=$IFS
export IFS=$'\n'
# Find all boxes which have updates
AVAILABLE_UPDATES=$(vagrant box outdated --global | grep outdated | tr -d "*'" | cut -d ' ' -f 2 2>/dev/null)
if [[ ${#AVAILABLE_UPDATES[@]} -ne 0 ]]; then
@chauncey-garrett
chauncey-garrett / regex
Created October 15, 2019 18:38
regex for version number
(\d+)(?:\.(\d+))*

Stevey's Google Platforms Rant

I was at Amazon for about six and a half years, and now I've been at Google for that long. One thing that struck me immediately about the two companies -- an impression that has been reinforced almost daily -- is that Amazon does everything wrong, and Google does everything right. Sure, it's a sweeping generalization, but a surprisingly accurate one. It's pretty crazy. There are probably a hundred or even two hundred different ways you can compare the two companies, and Google is superior in all but three of them, if I recall correctly. I actually did a spreadsheet at one point but Legal wouldn't let me show it to anyone, even though recruiting loved it.

I mean, just to give you a very brief taste: Amazon's recruiting process is fundamentally flawed by having teams hire for themselves, so their hiring bar is incredibly inconsistent across teams, despite various efforts they've made to level it out. And their operations are a mess; they don't real

@chauncey-garrett
chauncey-garrett / super-tip.txt
Created August 12, 2019 17:13 — forked from ericdouglas/super-tip.txt
Change 4 spaces to 2 spaces indentation and change tab to spaces - Vim tip
// 4 spaces to 2 spaces
%s;^\(\s\+\);\=repeat(' ', len(submatch(0))/2);g
// Tab to 2 spaces
:%s/\t/ /g
@chauncey-garrett
chauncey-garrett / TrueColour.md
Created February 13, 2018 22:27 — forked from XVilka/TrueColour.md
True Colour (16 million colours) support in various terminal applications and terminals

Colours in terminal

It's a common confusion about terminal colours... Actually we have this:

  • plain ascii
  • ansi escape codes (16 colour codes with bold/italic and background)
  • 256 colour palette (216 colours + 16 ansi + 24 gray) (colors are 24bit)
  • 24bit true colour ("888" colours (aka 16 milion))
printf "\x1b[${bg};2;${red};${green};${blue}m\n"
@chauncey-garrett
chauncey-garrett / TrueColour.md
Created February 13, 2018 22:25
True Colour (16 million colours) support in various terminal applications and terminals

Colours in terminal

It's a common confusion about terminal colours... Actually we have this:

  • plain ascii
  • ansi escape codes (16 colour codes with bold/italic and background)
  • 256 colour palette (216 colours + 16 ansi + 24 gray) (colors are 24bit)
  • 24bit true colour ("888" colours (aka 16 milion))
printf "\x1b[${bg};2;${red};${green};${blue}m\n"
:read !ls
Useful One-Line Scripts for Perl Dec 03 2013 | version 1.10
-------------------------------- ----------- ------------
Compiled by Peteris Krumins (peter@catonmat.net, @pkrumins on Twitter)
http://www.catonmat.net -- good coders code, great reuse
Latest version of this file is always at:
http://www.catonmat.net/download/perl1line.txt