Skip to content

Instantly share code, notes, and snippets.

@aalvesjr
aalvesjr / luks.md
Created February 12, 2016 21:23
[LINUX] Using LUKS with keyfile and many passphrases

CryptSetup and LUKS

[Cryptsetup](https://gitlab.com/cryptsetup/cryptsetup) is utility used to conveniently setup disk encryption based on DMCrypt kernel module.

LUKS (Linux Unified Key Setup) is the standard for Linux hard disk encryption

Install

apt-get install cryptsetup
@aalvesjr
aalvesjr / books-list.md
Last active May 26, 2019 03:03
Lista de livros em bom estado.

Livros:

  • Ruby

    • Desenvolvimento Web ágil com Rails
    • Crafting Rails Applications
    • The Rails View
    • Ruby On Rails (Casa do Código)
    • Rails 3 Básico
  • Javascript

@aalvesjr
aalvesjr / README.md
Last active January 27, 2016 00:29
SYSDIG

Instalação

sysdig.org

$ curl -s https://s3.amazonaws.com/download.draios.com/stable/install-sysdig | sudo bash

Comandos

Redirecionar a saida do comando para um arquivo

$ sysdig -w nome-do-arquivo

lendo um arquivo gerado pelo sysdig

@aalvesjr
aalvesjr / jquery-on.md
Last active January 8, 2016 19:59
jQuery multiple events to trigger the same function

You can use .on() to bind a function to multiple events:

$('#element').on('keyup keypress blur change', function(e) {
    // e.type is the type of event fired
});

font: stackoverflow

@aalvesjr
aalvesjr / docker-compose.yml
Created January 5, 2016 04:11
[Docker] testes com docker-compose para desenvolvimento
gemdata:
image: busybox
volumes:
- ~/docker/gems:/gems
web:
image: ruby:2.3
environment:
- GEM_HOME=/gems
command: tail -f /dev/null # substituir por rails s
@aalvesjr
aalvesjr / gulpfile.md
Last active January 4, 2016 01:25
[JS] Exemplo de um gulpfile

Exemplo de estrutura de um gulpfile.js

var gulp        = require('gulp')
  , imagemin    = require('gulp-imagemin')
  , clean       = require('gulp-clean')
  //, concat      = require('gulp-concat')
  //, htmlReplace = require('gulp-html-replace')
  , uglify      = require('gulp-uglify')
  , usemin      = require('gulp-usemin')
  , cssmin      = require('gulp-cssmin')
@aalvesjr
aalvesjr / Dockerfile
Created December 29, 2015 07:34
[Docker] Dockerfile para ruby:2.3
FROM buildpack-deps:jessie
# https://www.ruby-lang.org/en/news/2015/12/25/ruby-2-3-0-released/
ENV RUBY_MAJOR 2.3
ENV RUBY_VERSION 2.3.0
ENV RUBY_DOWNLOAD_SHA256 ba5ba60e5f1aa21b4ef8e9bf35b9ddb57286cb546aac4b5a28c71f459467e507
# skip installing gem documentation
RUN echo 'install: --no-document\nupdate: --no-document' >> "$HOME/.gemrc"
@aalvesjr
aalvesjr / dicas.rb
Created December 28, 2015 20:27
[RAILS] Dicas de como debugar um controller de dentro do console 'rails c'
# De dentro do console do rails, temos a variavel app,
# de onde podemos consultar a sessão ou executar get e post em rotas da nossa aplicação
app.get "/dashboard/index"
# Redirected to http://www.example.com/login
# Filter chain halted as :require_logged_user rendered or redirected
# Completed 302 Found in 20ms (ActiveRecord: 0.0ms)
# => 302
app.session.to_hash
@aalvesjr
aalvesjr / tmux-atalhos.md
Last active July 29, 2024 13:48
[TMUX] Atalhos

quando ler <Prefix> será o padrão Ctrl + b

Window

  • <Prefix> c => para criar uma nova 'window'
  • <Prefix> % => para dividir uma 'window' verticalmente
  • <Prefix> " => para dividir uma 'window' horizontalmente
  • <Prefix> & => para fechar uma 'window'
  • <Prefix> . => move a window para algum indice ainda não utilizado
  • <Prefix> 0 a 9 => abre a 'window' com o numero digitado
  • \ w => abre a 'window' a partir de uma lista
@aalvesjr
aalvesjr / vim-cmds.md
Last active December 24, 2015 02:52
[VIM] atalhos

###Modo normal:

Navegação com vim, hjkl.
Navegação por palavras, w, e
Indo pro vim, com $, pro começo com 0 ou ^ ou _
Indo pro começo, fim: gg, G
Indo pra linha: 5G
Indo pra cima, meio, baixo (High, Middle, Low): H, M, L
Indo pro primeiro caracter k: fk
Repetindo: ;