Skip to content

Instantly share code, notes, and snippets.

@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.
--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 (

Effective Engineer - Notes

What's an Effective Engineer?

  • They are the people who get things done. Effective Engineers produce results.

Adopt the Right Mindsets

# unicorn
description "unicorn ruby app server"
start on (local-filesystems and net-device-up IFACE=lo and runlevel [2345])
stop on runlevel [!2345]
env WORKDIR=/data
env PIDFILE=/data/tmp/pids/unicorn.pid
env CFGFILE=/data/config/unicorn.rb
@tiagoamaro
tiagoamaro / Procfile
Last active August 29, 2015 14:05 — forked from jayzes/Procfile
foreman and thinking sphinx (3.x) [source: https://gist.github.com/madhums/1161840]
sphinx: bundle exec rake ts:run_in_background
@tiagoamaro
tiagoamaro / deploy.rb
Last active December 21, 2015 12:38 — forked from ayamomiji/deploy.rb
# Check if remote file exists
def remote_file_exists?(full_path)
'true' == capture("if [ -e #{full_path} ]; then echo 'true'; fi").strip
end
# Check if process is running
def remote_process_exists?(pid_file)
capture("ps -p $(cat #{pid_file}) ; true").strip.split("\n").size == 2
end
sudo apt-get build-dep ruby1.9.1
wget -c http://ftp.ruby-lang.org/pub/ruby/2.0/ruby-2.0.0-p247.tar.gz
tar xzf ruby-2.0.0-p247.tar.gz
cd ruby-2.0.0-p247
./configure
make
sudo checkinstall -y --pkgversion 2.0.0-p247 --provides "ruby-interpreter"
# MySQL. Versions 4.1 and 5.0 are recommended.
#
# Install the MySQL driver:
# gem install mysql2
#
# And be sure to use new-style password hashing:
# http://dev.mysql.com/doc/refman/5.0/en/old-client.html
development:
adapter: mysql2
encoding: utf8