Skip to content

Instantly share code, notes, and snippets.

View gabrielmoura's full-sized avatar

Gabriel Moura gabrielmoura

  • Computei
  • Brasil, Rio de Janeiro
  • 18:28 (UTC -03:00)
  • LinkedIn in/gmouradev
View GitHub Profile
@gabrielmoura
gabrielmoura / deploy.sh
Created October 29, 2022 18:45 — forked from cagartner/deploy.sh
Laravel Push deploy Github actions example
#!/bin/sh
set -e
vendor/bin/phpunit
(git push) || true
git checkout production
git merge master
@gabrielmoura
gabrielmoura / widevine-flash_armhf.sh
Created October 1, 2019 13:58 — forked from ruario/1-README.md
Fetches a ChromeOS image for ARM and extracts the Widevine and Flash binaries, saving them in a compressed archive
#!/bin/sh -eu
# Make sure we have wget or curl
available () {
command -v "$1" >/dev/null 2>&1
}
if available wget; then
DL="wget -O-"
DL_SL="wget -qO-"
elif available curl; then
@gabrielmoura
gabrielmoura / tmux.md
Created June 27, 2019 20:25 — forked from andreyvit/tmux.md
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

@gabrielmoura
gabrielmoura / Nvidia GPU principal
Created October 23, 2018 15:45
Nvidia GPU principal
sudo pacman -Rns bumblebee --noconfirm
sudo nano /etc/X11/xorg.conf.d/20-display.conf
Section "ServerLayout"
Identifier "layout"
Screen 0 "nvidia"
Inactive "intel"
EndSection
@gabrielmoura
gabrielmoura / fail2ban.md
Created December 27, 2017 23:35 — forked from bonsi/fail2ban.md
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,

= Arch Linux step-by-step installation =
= http://blog.fabio.mancinelli.me/2012/12/28/Arch_Linux_on_BTRFS.html =
== Boot the installation CD ==
== Create partition ==
cfdisk /dev/sda
* Create a partition with code 8300 (Linux)
@gabrielmoura
gabrielmoura / perfectelementary.bash
Created May 11, 2017 03:55
HowTo Install the perfect Elementary-OS
#Download Elementary OS from here:
#http://sourceforge.net/projects/elementaryos/files/stable/
#First you update your system
sudo apt-get update && sudo apt-get dist-upgrade
#Install Google Chrome
wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | sudo apt-key add -
sudo sh -c 'echo "deb http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google-chrome.list'