Usuário:Vince

De Rede Mocambos
Ir para: navegação, pesquisa

Conteúdo


Rascunhos base de dados

Rota de Escambo

Nova arvore de categorias para o mapa.mocambos.net

Produtos:

  • Artesanado
    • Ceramica
    • Bambu
  • Da terra
    • Arroz
    • Feijao
    • Castanha do Pará

Rascunhos tech

Converter para WEBM

ffmpeg -i /home/befree/DaOrganizzare/20130500_Taguatinga_SambinhaNoBeco/P1030770.MOV -c:v libvpx -qmin 0 -qmax 50 -crf 10 -b:v 2.5M -c:a libvorbis -q:a 4 -r 25 /home/befree/Scrivania/SambaNoBeco_2_5m.webm

Limpar um database MySQL sem deleta-lo

/usr/bin/mysqldump -ubaobaxia -pSENHA -h mysql.mocambos.net --no-data --add-drop-table bbx_wordpress | grep ^DROP | /usr/bin/mysql -ubaobaxia -pSENHA -h mysql.mocambos.net bbx_wordpress

QIV

script para visualizar fotos randomicas:

export DISPLAY=:0.0
qiv -RStImTlfs -d 5 /data/acervo/redemocambos/taina/fotos_videos/ &

Instalar linux no Mac

Reinstalar grub

If you want to install grub into MBR of disk1 so that the installed grub code on MBR of disk1 tries to use the /boot/grub directory of /dev/sdb1 after booting debian different from the squeeze in /dev/sdb1, mount the /dev/sdb1 on /mnt

   mount -t auto /dev/sdb1 /mnt -o rw

and install grub on MBR of /dev/sdb by

   grub-install --root-directory=/mnt /dev/sdb

If you prepared /boot partition (/dev/sdb1) separately from / partition (for example /dev/sdb2),

   mount -t auto /dev/sdb2 /mnt -o rw
   mount -t auto /dev/sdb1 /mnt/boot -o rw
   grub-install --root-directory=/mnt /dev/sdb

Optmizar o SSD

No /etc/fstab colocar a opçao noatime e uma particao tmpfs:

# /dev/sda3
UUID=d102c513-272e-421f-ba36-ebcfea19654b       /       ext4    rw,noatime,errors=remount-ro    0       1
# /dev/sda4
UUID=84d164c7-7cf1-4e82-b1cc-d96056acc4fe       /home   ext4    rw,noatime,errors=remount-ro    0       0
tmpfs   /tmp    tmpfs   defaults,noatime,mode=1777 0 0

Mudar o scheduler colocando no /etc/rc.local essas duas linhas:

echo deadline > /sys/block/sda/queue/scheduler
echo 1 > /sys/block/sda/queue/iosched/fifo_batch
exit 0

Cultura Digitale Libera e Sostenibile

Le macchine per funzionare hanno bisogno di un programma che le comandi, un sistema operativo. Gli esseri umani non sono macchine, ma se volessimo fare una analogia, la cultura è il nostro sistema operativo. La cultura digitale regge le nostra vita digitale, e, sempre più rapidamente, il digitale si insinua e condizione il mondo "reale". Cos'è la Cultura Digitale? Come nasce? Per fare che? Racconto di un esperienza che nasce da oltre 400 anni di resistenza alla schiavitù fino a proporre un Cultura Digitale Libera e Sostenibile.

Capturar os headers com tshark

Substituir o ip e a interface:

sudo tshark -i wlan0 -f 'host 173.255.6.90' -R 'http' -S -l -V | awk '/^[HL]/ {p=30} /^[^ HL]/ {p=0} /^ / {--p} {if (p>0) print}'

Instala Debian em disco grande com RAID e LVM (ex. 2tb)

E' necessario criar, em cada disco, uma primeira partição (pode ser poucos mb) e selecionar "usar como are de boot do bios".

Ver mais aqui: http://jasonschaefer.com/archives/190

XEN

Alguns comandos pra saber:

Infos gerais

xm info

Limitar a memoria da maquina principal para 384 MB

xm mem-set Domain-0 384

Lancar a maquina

xm create nomemaquina.dominio.org

Acessar ao terminal

xm console nomemaquina.dominio.org

Desligar a maquina

xm shutdown nomemaquina.dominio.org

Tirar o cabo da tomada

xm destroy nomemaquina.dominio.org

Criar uma maquina (deveria instalar a partir de uma iso montada em loopback)

