Skip to content

Instantly share code, notes, and snippets.

View BirkhoffLee's full-sized avatar
🎓
Learning about CS

birkhoff BirkhoffLee

🎓
Learning about CS
View GitHub Profile
<!DOCTYPE html>
<html lang="en">
<head>
...
<script>
// don't load bootstrap - confluence does not need this
var netdataNoBootstrap = true;
var netdataTheme = 'white';
var netdataPrepCallback = function() {
@BirkhoffLee
BirkhoffLee / rixCloud_traffic_usage.sh
Created March 14, 2019 23:46
Calculates traffic usage with rixCloud API and push notification to your iPhone
#!/bin/bash
# https://unix.stackexchange.com/a/259254/301433
bytesToHuman() {
b=${1:-0}; d=''; s=0; S=(Bytes {K,M,G,T,P,E,Z,Y}iB)
while ((b > 1024)); do
d="$(printf ".%02d" $((b % 1024 * 100 / 1024)))"
b=$((b / 1024))
let s++
done
@BirkhoffLee
BirkhoffLee / teamviewer_change_id.py
Created April 22, 2019 13:37
Change the ID of Teamviewer for macOS to circumvent "commercial use detected"
# -*- coding: utf-8 -*-
import sys
import os
import glob
import platform
import re
import random
import string
print('Change ID of Teamviewer for macOS')
@BirkhoffLee
BirkhoffLee / index.js
Last active August 31, 2019 07:55
daily RSS feed to mailgun email
let d = new Date()
d.setDate(d.getDate() - 1)
const date = d.toISOString().split('T')[0]
const RssToEmail = require('rss-to-email')
const config = {
accentColor: "red",
header: {
link: "",
title: "RSS Feed"
@BirkhoffLee
BirkhoffLee / docker-compose.yml
Created September 16, 2019 15:11
docker-compose Grafana + InfluxDB + collectd with Traefik
version: '3.2'
services:
collectd:
image: fr3nd/collectd
privileged: true
network_mode: host
volumes:
- /proc:/mnt/proc:ro
- ./collectd.conf:/etc/collectd/collectd.conf
@BirkhoffLee
BirkhoffLee / gist:84fcae9dc0b2095a3a87eedfbedd4ce8
Created November 21, 2019 06:53
Install Borg & Borgmatic on CentOS 8
# Tested on a Vultr CentOS 8 server. Run with root!
yum install -y openssl-devel gcc-c++ python3-devel libacl-devel
dnf install -y redhat-rpm-config
pip3 install virtualenv
virtualenv --python=python3 borg-env
source borg-env/bin/activate
pip3 install borgbackup
# Borgmatic
@BirkhoffLee
BirkhoffLee / install.sh
Last active November 21, 2019 12:08
Install Docker Engine on CentOS 8
#!/bin/sh
# Tested on Vultr as of Nov 21, 2019
groupadd docker
usermod -aG docker birkhoff # add birkhoff to docker group
newgrp docker
yum remove -y docker \
docker-client \
@BirkhoffLee
BirkhoffLee / gist:b8069b9e689e24d1147863c222a7edf4
Created November 23, 2019 03:45 — forked from jimbojsb/gist:1630790
Code highlighting for Keynote presentations

Step 0:

Get Homebrew installed on your mac if you don't already have it

Step 1:

Install highlight. "brew install highlight". (This brings down Lua and Boost as well)

Step 2:

@BirkhoffLee
BirkhoffLee / gist:7a2896accf597f5b8d3fde5a37681b86
Created December 10, 2019 16:09
Install sharkdp/bat on CentOS 8
#!/bin/sh
# install rustc (comes with cargo)
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
source $HOME/.cargo/env
yum install llvm
cargo install bat
@BirkhoffLee
BirkhoffLee / README.md
Last active March 31, 2022 16:14
zer0zero. CS: GO configuration files

zer0zero. CS: GO configuration files

This configuration features:

  • Pro player settings. These are based on former Cloud9 player Shroud's config.
  • Human-readable explanations for every line of commands
  • Gameplay optimizations in technical aspects
    • Minimize shifting when firing the Weapon
    • Disable unnecessary video/audio effects
  • Useful shortcuts:
  • Jump throw: j