Skip to content

Instantly share code, notes, and snippets.

@luislobo
luislobo / sails-mongodb-reconnect.md
Created June 13, 2019 23:21
How to handle MongoDB reconnection on Sails

First, create a custom configuration with this structure:

   dbStatus: {
    timeoutIncrement: 5 * 1000,
    initialTimeout: 5 * 1000,
    maxTimeout: 60 * 1000,
    dbOnline: true
  }
@luislobo
luislobo / clone.sh
Created May 25, 2020 16:29
Clone one disk to another one in Linux CLI with progress bar
# replace sdx and sdy with your corresponding disks
dd if=/dev/sdx | pv | dd of=/dev/sdy
@luislobo
luislobo / dimQuickfilters.user.js
Last active August 14, 2020 13:55 — forked from jjspace/dimQuickfilters.user.js
DIM Quickfilters
// ==UserScript==
// @name DIM Quickfilters
// @description Add a quick filter dropdown for DIM
//
// @author jjspace
// @namespace http://github.com/jjspace
// @downloadURL https://gist.github.com/jjspace/b9dec89b1aa68ee9356270b6507bc27c/raw/dimQuickfilters.user.js
//
// @version 1.0.6
// @updateUrl https://gist.github.com/jjspace/b9dec89b1aa68ee9356270b6507bc27c/raw/dimQuickfilters.user.js
@luislobo
luislobo / clone_all_bitbucket.sh
Created March 25, 2021 23:20
Clones all repositories you have access to in Bitbucket.org (using API 2.0 and workspaces)
#!/bin/bash
cwd=`pwd`
USER=username
PASS=password
SLUG=your_slug # this is the project team name you see in the url
repoUrl=`curl -s --user ${USER}:${PASS} "https://api.bitbucket.org/2.0/workspaces?q=slug=\"${SLUG}\"" | jq -r '.values[] | .links.repositories.href'`
for i in {1..2}; do
@luislobo
luislobo / install_latest_docker_compose.sh
Last active January 29, 2022 14:52 — forked from wdullaer/install.sh
Install Latest Docker and Docker-compose on Ubuntu
# Ask for the user password
# Script only works if sudo caches the password for a few minutes
sudo true
# Install kernel extra's to enable docker aufs support
# sudo apt-get -y install linux-image-extra-$(uname -r)
# Add Docker PPA and install latest version
# sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 36A1D7869245C8950F966E92D8576A8BA88D21E9
# sudo sh -c "echo deb https://get.docker.io/ubuntu docker main > /etc/apt/sources.list.d/docker.list"
@luislobo
luislobo / nodejs-versions.md
Last active March 2, 2022 05:52
Node.js Versions Quick Release notes
@luislobo
luislobo / VNC with i3.md
Created January 9, 2024 02:17 — forked from wecacuee/VNC with i3.md
VNC with i3