Skip to content

Instantly share code, notes, and snippets.

@briangordon
briangordon / bash_ps1.sh
Last active February 3, 2019 04:50
By default, Debian only colorizes bash output for regular users. Rather than copy your ~/.bashrc to /root, take just take it out and have /etc/bash.bashrc source this instead.
# set variable identifying the chroot you work in (used in the prompt below)
if [ -z "${debian_chroot:-}" ] && [ -r /etc/debian_chroot ]; then
debian_chroot=$(cat /etc/debian_chroot)
fi
# set a fancy prompt (non-color, unless we know we "want" color)
case "$TERM" in
xterm-color|*-256color) color_prompt=yes;;
esac
# UFW configuration for a home DMZ box exposed to the public internet, with only sshd reachable from the outside world.
# In addition to setting these rules you should also:
# 1. Edit /etc/ufw/before.rules to remove the default rules which permit incoming DHCP packets from the outside world.
# 2. Edit /etc/ufw/before.rules to remove the default rules which permit incoming ICMP packets from the outside world.
# 3. Edit /etc/default/ufw to turn off non-local ipv6 because I don't know enough about it to be confident.
ufw default deny incoming
ufw default allow outgoing
ufw limit log proto tcp to 0.0.0.0/0 port ssh
ufw allow proto udp from 192.168.0.0/16 to 0.0.0.0/0 port bootpc comment "required for dhclient"
@briangordon
briangordon / make-letters.sh
Created March 4, 2019 22:47
Shell script to make letter icons for Slack
mkdir letters
convert -background transparent -fill black -font Chalkduster -pointsize 72 label:A letters/a.png
convert -background transparent -fill black -font Chalkduster -pointsize 72 label:B letters/b.png
convert -background transparent -fill black -font Chalkduster -pointsize 72 label:C letters/c.png
convert -background transparent -fill black -font Chalkduster -pointsize 72 label:D letters/d.png
convert -background transparent -fill black -font Chalkduster -pointsize 72 label:E letters/e.png
convert -background transparent -fill black -font Chalkduster -pointsize 72 label:F letters/f.png
convert -background transparent -fill black -font Chalkduster -pointsize 72 label:G letters/g.png
convert -background transparent -fill black -font Chalkduster -pointsize 72 label:H letters/h.png
convert -background transparent -fill black -font Chalkduster -pointsize 72 label:I letters/i.png
@briangordon
briangordon / gitgraphjs.html
Created March 28, 2019 05:32
gitgraphjs.com (https://web.archive.org/web/20181222070223/http://gitgraphjs.com/) gives you the building blocks to start working with the JS version but leaves you to put it together. Here's a fully working example to get it running.
<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" type="text/css" href="https://cdnjs.cloudflare.com/ajax/libs/gitgraph.js/1.15.1/gitgraph.css" />
<script src="https://cdnjs.cloudflare.com/ajax/libs/gitgraph.js/1.15.1/gitgraph.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/domready/1.0.8/ready.js"></script>
<script type="text/javascript">
domready(function() {
var gitgraph = new GitGraph({
template: "blackarrow",
@briangordon
briangordon / gitgraph-react.sh
Last active March 29, 2019 15:58
Steps to build gitgraph-react to play with the storybook 😵
brew install node
export PATH="$HOME/.node/bin:$PATH"
npm install -g lerna
git clone git@github.com:nicoespeon/gitgraph.js.git
echo "scripts-prepend-node-path=true" >> gitgraph.js/.npmrc
cd gitgraph.js
yarn
cd packages/gitgraph-core
yarn
cd ../gitgraph-react
@briangordon
briangordon / office-privacy.reg
Created May 27, 2019 02:27
Microsoft recently introduced "required" telemetry for Office which cannot be disabled through the UI. This should shut it off.
Windows Registry Editor Version 5.00
[HKEY_CURRENT_USER\Software\Policies\Microsoft\office\common\clienttelemetry]
"sendtelemetry"=dword:00000003
@briangordon
briangordon / SNAKE.8xp
Created October 3, 2019 05:51
Source code for a TI-BASIC implementation of Snake
{11,5,11,5,11,5→L₁
1→𝒏:dim(L₁)→L
1→S:0→T
0→C:1→P
0→W
DelVar [A]
{10,26→dim([A]
ClrHome
While 1
If P
@briangordon
briangordon / cisco-sg350 switch1
Last active May 2, 2020 16:05
Switch configuration
config-file-header
switch1
v2.5.0.90 / RTESLA2.5_930_364_105
CLI v1.0
file SSD indicator encrypted
@
ssd-control-start
ssd config
ssd file passphrase control unrestricted
no ssd file integrity control
@briangordon
briangordon / chrome.json
Created February 2, 2020 06:53
Jess Frazelle's Google Chrome seccomp profile combined with the default docker profile
{
"defaultAction": "SCMP_ACT_ERRNO",
"syscalls": [
{
"name": "accept",
"action": "SCMP_ACT_ALLOW",
"args": null
},
{
"name": "accept4",

Session 1: Preliminaries

  • Bid/ask spread
    • Stock quotes
    • Measure of liquidity
    • Steady state (order book, market depth, types of orders)
    • How prices move
  • Market makers
    • NYSE vs NASDAQ vs crypto
  • Advantages given in exchange for risk