Skip to content

Instantly share code, notes, and snippets.

View embs's full-sized avatar

Matheus Santana embs

View GitHub Profile
@embs
embs / mnt
Created June 20, 2013 12:57
Mounting Linux partition
Boot your system into a live CD. Mount your system into the live CD:
sudo mount /dev/sda1 /mnt
sudo mount --bind /dev /mnt/dev
sudo mount --bind /dev/pts /mnt/dev/pts
sudo mount --bind /proc /mnt/proc
sudo mount --bind /sys /mnt/sys
Log into the mounted system:
sudo chroot /mnt
@embs
embs / projet_rn.md
Last active December 14, 2015 06:09
Especificação do Projeto de Redes Neurais [IF702]

Projeto de Redes Neurais (2012.2)

Informações Gerais

  • Equipes de 4 pessoas
  • Ao final do projeto
    • Entrega de relatório; e
    • Apresentação;

O projeto consiste em utilizar o Matlab para simular uma Rede Multilayer Perceptron com o script e os dados fornecidos no site da disciplina. Basicamente, o que se há de fazer é alterar o nome de rotinas no script e definir parâmetros da rede.

O Problema

@embs
embs / Tutorial Quince Site.md
Last active May 24, 2017 12:25
Como pegar projeto de repositório no Heroku, realizar modificações e enviá-las novamente ao remoto.
@embs
embs / Sunspot.md
Created October 18, 2012 17:11
A Sunspot review for Redu Apps search

#Sunspot

Uma mão na roda

Muito fácil de instalar e fazer setup

Aqui, ó.

Priorização de resultados baseada em texto

Dá pra fazer um boost muito legal e ser tolerante com resultados que não apresentam exatamente os termos buscados - isto é, possuem alguns termos entre os termos da busca. Ah! Também dá pra priorizar aqueles que apresentem os termos com exatidão.

@embs
embs / database.yml
Created September 12, 2012 18:24
PostgreSQL rails database configuration FTW
common: &common
adapter: postgresql
username: matheus
password: # from psql setup, see Postgresql
development:
<<: *common
database: chatlogger_development
test:
@embs
embs / gist:3614398
Last active October 10, 2015 01:57 — forked from guiocavalcanti/gist:1600711
Configurando ambiente ruby

O que são essas coisas?

  • RVM: gerenciador de versões de ruby. Porém o mais legal dele é facilitar a compilação.
  • RubyGems: gerenciador de dependências entre Gems (biblioticas ruby). É o apt-get do Ruby.
  • Rails 3: um gem (biblioteca) da linguagem Ruby
  • MySQL: Sistema de gerenciamento de banco de dados
  • SQLite: Sistema de gerenciamento de banco de dados portátil.

Instalação do Ruby 1.9.3/Rails 3 usando o RVM no Ubuntu

@embs
embs / gist:3066666
Created July 7, 2012 14:31 — forked from guiocavalcanti/gist:1600711
Configurando ambiente ruby

O que são essas coisas?

  • RVM: gerenciador de versões de ruby. Porém o mais legal dele é facilitar a compilação.
  • RubyGems: gerenciador de dependências entre Gems (biblioticas ruby). É o apt-get do Ruby.
  • Rails 3: um gem (biblioteca) da linguagem Ruby
  • MySQL: Sistema de gerenciamento de banco de dados usado no Redu
  • SQLite: Sistema de gerenciamento de banco de dados portátil.

Instalação do Ruby 1.8/Rails 3 usando o RVM no Ubuntu

@embs
embs / ImageSizeCalculator.java
Created June 20, 2012 16:44
Código base da prova prática de PLC(~if686) - Java Concorrente
import java.io.File;
public class ImageSizeCalculator {
private long totalBytes = 0;
private long numFiles = 0;
// Tamanho do maior arquivo que não é um diretório.
private long sizeOfLargestFile = 0;
private void getTotalSize(File file) {
@embs
embs / Rails 3.1 authentication from scratch.markdown
Created June 12, 2012 17:49
Authentication from Scratch with Rails 3.2.5

Authentication from Scratch with Rails 3.2.5

Rails 3.1 gives us a really easy way to authenticate users in our app: http_basic_authenticate_with. Using it, all we need to do is create a model for the user (certainly, User model :P) with an attribute called password_digest and some views feature for login and register users. After all, let's relax and let Rails do the hard work.

What we'll need

Gemfile

gem 'bcrypt-ruby', '~> 3.0.0'

Model

First at all, an User model which we can generate by following: rails g model user email:string password_digest:string and then add the following methodo call to generated class: has_secure_password

@embs
embs / Installing Ruby 1.9.3 with RVM.markdown
Created June 8, 2012 17:14
Installing Ruby 1.9.3 and Rails gem with RVM

Requisite

  • RVM

Get latest version of RVM

rvm get latest

Install dependencies

sudo apt-get install build-essential libreadline6 libreadline6-dev zlib1g zlib1g-dev libssl-dev libyaml-dev libsqlite3-0 libsqlite3-dev sqlite3 libxml2-dev libxslt-dev autoconf libc6-dev ncurses-dev automake libtool bison subversion

Install Ruby 1.9.3