Skip to content

Instantly share code, notes, and snippets.

@WhoAteDaCake
WhoAteDaCake / flags.txt
Created March 14, 2019 15:23
Opencv 4.1 debugging
-lopencv_shape -lopencv_stitching -lopencv_superres -lopencv_videostab -lopencv_aruco -lopencv_bgsegm -lopencv_bioinspired -lopencv_ccalib -lopencv_datasets -lopencv_dpm -lopencv_face -lopencv_freetype -lopencv_fuzzy -lopencv_hdf -lopencv_line_descriptor -lopencv_optflow -lopencv_video -lopencv_plot -lopencv_reg -lopencv_saliency -lopencv_stereo -lopencv_structured_light -lopencv_phase_unwrapping -lopencv_rgbd -lopencv_viz -lopencv_surface_matching -lopencv_text -lopencv_ximgproc -lopencv_calib3d -lopencv_features2d -lopencv_flann -lopencv_xobjdetect -lopencv_objdetect -lopencv_ml -lopencv_xphoto -lopencv_highgui -lopencv_videoio -lopencv_imgcodecs -lopencv_photo -lopencv_imgproc -lopencv_core
@WhoAteDaCake
WhoAteDaCake / Result.ts
Last active May 22, 2019 15:05
Result type
type Change<V, V2> = (item: V) => V2;
type Empty = null;
const empty: Empty = null;
export class Result<E, V> {
value: V | Empty;
error: E | Empty;
static EMPTY = empty;
@WhoAteDaCake
WhoAteDaCake / PIPELINE.md
Created June 4, 2019 08:43
Processing pipeline

Overview

Processor

  • Individual servers that perform the tasks
  • Endpoints
    • GET /meta
      • Provides resource usage as well as name and id
    • POST /process
  • Should register to the manager
@WhoAteDaCake
WhoAteDaCake / compose.sh
Created June 10, 2019 11:55
Install docker compose
COMPOSE_VERSION=`git ls-remote https://github.com/docker/compose | grep refs/tags | grep -oP "[0-9]+\.[0-9][0-9]+\.[0-9]+$" | tail -n 1`
sudo sh -c "curl -L https://github.com/docker/compose/releases/download/${COMPOSE_VERSION}/docker-compose-`uname -s`-`uname -m` > /usr/local/bin/docker-compose"
sudo chmod +x /usr/local/bin/docker-compose
sudo sh -c "curl -L https://raw.githubusercontent.com/docker/compose/${COMPOSE_VERSION}/contrib/completion/bash/docker-compose > /etc/bash_completion.d/docker-compose"
@WhoAteDaCake
WhoAteDaCake / fluent.sh
Created June 10, 2019 12:15
Fluent debian
wget -qO - https://packages.fluentbit.io/fluentbit.key | sudo apt-key add -
# Add new source
echo "deb https://packages.fluentbit.io/debian/stretch stretch main" | sudo tee -a /etc/apt/sources.list
sudo apt-get update
sudo apt-get install -y td-agent-bit
sudo systemctl start td-agent-bit
@WhoAteDaCake
WhoAteDaCake / agent.sh
Created June 10, 2019 12:38
td-agent restart
FILE=daemon.json
DIR=/etc/docker
sudo service td-agent-bit restart
sudo mkdir -p $DIR
cat > $FILE <<- EOM
{
"log-driver": "fluentd"
}
EOM
export PROMPT_DIRTRIM=2
export PS1="[\[$(tput sgr0)\]\[\033[38;5;202m\]\A\[$(tput sgr0)\]\[\033[38;5;15m\]][\[$(tput sgr0)\]\[\033[38;5;70m\]\H\[$(tput sgr0)\]\[\033[38;5;15m\]][\[$(tput sgr0)\]\[\033[38;5;6m\]\w\[$(tput sgr0)\]\[\033[38;5;15m\]]\\$ \[$(tput sgr0)\]"
@WhoAteDaCake
WhoAteDaCake / gist:37823722bdf27fc03527f5b54c0ca6f0
Last active February 26, 2022 05:58 — forked from EspadaV8/gist:1357237
Script to import Geonames into PostgreSQL
#!/bin/bash
#===============================================================================
#
# FILE: getgeo.sh
#
# USAGE: ./getgeo.sh
#
# DESCRIPTION: run the script so that the geodata will be downloaded and inserted into your
# database
#
call plug#begin()
Plug 'joshdick/onedark.vim'
Plug 'sheerun/vim-polyglot'
Plug 'lifepillar/pgsql.vim'
Plug 'ctrlpvim/ctrlp.vim'
call plug#end()
set runtimepath^=~/.vim/bundle/ctrlp.vim
let g:ctrlp_custom_ignore = '\v[\/](node_modules|target|dist)|(\.(swp|ico|git|svn))$'
1 function with-types {
2 npm i $1 && npm i --save-dev @types/$1
3 }
4
5 # Local bin
6 export PATH = "$PATH:~/bin"
7