Skip to content

Instantly share code, notes, and snippets.

View gabrielmoura's full-sized avatar

Gabriel Moura gabrielmoura

  • Computei
  • Brasil, Rio de Janeiro
  • 19:02 (UTC -03:00)
  • LinkedIn in/gmouradev
View GitHub Profile
@gea0
gea0 / arch-rpi-64-full-disk-encryption-ssh-unlock.md
Last active March 24, 2024 14:36
Tutorial for installing a 64-bit Arch Linux ARM system on the Raspberry Pi 3B+, with an encrypted root filesystem, and the option to remotely unlock it via a pre-boot SSH daemon.

Arch Linux ARM 64 on Raspberry Pi 3 B+ With Full Disk Encryption And SSH Unlock: 2018 Edition

There are multiple ways to get a full disk encrypted arch linux system on raspberry. In this tutorial, we will install a 64-bit arch linux armv8 system, using dropbear as ssh server for remote pre-boot unlocking of the root filesystem. However, it will still be possible to unlock and use the pi as usual, with a keyboard and monitor. We will also create an unencrypted partition in the installation process, usable as a rescue system.

Differences to the 32-bit arch linux arm version:

  • probably better performance
  • can run 64-bit software
  • comes without the proprietary video-driver blobs
@CSRaghunandan
CSRaghunandan / nginx.conf
Last active April 20, 2024 19:47
Nginx configuration for serving mp4 videos
#user nobody;
worker_processes 4;
#error_log logs/error.log;
#error_log logs/error.log notice;
#error_log logs/error.log info;
#pid logs/nginx.pid;
@Gabrielgtx
Gabrielgtx / PKGBUILD duolingo
Last active November 6, 2021 17:54
Unofficial release of Duolingo for Linux / Learn languages by playing a game. It's 100% free, fun, and scientifically proven to work. / https://www.duolingo.com/
pkgname=duolingo
pkgver=0.3.1
pkgrel=1
pkgdesc="Unofficial release of Duolingo for Linux / Learn languages by playing a game. It's 100% free, fun, and scientifically proven to work."
url="https://www.duolingo.com/"
arch=('x86_64')
license=('custom')
install=duolingo.install
source=("https://github.com/mikethedj4/duolingo-linux/raw/master/${pkgname}-linux.tar.gz"
"duolingo.desktop")
@SmartFinn
SmartFinn / ip_firewall_filter.rsc
Last active March 1, 2024 23:00
MikroTik (RouterOS) Zone-Based Firewall Example
# jan/29/2018 22: 4:17 by RouterOS 6.41
#
/interface list
add name=public comment="public network"
add name=local comment="local network"
add name=guest comment="guest network"
# Change the interfaces below to your own
/interface list member
add list=public interface=ether1
@joecampo
joecampo / fail2ban.md
Last active April 25, 2024 18:20
fail2ban – stop HTTP(S) route abuse/brute forcing

If you're not familiar: What is fail2ban? fail2ban is an awesome linux service/monitor that scans log files (e.g. auth.log for SSH) for potentially malicious behavior. Once fail2ban is tripped it will ban users for a specified duration by adding rules to Iptables. If you're unfamiliar with fail2ban Chris Fidao has a wonderful (& free!) series about security including setting up fail2ban here.

Recently Laravel released a new feature in 5.1 to throttle authentication attempts by simply adding a trait to your authentication controller. The Laravel throttle trait uses the inputted username, and IP address to throttle attempts. I love seeing this added to a framework out of the box, but what about some of our other apps not built on Laravel? Like a WordPress login? Or even an open API etc.? Ultimately,

@manuks
manuks / aes.js
Created August 14, 2015 10:56
Node js aes-256-cbc encryption and decryption
var keyhex = "8479768f48481eeb9c8304ce0a58481eeb9c8304ce0a5e3cb5e3cb58479768f4"; //length 32
var blockSize = 16;
function encryptAES(input) {
try {
var iv = require('crypto').randomBytes(16);
//console.info('iv',iv);
var data = new Buffer(input).toString('binary');
//console.info('data',data);
@acfreitas
acfreitas / cpfCnpjRandom.php
Last active March 7, 2024 13:54
Gerador de CPF e CNPJ aleatório
/**
* Método para gerar CNPJ válido, com máscara ou não
* @example cnpjRandom(0)
* para retornar CNPJ sem máscar
* @param int $mascara
* @return string
*/
public static function cnpjRandom($mascara = "1") {
$n1 = rand(0, 9);
$n2 = rand(0, 9);
@shamil
shamil / mount_qcow2.md
Last active May 3, 2024 06:35
How to mount a qcow2 disk image

How to mount a qcow2 disk image

This is a quick guide to mounting a qcow2 disk images on your host server. This is useful to reset passwords, edit files, or recover something without the virtual machine running.

Step 1 - Enable NBD on the Host

modprobe nbd max_part=8
@andreyvit
andreyvit / tmux.md
Created June 13, 2012 03:41
tmux cheatsheet

tmux cheat sheet

(C-x means ctrl+x, M-x means alt+x)

Prefix key

The default prefix is C-b. If you (or your muscle memory) prefer C-a, you need to add this to ~/.tmux.conf:

remap prefix to Control + a