Skip to content

Instantly share code, notes, and snippets.

@luislobo
luislobo / VNC with i3.md
Created January 9, 2024 02:17 — forked from wecacuee/VNC with i3.md
VNC with i3
@luislobo
luislobo / nodejs-versions.md
Last active March 2, 2022 05:52
Node.js Versions Quick Release notes
@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 / 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.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 / 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
  }
install.txt ⬡ 8.12.0
apt install build-essential --no-install-recommends
apt install git mc zsh byobu i3 dunst i3lock i3blocks i3status --no-install-recommends
apt install firefox --no-install-recommends
apt install xinit --no-install-recommends
apt install htop --no-install-recommends
# dbus-x11 required by terminator
apt install dbus-x11 terminator --no-install-recommends
apt install feh gsimplecal i3status htop volumeicon-alsa arandr curl keychain ttf-dejavu fonts-font-awesome pavucontrol scrot gnome-calculator gnome-disk-utility gdebi j4-dmenu-desktop \
--no-install-recommends
@luislobo
luislobo / http-to-s3.js
Created July 10, 2018 22:27
upload from an http resource into s3
const stream = require('stream');
const request = require('request');
const AWS = require('aws-sdk');
const s3 = new AWS.S3();
const BUCKET = 'mybucket';
const KEY = 'luis/yourvideo.mp4';
request.get('https://yoursite/yourvideo.mp4')
.pipe(uploadFromStream())
@luislobo
luislobo / es6-classes-inheritance.js
Created October 17, 2017 16:45
How to create ES6 static methods that create objects of itself
class A {
constructor(name){
this.name = name;
}
static create(name){
return new this(name);
}