sábado, 19 de dezembro de 2009

Transferencia rapida de arquivos pela rede - FUG

Copiei está dica do FUG, eu já conhecia mas não lembrava, creditos ao FUG!

Transferir arquivo rápido via LAN? Utilize o netcat.

servidor# nc -l PORTA > /tmp/transferido.tar.gz
cliente# nc IP PORTA < /tmp/atransferir.tar.gz Abraços !


terça-feira, 17 de novembro de 2009

Retirando linhas repitidas de um arquivo

Comando uniq: retala ou omite linhas repitidas de um arquivo.
Comando sort: organizar em ordem alfabetica o conteudo do arquivo.

sort file.txt | uniq

segunda-feira, 16 de novembro de 2009

IPV6 - Freenet6 (anonymous)

Você gostaria de navegar na internet em IPV6, por curiosidade, ou por estudos mesmo ? Você pode ! Existem na internet provedores de acesso, que disponibilizam acesso a rede em IPV6, por meio de um tunel. Tunnel Broker - uma tradução groceira "canal intermediador", te dá um gostinho de como será as coisas na internet dentro de pouco tempo. Este post está sendo escrito por meio de um trabalho de faculdade da matéria Tecnologias atuais, um trabalho que particularmente gostei.

Vamos lá ! Irei utilizar Ubuntu 9.10
Suponho que você já tenha um conhecimento prévio em linux


-> Baixando cliente ipv6 - Freenet6
$ cd /tmp
$ wget http://go6.net/4105/file.asp?file_id=160 -O gw6c.tar.gz
$ tar -zxvf gw6c.tar.gz
$ cd gw6c/bin
$ sudo ./gw6c

Se pedir um Y ou N, digite "Y" ! Provavel que irá pedir na primeira vez, para adicionar mais algum servidor de TunnelBroker.

Vamos aos testes:

-> Verificando se carregou a interface tun:

celso-cmjr@servidor:/tmp/gw6c/bin$ ifconfig tun
tun Link encap:UNSPEC HWaddr 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00
inet6 addr: 2001:5c0:1000:b::f1/128 Scope:Global
UP POINTOPOINT RUNNING NOARP MULTICAST MTU:1280 Metric:1
RX packets:6 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:500
RX bytes:416 (416.0 B) TX bytes:0 (0.0 B)

-> Interface tun carregada, vamos aos testes de conectividade:

celso-cmjr@servidor:/tmp/gw6c/bin$ ping6 -n www6.research.earthlink.net
PING www6.research.earthlink.net(2001:4840:ffff::12) 56 data bytes
64 bytes from 2001:4840:ffff::12: icmp_seq=1 ttl=242 time=326 ms
64 bytes from 2001:4840:ffff::12: icmp_seq=2 ttl=242 time=328 ms

-> Abra o firefox, acesse o site do projeto http://www.kame.net, se a tartaruga estiver se movimentando, pronto você está navegando na internet por IPV6, Parabéns ! Caso não ! Revise os passos seguidos, não tem segredo ;)

Espero que tenha chegado até o fim.


Abraços.

Referências:
http://www.ubuntu.com
http://www.ipv6.br
https://wiki.ubuntu.com/IPv6
http://www.ipv6.org
http://go6.net/
http://ipv6.google.com
http://www.kame.net

sábado, 27 de junho de 2009

Derrubar uma conexão tcp/udp

Encontrar PID da porta 23 rodando no servidor, o comando fuser pode ajudar a encontrar o PID.
1) fuser 23/tcp

Matando a conexão.
2) kill -9

.

sábado, 18 de abril de 2009

Mysql - Dicas

-> Definindo senha root mysql
#mysql -D mysql -u root -p
Enter password:
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 34
Server version: 5.0.77 Source distribution

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

mysql> update user set Password=PASSWORD('senhaRootAqui') where User='root';
mysql> flush privileges;
mysql> quit;


-> Criando tabela.
mysql> create table aluno (
serie varchar(40),
nome varchar(50),
teste vachar(255)
);

-> Adicionando colunas na tabela.
mysql> alter table aluno add idade int(3) ;

-> Deletando coluna "teste" da tabela aluno,
mysql> alter table aluno drop teste;

-> Apagando Registros
mysql> delete from aluno where serie="2";

-> Adicionando configuração á um campo da table:
alter table aluno add primary key(serie) ;

-> Removendo chaves primaria da tabela:
alter table aluno drop index serie;

-> Adicionando uma coluna no primeiro campo da tabela:
alter table aluno add id int(11) not null fist;

-> Adicionando uma coluna apos uma que você queira:
alter table aluno add teste2 varchar(33) not null after serie;

quinta-feira, 9 de abril de 2009

Sigma

http://www.sigma-six.org/

unzip sigma.zip
mysql -u sigma -p sigma < type="mysql">

installation:

-copy all files to your web host
-use phpmyadmin or your mysql interface to run site.sql against your database.
-open site.xml and edit the database section with your database details.
-set permissions on the upload directory to allow write/delete -go to index.php and login with username of admin with a password of test.
-be sure to change the passwords for the admin and regular user.

Add this to your htaccess file to prevent viewing of the xml config file.

Gerenciamento de IP's

Mantenha uma base informações de ips de sua rede pronta quando precisar. Não fique pergundo o ip de seu cliente !


Utilize o phpip !

Em http://www.phpip.net/download.php, baixe o pacote:

phpip-4.3.2-build-200611081420.tar.gz


Depois:

# tar -zxvf phpip-4.3.2-build-200611081420.tar.gz -C /var/www
# mv phpip-4.3.2-build-200611081420/ /var/www/phpip

Crie a base de dados, e usuário do sistema phpip:

# mysql -u root -p -e "create database phpip"

# mysq -u root -p -e "grant all privileges on phpip_management.* to phpip@localhost identified by 'phpip'";


Depois acesse no navegador de internet:

http://seuip/phpip


Ira aparecer um console de instalação é bem simples ! Você ira sacar !

Depois de configurado é só acessar novamente o http://seuip/phpip !



Agora coloque a casa em ordem !!

Acesse o link abaixo, para aprender mais:
http://www.phpip.net/documentation.php


Abs.


Mais informações:


http://www.debianhelp.co.uk
http://www.phpip.net