Skip to content

Instantly share code, notes, and snippets.

View fabianogoes's full-sized avatar
:octocat:
Focusing

Fabiano Góes fabianogoes

:octocat:
Focusing
View GitHub Profile
@fabianogoes
fabianogoes / admin.py
Last active December 11, 2015 23:08
ModelForm - duvida na parte de editar dados
#coding: utf-8
# admin.py
from django import forms
from models import Pais
class PaisForm(forms.ModelForm):
class Meta:
model = Pais
fields = ['nome', 'sigla']
@fabianogoes
fabianogoes / vimrc
Created September 19, 2013 22:59
configuração vim
" Configuration file for vim
set modelines=0 " CVE-2007-2438
" Normally we use vim-extensions. If you want true vi-compatibility
" remove change the following statements
set nocompatible " Use Vim defaults instead of 100% vi compatibility
set backspace=2 " more powerful backspacing
set ai " auto indenting
set history=5000 " keep 100 lines of history
@fabianogoes
fabianogoes / git status após resolver conflito
Created May 11, 2014 17:30
git status após resolver conflito
# HEAD detached from 6c3cfe3
# You are currently rebasing branch 'pelican' on '6c3cfe3'.
# (all conflicts fixed: run "git rebase --continue")
#
nothing to commit, working directory clean
@fabianogoes
fabianogoes / worldcup_results.py
Last active August 29, 2015 14:02
Scrip Python para hackear os resultados dos jogos da copa
#! /usr/bin/env python
import urllib2
import json
resp = urllib2.urlopen('http://worldcup.sfg.io/matches').read()
for jogo in json.loads(resp.decode('utf-8')):
if jogo['status'] == 'completed':
print "{0} {1} x {2} {3}".format(jogo['home_team']['country'],
jogo['home_team']['goals'],
jogo['away_team']['country'],
@fabianogoes
fabianogoes / nginx-virtualhost.sh
Last active August 29, 2015 14:04
nginx-virtualhost
server {
listen 8000;
location /static/ {
autoindex on;
alias /deploy/managercon/system/static/;
expires 30d;
}
location / {
<settings>
<servers>
<server>
<id>nexus</id>
<username>admin</username>
<password>admin123</password>
</server>
</servers>
<mirrors>
<mirror>

Maven, Nexus

Dependences and Archetype

  • Instalar e configurar o Java no OS.
  • Instalar e configurar o Maven no OS.
  • Instalar e configurar o Tomcat no OS.
  • Configurar usuário no Tomcat.
  • Fazer *deploy do Proble no Tomcat.

Colocar o Tomcat no Boot do Linux

  • Criar o arquivo tomcat no diretório /etc/init.d/
#!/bin/sh
# description: Tomcat
# processname: tomcat
# chkconfig: 234 20 80

JAVA_HOME=/usr/local/java/jdk1.7.0_07
@fabianogoes
fabianogoes / java-maven-references.md
Last active August 29, 2015 14:06
References Java Maven

References Java Maven

1) Configurar usuário admin no Tomcat(/CATALINA_HOME/conf/tomcat-users.xml)
<tomcat-users>
	<role rolename="manager"/>
	<role rolename="admin"/>
	<role rolename="manager-gui"/>
	<role rolename="manager-script"/>
@fabianogoes
fabianogoes / install-python-in-macos.md
Created January 7, 2015 23:03
Install Python/Virtualenv/Django in Mac Os

Install Python

$ brew install readline sqlite gdbm
$ brew install python --universal --framework
$ python --version
$ pip --version