relatório de atividades relacionadas à minha pesquisa em métodos de modelagem computacional.

segunda-feira, 3 de novembro de 2008

IP Masquerading

sudo apt-get install iptables
echo 1 > /proc/sys/net/ipv4/ip_forward
iptables -t nat -A POSTROUTING -s 192.168.2.0/24 -o eth0 -j MASQUERADE

The diskless nodes should be set up so that 192.168.2.1 is their
default gateway.

eth0 = 192.168.2.1

segunda-feira, 27 de outubro de 2008

gnuplot superfícies

andicionando linhas em branco com o sed
sed '0~6G' dados.dat > dados2.dat

gnuplot
set dgrid3d
splot 'dados2.dat' u 1:2:3 w l

quinta-feira, 11 de setembro de 2008

X remoto

X remoto
X :1 -query ip.do.servidor

via ssh
ssh -tYC firewall "ssh -YC alvo"

quarta-feira, 10 de setembro de 2008

reverse ssh tunnel

~$ cat bin/ssh-r.sh
#!/bin/sh
# $REMOTE_HOST is the name of the remote system
REMOTE_HOST=firewall
# $REMOTE_PORT is the remote port number that will be used to tunnel
# back to this system
REMOTE_PORT=22222
# $COMMAND is the command used to create the reverse ssh tunnel
COMMAND="ssh -q -N -R $REMOTE_PORT:localhost:22 $REMOTE_HOST"
# Is the tunnel up? Perform two tests:
# 1. Check for relevant process ($COMMAND)
pgrep -f -x "$COMMAND" > /dev/null 2>&1 || $COMMAND
# 2. Test tunnel by looking at "netstat" output on $REMOTE_HOST
ssh $REMOTE_HOST netstat -an | egrep "tcp.*:$REMOTE_PORT.*LISTEN" >
/dev/null 2>&1
if [ $? -ne 0 ] ; then
pkill -f -x "$COMMAND"
$COMMAND
fi

~$ crontab -e
# m h dom mon dow command
*/17 * * * * ~/bin/ssh-r.sh

fonte: http://www.brandonhutchinson.com/ssh_tunnelling.html

nfs

server
sudo apt-get install portmap nfs-kernel-server

sudo gedit /etc/exports
/home 192.168.0.0/255.255.255.0(rw,sync,no_subtree_check)
/usr/local
192.168.0.0/255.255.255.0(rw,sync,no_subtree_check)
The above shares /home and /usr/local to all clients in the private
network falling within the designated ip address range.

After setting up /etc/exports, export the shares:
sudo exportfs -ra

You'll want to do this command whenever /etc/exports is modified.
Restart Services
If /etc/default/portmap was changed, portmap will need to be restarted:
sudo /etc/init.d/portmap restart
The NFS kernel server will also require a restart:
sudo /etc/init.d/nfs-kernel-server restart

client
sudo apt-get install portmap nfs-common

sudo mount 192.168.1.42:/home/music /home/poningru/music

rsync

rsync via tunnel
ssh -CNq firewall -L 2222:alvo:22 > /dev/null 2>&1 &
-C Requests compression
-N Do not execute a remote command.
-q Quiet mode.
rsync -azc -e 'ssh -p 2222' origem localhost:

rsync
rsync -azc origem destino:
-c, --checksum skip based on checksum, not mod-time & size
-a, --archive archive mode; same as -rlptgoD (no -H, -A)
-z, --compress compress file data during the transfer

povray metal

#include "metals.inc"
#include "golds.inc"
sphere { <0, 0, -5> , 1 texture {T_Brass_1B} }

T_Brass_1A to T_Brass_5E
T_Copper_1A to T_Copper_5E
T_Chrome_1A to T_Chrome_5E
T_Silver_1A to T_Silver_5E
A = sem refrexo

bc - An arbitrary precision calculator language

pi=$(echo "scale=10; 4*a(1)" | bc -l)
c() cos (rad)
s() sin (rad)

bash scripts

#!/bin/sh
for i in `seq 8 405`
do
head -n $i entrada.pov > saida$i.pov
done

for i in `cat listaesf` ; do echo $i ; done

sed 's/relatime/noatime/' </etc/fstab >fstab.tmp

quarta-feira, 28 de maio de 2008

rm ou rmvb no ubuntu hardy

$ sudo wget http://www.medibuntu.org/sources.list.d/hardy.list -O
/etc/apt/sources.list.d/medibuntu.list
$ sudo apt-get update && sudo apt-get install medibuntu-keyring &&
sudo apt-get update
$ sudo apt-get install w32codecs

quinta-feira, 8 de maio de 2008

povray

Gerando imagens de alta qualidade em simulações.


http://www.povray.org/
http://hof.povray.org/
http://www.imagico.de/pov/ray_povsdl.html
http://www.museum.state.il.us/ismdepts/library/linuxguides/povray/pov197.htm

gmail na linha de comando

no ubuntu:
$ sudo aptitude install sendemail libio-socket-ssl-perl
$ sendEmail -f usuario@gmail.com -t destinatario@mail.com -u assunto
-m mensagem -s smtp.gmail.com -xu usuario


mais informações:
http://www.vivaolinux.com.br/artigos/verArtigo.php?codigo=7470&pagina=1
http://caspian.dotconf.net/menu/Software/SendEmail/