Skip to content

Instantly share code, notes, and snippets.

Executing instructions from https://github.com/jacobalberty/unifi-docker/tree/2cb3b97bed46cedab278f7c2d99fee8de3fd080d#setting-up-running-stopping-upgrading,
with São Paulo's timezone:
docker run -d --init \
--restart=unless-stopped \
-p 8080:8080 -p 8443:8443 -p 3478:3478/udp \
-e TZ='America/Sao Paulo' \
-v ~/unifi:/unifi \
--user unifi \
--name unifi \
@tiagoamaro
tiagoamaro / apps.md
Last active November 15, 2022 17:07
Windows Apps
@tiagoamaro
tiagoamaro / howto.md
Last active November 12, 2022 23:20 — forked from d4v3y0rk/howto.md
Encryption with DM_CRYPT in WSL2

Encrypted Volumes in WSL2

Description

This is a quick guide on how to setup dm_crypt under WSL2 for working with encrypted volumes. I use an encrypted volume to store things like password recovery codes and 2nd factor backup codes etc. I recently switched over to using WSL2 and wanted to figure out how to enable this functionality there. This is the distilled howto for getting it to work.

Guide

First thing you have to do is create a custom WSL2 kernel. Inside your already installed and running WSL2 (ubuntu) installation:

  • Install some required packages.
@tiagoamaro
tiagoamaro / chess-com.css
Last active July 14, 2023 23:45
Chess.com Stauton piece styles on Lichess using Stylus
/* ==UserStyle==
@name 9/30/2022, 3:33:22 PM
@namespace github.com/openstyles/stylus
@version 0.0.1
@description Margin-top on chess.com board
@author github.com/tiagoamaro
==/UserStyle== */
@-moz-document domain("chess.com") {
#board-layout-main {
@tiagoamaro
tiagoamaro / glossario.md
Last active June 26, 2021 14:51
Glossário - Aula de Versionamento de código - 22 de Junho 2021 - Toti

Aula 1

Glossário:

@tiagoamaro
tiagoamaro / exemplo.json
Created May 16, 2021 16:05
Toti - React - Arquivo JSON exemplo para ser utilizado com o https://github.com/typicode/json-server
{
"contatos": [
{
"id": 1,
"nome": "John Doe",
"email": "john@doe.email",
"telefone": "1111-1111"
},
{
"id": 2,
--DDL - Criando tabelas
CREATE TABLE IF NOT EXISTS cliente (
id INTEGER PRIMARY KEY AUTOINCREMENT,
nome TEXT NOT NULL,
cpf TEXT NOT NULL UNIQUE,
ativo BOOLEAN DEFAULT TRUE,
data_criacao DATETIME NOT NULL DEFAULT (datetime('now','localtime'))
);
CREATE TABLE IF NOT EXISTS conta (
@tiagoamaro
tiagoamaro / class-list.js
Last active June 17, 2020 20:06
Toti - Gabarito Lógica de programação 2020
// Entrada do exercício, lista de aulas
let class1 = ['yasmin', 'isadora', 'benedita', 'brenda', 'luiza', 'fatima', 'caio', 'teresinha', 'hugo', 'zeca', 'catarina', 'emanuel', 'marcelo', 'claudio', 'marina', 'isabela', 'anthony', 'rebeca', 'filipe', 'laís', 'vinicius', 'helena', 'elisa', 'rodrigo', 'geraldo', 'yuri', 'marcio']
let class2 = ['benedita', 'elisa', 'emanuel', 'rodrigo', 'filipe', 'marcio', 'teresinha', 'laís', 'vinicius', 'marina', 'catarina', 'luiza', 'marcelo', 'rebeca', 'hugo', 'geraldo', 'zeca', 'caio', 'anthony', 'yasmin', 'claudio']
let class3 = ['isadora', 'isabela', 'laís', 'claudio', 'catarina', 'zeca', 'teresinha', 'emanuel', 'marcio', 'fatima', 'rodrigo', 'luiza', 'brenda', 'marina', 'marcelo', 'benedita', 'rebeca', 'filipe', 'helena', 'elisa', 'hugo', 'geraldo']
// => Parte 1: ordenar os nomes das aulas de forma decrescente (ordem alfabética)
// Quicksort que ordena invertido
@tiagoamaro
tiagoamaro / class-list.js
Last active May 30, 2020 20:42
Lógica de Programação 2020 - Exercício 02
const class1 = ['yasmin', 'isadora', 'benedita', 'brenda', 'luiza', 'fatima', 'caio', 'teresinha', 'hugo', 'zeca', 'catarina', 'emanuel', 'marcelo', 'claudio', 'marina', 'isabela', 'anthony', 'rebeca', 'filipe', 'laís', 'vinicius', 'helena', 'elisa', 'rodrigo', 'geraldo', 'yuri', 'marcio']
const class2 = ['benedita', 'elisa', 'emanuel', 'rodrigo', 'filipe', 'marcio', 'teresinha', 'laís', 'vinicius', 'marina', 'catarina', 'luiza', 'marcelo', 'rebeca', 'hugo', 'geraldo', 'zeca', 'caio', 'anthony', 'yasmin', 'claudio']
const class3 = ['isadora', 'isabela', 'laís', 'claudio', 'catarina', 'zeca', 'teresinha', 'emanuel', 'marcio', 'fatima', 'rodrigo', 'luiza', 'brenda', 'marina', 'marcelo', 'benedita', 'rebeca', 'filipe', 'helena', 'elisa', 'hugo', 'geraldo']
@tiagoamaro
tiagoamaro / example-1.js
Last active August 23, 2022 05:58
Lógica de Programação 2020 - Aula 06
function bubbleSort (items) {
const length = items.length
for (let i = (length - 1); i >= 0; i--) {
for (let j = (length - i); j > 0; j--) {
// Compare the adjacent positions
if (items[j] < items[j - 1]) {
// Swap the numbers
const tmp = items[j]
items[j] = items[j - 1]
items[j - 1] = tmp