xen-create-image --hostname=nas.nes.it --size=10Gb --swap=4096Mb  --memory=2048Mb --arch=amd64 --role=udev \
 --force --install-method=debootstrap --install-source=/root/openmediavault

SSH

Para fazer um tunel a partir da sua maquina, usando como saida um servidor onde tem acesso ssh usar

 ssh -C2qTfnN -D 8080 mocambola@suamaquinana.net

Isso vai abrir um "socket" na porta 8080 da sua maquina. Assim pode diretamente usar os programas que tem suporte proxy/socks4 ou 5.

Instalação do Servidor Local

Primeiro instalar Ubuntu Server 11.10.

Instalar o LDAP usando o script aqui https://github.com/20/Mocambos_LDAP

Criar um usuário onde ira rodar o sistema Django

Instalar o ambiente django e as bibliotecas pode usar esse script

VirtualBox

Para iniciar uma maquina a partir do terminal

VBoxHeadless -s NomeMaquina &

Para entra na maquina pode usar o ssh

ssh mocambos@192.168.56.105

Redimensionar um hard disk virtual (Alem disso precisa redimensionar as particoes dentro. Para isso precisa ligar a imagem numa maquina com instalado gparted).

VBoxManage modifyhd NomeHardDisk.vdi --resize NovoTamanhoEmMB

Assinar novo uuid para um hard disk

VBoxManage internalcommands sethduuid NomeHardDisk.vdi

GIT

GIT get deleted files

git log --diff-filter=D --summary | grep json | sort | uniq | grep -v mocambolas | awk '{ print $4; }'

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.

GIT-ANNEX, some notes

To find a key from filepath:

git annex find --format='${key}\n' mocambolas/vince/CulturaDigitalLivreESustentavel.pdf

To find a file from a key:

git log --stat -S SHA256-s1548281--360879a388cae41051330b4d65f3669cb143ffda4a30e306a54735d5758f3cf5

To get the relative (to repository's root) file path:

git log --stat -S SHA256-s1548281--360879a388cae41051330b4d65f3669cb143ffda4a30e306a54735d5758f3cf5 --oneline | awk 'NR==2{print $1}'

GIT-ANNEX with Central Bare Repository (using SSH)

First of all let's create the central repository used to push and pull data. In the server:

mkdir gitCentralBareRep
cd gitCentralBareRep
git init --bare
git annex init origin

Now you can clone this central repository where you need.. In client A:

git clone ssh://servername/path/to/gitCentralBareRep
cd gitCentralBareRep
git annex init ClientA

Remember that the bare repository doesn't have the master branch yet. So let's now add some content in the client A and push it to the bare repository:

cd gitCentralBareRep
touch Image.jpg
git annex add Image.jpg
git commit -a --author="vince <vinceATmocambos.net>" -m "Adding an Image to test"
git push origin master git-annex # Next time you should't need to specify "origin master"
git annex copy --to origin
git branch master --set-upstream origin/master # Do it one for each repository clone

Now we can create an other copy in the client B and do some stuff:

git clone ssh://servername/path/to/gitCentralBareRep
cd gitCentralBareRep
git annex init ClientB
git branch master --set-upstream origin/master # Do it one for each repository clone
touch OtherImage.jpg
git annex add OtherImage.jpg
git commit -a --author="vince <vinceATmocambos.net>" -m "Adding an Image to test"
git pull
git annex merge
git push
git annex copy --to origin

We should see broken symlinks to the files. Let's get the content with:

git annex get .

That's all, right now.

GIT REBASE

A range of commits could also be removed with rebase. If we have the following situation:

E---F---G---H---I---J topicA

then the command

git rebase --onto topicA~5 topicA~3 topicA

would result in the removal of commits F and G:

E---H'---I'---J' topicA

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

Installazione server di casa

Guida LVM: http://www.linuxbsdos.com/2011/02/16/manual-lvm-configuration-guide-for-debian-6/

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

http://www.taina.org.br

http://www.mocambos.net

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

http://www.taina.org.br

http://www.mocambos.net

<verbatim> <form target="pagseguro" action="https://pagseguro.uol.com.br/checkout/v2/donation.html" method="post"> <input type="hidden" name="receiverEmail" value="vince@mocambos.net" /> <input type="hidden" name="currency" value="BRL" /> <input type="image" src="https://p.simg.uol.com.br/out/pagseguro/i/botoes/doacoes/160x20-doar.gif" name="submit" alt="Pague com PagSeguro - é rápido, grátis e seguro!" /> </form> </verbatim>

Ferramentas pessoais
Variantes
Ações
Navegação
Ferramentas
Rede Mocambos