Skip to content

Instantly share code, notes, and snippets.

@everaldo
everaldo / resize_partition
Created February 14, 2016 02:47
Copiando e redimensionando uma partição
http://blog.oshim.net/2011/10/how-to-move-var-folder-to-new-partition.html
@everaldo
everaldo / harry_bulbapedia_bot.rb
Created April 16, 2016 02:27
Based On Thiago Harry's Bulbapedia Bot - Work In Progress - Original URL: http://pastebin.com/1vANKnUf
require 'nokogiri'
require 'open-uri'
BULBAPEDIA_URL='http://bulbapedia.bulbagarden.net/wiki/List_of_Pok%C3%A9mon_by_National_Pok%C3%A9dex_number'
doc = Nokogiri::HTML(open(BULBAPEDIA_URL))
Pokemon = Struct.new(:name, :url, :img)
@everaldo
everaldo / remote_pairing_setup.md
Created May 16, 2016 18:06 — forked from alvarobp/remote_pairing_setup.md
Setting up a remote pair station with SSH + TMUX and/or Reverse SSH Tunnel

Disclaimer: The following examples try to give an overview of the process followed in different scenarios. Some commands were actually written from memory. Some tools might exist simplifying all this. Furthermore, I'm no expert so if anyone ever reads this and knows any improvement, please let me know.

Case 1: Direct access to Pairing Station

Given that the Guest User can access the Pairing Station directly, either because the station is publicly available or because NAT port forwarding can be used, there's only one thing we need to do, give ssh access to the Guest User by adding his ssh public key to our Local User (pair) .ssh/authorized_keys file.

The local user would open up a tmux session with

tmux new-session -s pairing
@everaldo
everaldo / change_search_bar_chrome.html
Last active May 21, 2016 19:14
Autor: Gregory Mendes Mudar a cor da barra de pesquisa do browser no Google Chrome para Android, Windows Phone etc
<meta name="theme-color" content="‪#‎8844ee‬">
<meta name="msapplication-navbutton-color" content="#8844ee">

Concept

(The blockquote style does not look so well so I just pasted directly, but these are all quoted from the links in the bottom of this page)

You should not implement to_str unless your object acts like a string, rather than just having a string representation. The only core class that implements to_str is String itself.

[to_i and to_s] are not particularly strict: if an object has some kind of decent representation as a string, for example, it will probably have a to_s method… [to_int and to_str] are strict conversion functions: you implement them only if you object can naturally be used every place a string or an integer could be used.

to_str is used by methods such as String#concat to convert their arguments to a string. Unlike to_s, which is supported by almost all classes, to_str is normally implemented only by those classes that act like strings. Of the built-in classes, only Exception and String implement to_str

@everaldo
everaldo / bootable_iso.txt
Last active November 12, 2016 05:45
Create Bootable USB Windows
sudo cfdisk /dev/sdc
sudo mkfs.ntfs -f /dev/sdc1
sudo apt-get install mbr
sudo install-mbr -i n -p D -t 0 /dev/sdc
mkdir iso
sudo mount -o loop arquivo.iso iso/
sudo mount /dev/sdc1 /media/everaldo/
cp -r iso/* /media/everaldo/
sudo sync
sudo umount /media/everaldo
@everaldo
everaldo / laradock.sh
Created August 28, 2016 23:13
Laradock Setup
docker-compose up -d nginx mysql # iniciar laradock
docker-compose exec --user=laradock workspace bash # entrar no workspace
composer create-project laravel/laravel laravel-angular-rotas "5.2.*" # criar projeto no Laravel
# lembrete: alterar volumes_source para o diretório correto. Por padrão, é o diretório pai de laradock
@everaldo
everaldo / docker_python_http_server.sh
Last active September 15, 2016 22:14
Utilizo para criar um servidor no diretório atual, nas aulas de Desenvolvimento Web para Jogos
docker run -d -p 8000:8000 -v $PWD:/app -w /app python:3.6 python3 -m http.server 8000
#Tentar substituir por
docker run -d -p 8000:8000 -v $PWD:/app -w /app python:3.6 python3 -m http.server
@everaldo
everaldo / pooifpr_sistema_academico_db.sh
Last active October 16, 2016 22:16
Docker / Mysql / Phpmyadmin
# Cria um banco de dados sistema_academico, um usuário pooifpr com senha pooifpr e senha master pooifpr
# Depois, instancia um phpmyadmin executando na porta 8080, linkado com o servidor recém criado
#
docker pull mysql:latest
docker run --name mysqlpoo -e MYSQL_ROOT_PASSWORD=pooifpr \
-e MYSQL_DATABASE=sistema_academico \
-e MYSQL_USER=pooifpr \
-e MYSQL_PASSWORD=pooifpr \
-p 3306:3306 \
#!/bin/bash
# MODIFICADO POR EVERALDO GOMES EM 13/02/2017
# AUTHOR: (c) Rob W 2012, modified by MHC (http://askubuntu.com/users/81372/mhc)
# NAME: GIFRecord 0.1
# DESCRIPTION: A script to record GIF screencasts.
# LICENSE: GNU GPL v3 (http://www.gnu.org/licenses/gpl.html)
# DEPENDENCIES: byzanz,gdialog,notify-send (install via sudo add-apt-repository ppa:fossfreedom/byzanz; sudo apt-get update && sudo apt-get install byzanz gdialog notify-osd)
# Time and date