This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.bash_profile | |
# exports | |
#export PATH="/usr/local:$PATH" | |
export PATH="/usr/local/mysql/bin:$PATH" | |
#export ARCHFLAGS="-arch i386 -arch x86_64" | |
export ARCHFLAGS="-arch x86_64" | |
export GREP_OPTIONS="--color=auto" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="UTF-8"?> | |
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | |
<plist version="1.0"> | |
<dict> | |
<key>KeepAlive</key> | |
<true/> | |
<key>Label</key> | |
<string>com.mysql.mysqld</string> | |
<key>Program</key> | |
<string>/usr/local/mysql/bin/mysqld_safe</string> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'rubygems' | |
require 'sinatra' | |
require 'dm-core' | |
require 'dm-validations' | |
require 'dm-timestamps' | |
# bem na apostila esqueceu de incluir essa gem | |
require 'dm-migrations' | |
# lembrar de informar na apostila a instalação da gem dm-mysql-adapter | |
DataMapper.setup(:default, "mysql://localhost/textos") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<head> | |
<!-- bem quando eu uso dessa forma meu layout o sinatra da um erro em: @texto.conteudo --> | |
<!-- mas quando eu retiro o @texto.conteudo o codigo de exemplo funciona todo perfeitamente --> | |
<title><%= @texto.conteudo || "My Texts!" %></title> | |
</head> | |
<body> | |
Text:<br /> | |
<%= yield %> | |
</body> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Gemfile | |
source 'http://rubygems.org' | |
source "http://gems.github.com" | |
gem 'rails', '3.0.6' | |
gem 'pg' | |
$ bundle install | |
Fetching source index for http://rubygems.org/ | |
Fetching source index for http://gems.github.com/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
As contas de usuário | |
Um arquivo em particular no diretório de configuração do sistema contém a lista de usuários do sistema: /etc/passwd. Ao contrário do que o nome sugere, ele geralmente não contêm senhas de usuários, pois eles são, na maioria dos casos, armazenados usando o formato de sombras em um arquivo separado /etc/shadow por razões de segurança. Ele, no entanto, vem com alguns bits de informações para cada usuário. Uma linha do arquivo passwd que representa um usuário, a seguinte sintaxe deve ser respeitado: | |
Name:password:ID:group ID:comment:home directory:login shell | |
Na prática, o bit senha é substituído por "x" indicando que a senha real é armazenado no arquivo /etc/shadow. | |
Adicionando uma nova conta de usuário pode ser tão simples quanto adicionar uma linha ao arquivo /etc/passwd. Basta utilizar o useradd. | |
A sintaxe mais básica para este comando é useradd usuário. Isso cria uma nova conta de usuário com as configurações padrão (que pode ser personalizada), um diretório home para o usuário local |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
============================================ | |
rvm | |
============================================ | |
build-essential vim curl zlib1g-dev libssl-dev libreadline6-dev | |
bash < <( curl http://rvm.beginrescueend.com/releases/rvm-install-head ) | |
OBS: copiar uma das ultimas linhas e instalar as libs que o rvm pede... e a da jvm tb! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
net.js:391 | |
throw new Error('Socket is not writable'); | |
^ | |
Error: Socket is not writable | |
at Socket._writeOut (net.js:391:11) | |
at Socket.write (net.js:377:17) | |
at EventEmitter.<anonymous> (/Users/herminio/Projects/node/nodejs-fnando/chat-tcp.js:12:12) | |
at EventEmitter.emit (events.js:81:20) | |
at Socket.<anonymous> (/Users/herminio/Projects/node/nodejs-fnando/chat-tcp.js:28:15) | |
at Socket.emit (events.js:64:17) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[herminio] rbx-1.2.3 ~ | |
$ nvm ls | |
v0.4.8 | |
stable: v0.4.8 | |
latest: v0.4.8 | |
current: v0.4.8 | |
default -> v0.4.8 | |
# use 'nvm sync' to update from nodejs.org | |
[herminio] rbx-1.2.3 ~ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[herminio] rbx-1.2.3 ~ | |
$ nvm ls | |
v0.4.8 | |
stable: v0.4.8 | |
latest: v0.4.8 | |
current: v0.4.8 | |
# use 'nvm sync' to update from nodejs.org | |
[herminio] rbx-1.2.3 ~ | |
$ node -v |