Skip to content

Instantly share code, notes, and snippets.

#!/usr/bin/env perl
my $output = qx/xinput list/;
my ($id) = ($output =~ m/Touchpad\s+id=(\d+)/);
my $props = qx/xinput --list-props $id/;
my ($prop) = ($props =~ m/Finger\s\((\d+)\)/);
qx/xinput --set-prop $id $prop 5, 10, 0/;
#!/bin/sh
TIMEOUT=15
QUIET=0
echoerr() {
if [ "$QUIET" -ne 1 ]; then printf "%s\n" "$*" 1>&2; fi
}
usage() {
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
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))$'
@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
#
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 / 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
@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 / 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 / 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