Usuário:Vince
Conteúdo |
Rascunhos tech
GIT
Git é uma ferramente fantastica para manter o controle das versões/mudanças de arquivos textuais (principalmente), pois foi exatamente criado para facilitar o desenvolvimento coletivo do codigo do kernel do Linux.
Antes de tudo coloque suas informações:
git config --global user.name "Vince" git config --global user.email "vince AT mocambos ponto net"
Para criar um repositorio.. criar uma pasta e depois entrar nela e
mkdir ProjetoComGit cd ProjetoComGit git init
Adicionar a pasta
git add .
Cada vez que voce cria um arquivo na pasta, precisa falar ao git de controlar a versão com
git add novoArquivo.py
Todas as operações para ficarem guardadas pelo git precisam ser confirmadas com um commit
git commit -a -m "Aqui vai um comentario que sintetize muito as ultimas novidades no projeto"
Notar o uso do "-a", que fala pro git guardar todos os arquivos mudados e "-m" para colocar uma nota sobre as alterações que voce esta guardando.
EMACS
Indent/unindent a block of lines
To indent (or unindent) a block of lines together rigidly (adding or removing whitespace at the line beginning):
Select all the lines to indent Ensure the TextCursor is at the beginning of the last line to indent. C-u NUM C-x TAB to indent NUM columns. A negative NUM (e.g., C-- 4 C-x TAB) un-indents, removing a rectangle of whitespace.
Dividir a tela + Follow Mode
Para dividir a tela e dispor o documento nas duas telas (como se fossem duas colunas)
Usar "C-x 3" e depois abilitar o follow mode com "alt-x follow-mode". Para passar de uma coluna pra outra usar o "C-x o" ou com o follow mode abilitado pode usar as setinhas pra correr no documento.
Dimensoes das telas
With the mouse, you can drag the window sizes around.
Click anywhere on the mode line that is not otherwise 'active' (the buffer name is safe, or any unused area to the right hand side), and you can drag up or down.
Side-to-side dragging requires a very precise click on the spot where the two mode lines join.
C-x - (shrink-window-if-larger-than-buffer) will shrink a window to fit its content. C-x + (balance-windows) will make windows the same heights and widths. C-x ^ (enlarge-window) increases the height by 1 line, or the prefix arg value. A negative arg shrinks the window. e.g. C-- C-1 C-6 C-x ^ shrinks by 16 rows, as does C-u - 16 C-x ^.
(There is no default binding for shrink-window.)
C-x } (enlarge-window-horizontally) does likewise, horizontally. C-x { (shrink-window-horizontally) is also bound by default.
LDAP
Sincronização dos servidores
O LTSP pode ser usado para manter sincronizadas as contas de usuarios entre as varias comunidades. Se pode usar OpenLDAP em configuração "N-Way Multi Master"
Figure 7.2-4 shows a 3-Way Multi-Master (1, 2, 3) Configuration. Each Master is configured - in its slapd.conf file (4, 5, 6) - as a provider (using the overlay syncprov directive) and as a consumer for all of the other masters (using the syncrepl directive). Each provider must be uniquely identified using a ServerID directive. Each provider is further, as noted above, synchronized to a common clock source. Thus the provider (1) of DIT (7) contains an overlay syncprov directive (the provider overlay) and two refreshAndPersist type syncrepl directives, one for each of the other providers (2, 3) as shown by the communication links (1-1, 1-2). Similarly each of the other providers has a similar configuration - a single provider capability and refreshAndPersist syncrepl directives for the other two masters.
Django
Preparando um ambiente para trabalhar (virtualenv)
Antes de tudo instalar esses pacotes:
sudo apt-get install virutalenv python-dev libldap2-dev libsasl2-dev libssl-dev
Agora podemos criar uma pasta com nossos ambientes virtuais:
mkdir VirtualEnvs
Criamos o ambiente para o portal da Mocambos assim:
virtualenv --no-site-packages --distribute VirtualEnvs/Mocambos_Portal
Para ativar o ambiente:
source VirtualEnvs/Mocambos_Portal/bin/activate
Instalando o Django
Podemos agora instalar tudo no nosso ambiente virtual sem mexer com os pacotes de sistema. Começamos com Django e as bibliotecas ldap do python:
pip install django python-ldap
Agora o backend de authenticação LDAP do django
pip install django-auth-ldap
Instalação e configuração (Versão de desenvolvimento)
O django é um framework para desenvolvimento rapido de sistemas na web. Para conseguir ter uma versâo sempre atualizada e atualizar rapidamente se pode usar a versão no repositorio git. Para isso executar:
git clone https://github.com/django/django.git
Depois ver qual é a pasta para as extensões do django.. pode ver qual é assim:
python -c "from distutils.sysconfig import get_python_lib; print get_python_lib()"
E criar um arquivo django.pth com o link para a pasta do django que acabamos de clonar/baixar:
echo PASTA_ATUAL/django-trunk > SITE-PACKAGES-DIR/django.pth
Para concluir um link para o executavel.. algo do tipo:
ln -s PASTA_ATUAL/django-trunk/django/bin/django-admin.py /usr/local/bin
Com alguns modulos do django é possivel usar o LDAP como banco de contas dos usuarios. Precisa baixar o e usamos sempre a versão que está no repositorio:
hg clone https://bitbucket.org/psagers/django-auth-ldap
O pode usar a versao no pacote tar.gz:
wget http://pypi.python.org/packages/source/d/django-auth-ldap/django-auth-ldap-1.0.12.tar.gz
Vai precisar instalar entrando na pasta e exectuando
sudo python setup.py install
Depois no arquivo de configuração settins.py do projeto/site colocar no final:
BOTAR A CONFIG
Textos etc.
Email pro Ushahidi.com
Date: Mon, 25 Apr 2011 15:49:41 -0300
Dear Ushahidi Team,
I'm Vince from the "Casa de Cultura Tainã" located in Campinas - Brazil. Our Cultural House is commemorating 20th year of activities and fight. We started since 6 years a communication network between quilombos[1] communities called "Rede Mocambos"[2]. We focus on sharing knowledge to empower local communities with cultural, social, human and technological development, preserving environment, preserving history and african and indigenous identities and traditional cultures. We work with digital inclusion adopting free and open technologies..
We got 3 years ago an important result signing a cooperation agree with Brazilian Ministery of Communication[3] and right now the network connect more than 140 communities to internet using bidirectional satellite connection. We also participate of Brazilian Ministry of Culture project "Pontos de Cultura"[4], started by musician Ministry Gilberto Gil, based also on Casa de Cultura Tainã experience. Our work was recognised with biggest Brazilian title in November 2006 that is "Ordem ao Merito Cultural" given by Brazilian President of the Republic, Lula and Ministry Of Culture, Gilberto Gil[5].
We believe that traditional communities can get better auto-determination and better life quality with new technologies but not in the classic digital inclusion way, that is buying computers, give internet connection and making new consumers of the economy system, like passively using facebook, msn, youtube & co. We're working on research and development, teaching people in Casa de Cultura Tainã, same as others regional Rede Mocambos centers called "Núcleos de Formação" in other 9 places in Brazil.
We like very much your work and we'd like to work someway together.. We will be also happy to receive you here.
We started using ushahidi to collect and organize information to better support our fights: http://mapa.mocambos.net
We will happy to start some bridge with you and also some quick active technical exchanges.
Abraço, Vince
[1] see http://en.wikipedia.org/wiki/Quilombo
[2] see http://www.mocambos.net
[3] see http://www.idbrasil.gov.br
[4] see http://www.cultura.gov.br/culturaviva
[5] see http://www.mocambos.net/videos/taina-ordem-ao-merito-cultural/view
Casa de Cultura Tainã / Rede Mocambos
Email pro Gandi.net
Date: Fri, 16 May 2008 16:25:39 -0300
Dear Gandi Team,
I'm Vincenzo from the Casa de Cultura Tainã located in Campinas - Brazil. Our Cultural House is commemorating 20th year of activities and fight. We started since 2 years a network of communities called "Rede Mocambos" (see http://www.mocambos.net ). We focus on empowering local communities with cultural, social, human and technological development, preserving environment, preserving history and identity like african, indigenous and traditional culture. We work with digital inclusion adopting free technologies (like FLOSS).. We signed a cooperation with Brazilian Ministery on Communication (see http://www.idbrasil.gov.br ) and right now we connected 27 Quilombos communities to internet using bidirectional satellite connection. We also makes part of Brazilian Ministry of Culture well known project "Pontos de Cultura" (see http://www.cultura.gov.br/cultura_viva/ ), leaded by musician Ministry Gilberto Gil. Our work was recognised with biggest Brazilian title in November 2006 that is "Ordem ao Merito Cultural" given by Brazilian President of the Republic, Lula and Ministry Of Culture, Gilberto Gil (see http://www.mocambos.net/videos/taina-ordem-ao-merito-cultural ).
The network is growing very fast and next July we're going to make first Rede Mocambos national meeting (maybe international since we're linking with communities in Mozambique and Angola and we're trying to grant their presence).
We believe that traditional communities can get better auto-determination and better life quality with new technologies but not in the classic digital inclusion way, that is buying computers, give internet connection and making new consumers of economy system, like using orkut, msn, youtube & co. We're working on research and development, forming people in Casa de Cultura Tainã and we're going to start others regional centres "Núcleos de Formação" in other 3 places in Brazil.
We like very much your work and we would like to work together.. We will be also happy to receive you here.
Abraço, Vince
Casa de Cultura Tainã / Rede Mocambos