Ten years of Linux notes
Configure an IP with ifconfig:
	# ifconfig eth0 10.5.1.15 broadcast 10.5.1.255 netmask 255.255.255.0
	# ifconfig eth0 up
	# route add default gw 10.5.1.1
	# ifconfig hw deaddeaddead (configure hardware address)
	# ifconfig 10.5.1.15 would autogenerate broadcast+mask using ip defaults (ie 10.5.1.15 == class A thus mask of 255.0.0.0)

Linux notes
1. When in vi, you can hit ctrl+Z to suspend the vi session. fg to resume the session.
2. man ps /ppd, look ppid, it's the parent process of a single pid.
3. stty erase Ctrl+V [backspace] 
4. # tcpdump -n -e -ttt -r /var/log/pflog to view iplog
5. tcpdump -vvv -n -e -ttt -r /var/log/pflog
6. man tcpdump
7. tcpdump -i fxp0 would listen on inteface fxp0. (On openBSD)
8. pflog is a binary file, use tcpdump to view it.
9. open 113/tcp in for identd is "proper" for some reason.
10. pfctl -ss to see a current stream of activity.
19. pfctl -R /etc/pf.conf to reload the rules. 
11. If the mouse eats shit and stops working, exit to a terminal and run mouseconfig to fix it.
12. Or you can restart X or kill it by hitting ctrl+alt+backspace. 
13. info tty. 
14. Man hdparm: it's a utility to work with drive parameters like read-ahead caching and 
power.
	a. hdparm -S 252 /dev/hda
15. If you return to your computer and the mouse is jumping all over the place, switch 
to a cmd
prompt using ctrl+alt+F1. Log in and run mouseconfig. Reselect your mouse and it should 
clear up. You can also restart X with Ctrl+Alt+Backspace.
16. You can send pictures with DCC
	a. send a pic: /dcc send nickname file.
	b. to receive a pic/file, /dcc get nickname pic.jpg.
17. Automate FTP:/
	a. http://samba.anu.edu.au/rsync
	b. ncftpget	
	i. ncftp -u username ftp.networkiq.net
	c. or Net::FTP with Perl =)
18. perl ./file.pl, it barfed on me :/
19. umount /mnt/cdrom, if it says "device is busy" cd / to get out of that dir then umount. 
20. dmesg |grep hd (dmesg is used to examine or control the kernel ring buffer.)
21. /mnt/cdrom == /dev/hdc
22. locate xinitrc, finds a config or other file.
23. KDE Control Center, find your version there. 
24. apropos sudoers and visudo. (visudo, edit list of sudoers file. 
25. ln -s /usr/local/netscape/binary /usr/bin/netscape
26. export PATH=$PATH:/new/path/to/netscape 
27. 513/tcp    open        login                   
    514/tcp    open        shell  
	These are rsh and rlogin, largely replaced by ssh.
28. service --status-all shows the status of all currently running services.
29. su - will change you to root and give you its environmental settings like executing
the .cshrc.
30. /usr/local/netscape =)
31. newsyslog can monitor log sizes.
32.  time stamp BX stuff /fset format_public [$0] %b<%n$1%b>%n $3-
	/fset format_version Hi, this is my version reply =-)
33. rc.local
34.  cat foo.txt | sed 's:old:new:g' > foo2.txt
	This would change the word "old" with the word "new".
35. userdel -r to remove a user.
36. bx cloaking means it doesn't respond to ctcps from other people.
37. procinfo
38. grip is an mp3 encoder and ripper. Run grip. Select the tracks and hit the "Rip and 
Encode" 
button.
39. cdrecord and xcdroast are cd burners =)
40. modprobe -r sound to view loaded sound modules.
41. kill -9 whatever ; kills that app without question.
42. infor rm, for example returns usage information.
43. cat somefile | grep sometext >> outfile
44. tail -1 * >>tail.txt. From the dir /home/user/docs/lastlog with like 400 text 
files, I did this. I tailed all files to one file called tail.txt that suited my needs.
45.  dd if=/dev/urandom of=/dev/hd0a writes random ones and zeros to a drive hd0a
	a. urandom is a strong pseudo random generator using hash functions for back. =)
	b. dd if=/dev/zero of=/dev/hda
46. ncftp -u root 10.5.1.100 (saved as win98 so ncftp win98)
47.  e2fsck - check a Linux second extended file system
48. file [filename] tells you the contents of a file.
49. http://www.memoryx.net/mem1x8fmx.html to get memory for your router
50. http://comments.imdb.com/CommentsShow?286106-637
51. ssh -C -X -l username 10.5.2.20
52. rpm -qa
53. #egghelp for eggdrop help.
54. mount -t ntfs /dev/hda6 /mnt/windows
55.  rpm -qa | grep libpcap
56.  /mode #channel b or "banstat" to see current banlist
57.    /adduser nick #channel friend,i_ops
        /cset * aop on
        /set aop on
        /save
	* Note: sometimes userid changes like with Eric:
	All to the right of ! can change so use !*@dsl... to aop someone. See Bx.sav
58. lsof list open files. (I couldn't eject cdrom, found a term listing its contents.)
59. In BitchX /DETACH while screened into a box lets you detach a BitchX session and 
rejoin with the scr-bx command.
	detached from /dev/pts/1. To re-attach type scr-bx
60. uname -a to shwo the version. 
61. userdel -r to remove a user.
62. chkconfig --list
62. rpm -qil [package name]
63. /usr/lib/mozilla/./mozilla
67. Some irc servers:
	irc.he.net
	irc.arcti.ca (ok) 
	irc.easynews.com (nice)
	irc.prison.net (makes you idle out)
	irc.choopa.net ( good)
	irc.efnet.nl (sweet)
	irc.desync.com
	ircd.servercentral.net
68. FreeBSD 4.6.2.
69. ftp.FreeBSD.org/pub/FreeBSD
70. ctrl+shift+ <or> - to small or large Eterm fonts.
71. xam on #dc-stuff is cool
72. /etc/init.d/syslogd? syslogd config file?
73. /etc/profile and /etc/bashrc....for a user it's $HOME/.profile
74. ncftp: open -u mario bowser.nintendo.co.jp
	open -u networ2 ftp.networkIQ.net
75. www.mplayer.hu linux mpeg player. 
76. wget: http/ftp automated getter thingy, heh.
77. VMware: http://vmware-chil.www.conxion.com/software/VMware-workstation-4.0.0-4460.tar.gz
78. Start vmware:  /usr/bin/vmware/vmware
79. Check out the "mc" command. Midnight Commander is a directory browser utility for
unix/linux 
systems
80. ncftpget and ncftpput to auto ftp stuff.
81. unzipThis.tar: tar -xf unzipThis.tar to extract. 
82. ls -1 |wc -l counts the number of files in a directory.
83. write: send a message to a user.
84. man fstab: /etc/fstab shows mounted points.
85. less /media/floppy.
86. Apparently /media is where /mnt is for mandrake.
87. egrep -ir "keyword".
88. cdrecord.
89. k3b is a cdwrite program included in suse 8.2 =)
90. /etc/profile is systemwide and runs when the system boots.
91. /etc/bashrc runs per user, found in ~/ 
92. tail -f /var/log/messages to see real time log updates.
93. info tail, or info command to see info about that command. (Like man command.)
94.     /dev/hda - primary-master 
        /dev/hdb - primary-slave
        /dev/hdc - secondary-master
        /dev/hdd - secondary slave
	/dev/sda - 1st SCSI device.
	/dev/sdb - 2nd SCSI device. Mark one active to make it bootable. 
95. use the command dd or cat to copy a floppy image to a disk.
96. fdformat /media/floppy to format a floppy disk.
97. lsof, list open files. grep for like cdrom.
        lsof |grep /media/cdrom to find out who has a dir open. Was stopping umount.
	lsof |grep /media/cdrom to find out who has a dir open. Was stopping umount.
98. tail -f /var/log/messages to see realtime log entries. 
	- /media/cdrom was showing a term in that dir. killed the term, could eject.
99. mount /dev/hdd cdrom2 (First u must create that folder)
100. Check freshmeat.net for unfound software like usb software. 
99. mount /dev/hdd cdrom2 (First u must create that folder)
100. Check freshmeat.net for unfound software like usb software.
101. e (sweet)
102. smbclient can send messages to windows domains like net send. 
103. file <file> shows you what sort of file the file is. 
104. /mode #channel b to see banlist on a specific channel
105. 113/tcp for ident. 
106. update command.
107. wget to get stuff of the inet like wget www.networkIQ.net/lview.exe I think. 
108. netstat -puntl to show open ports. 
109. in vi, the undo option is U
110. minicom is hyperterm for linux/unix. 
111. Determine apache version: httpd -v
112. ln -s source target for a symlink
113. You have to tweak the kernel to support more than 883 megs of memory.
114. mount -t fstype /dev/hdb /media/obsddrive
115. mount -rt usbdevfs /proc/bus/usb /mnt/removable/  That mounted the usb device, so I thought. Syntax was ok tho.
116. mount -o loop -t isso9660 'filename' /mnt/cdrom
117. 116 lets us mount an iso file as if it were a drive while not having to burn it to CD.
118. mkisofs is the command to make the iso. 
	# mkisofs -o blah.iso path
	# man mkisofs for more. 
119. mkfs is used to format a drive. Like "format" on win32. 
120. FAT is called vfat in linux when mounting drives. 
121. tune2fs to edit the drive parameters er something. 
122. mount -t ext2 /dev/hdb1 /media/drive2 worked after I mkfs -t ext2 /dev/hdb1.
123. Here's the total sequence for installing a new drive.
	a. Physically install the drive.
	b. Skip the auto-config that SuSE asks you about, heh.
	c. cfdisk /dev/hdb create the partitions.
	d. That creates /dev/hdb1, /dev/hdb2 and however many partitions you create.
	e. mkfs -t ext2 /dev/hdb1 to format the drive. 
	f. mount -t ext2 /dev/hdb1 /media/drive2 to mount the drive. 
124. So, install drive, cfdisk to make partitions, mkfs to create file system, then mount.
125. xntp: X Network time protocol daemon. Used to set the system clock.
126. xmms -h, view the command prompt switches to manipulate xmms from cmd line. sweet.
127. /mode #chanName b to see the banlist on a channel. 
128. stty erase [Ctrl+v] [backspace] will fix your broken backspace.
129. see /var/logs/messages for list of system event logs.
130. ALTQ is used to throttle bandwidth based on ports and/or IP addresses. 
131. rpm -i filename.rpm to install manually an rpm. rpm -qa to view installed.
132. 127.  stty erase ^h to be able to backspace.
133. grep default.ida /opt/www/apache_1.3.22/logs/jatt.net-access_log |cut -d - -f1 |uniq |wc -l
134. if you get weird logs for like apache, check google for the message.
135. iptables -A INPUT -p tcp --dport 22 -m state --state NEW -j LOG
136. ttyS0 == COM1, ttyS1 == COM2 et as per phaid in #linuxhelp

137. get IP Address from ifconfig:
	get ip from ifconfig with awk
	# ifconfig eth0 | awk '/inet addr:/{gsub(/addr:/, "", $2); print $2}'
	get IP from ifconfig with fgrep
	# ifconfig eth0 | fgrep inet | cut -f2 -d':' | cut -f1 -d'
138.  wget 10.5.1.1/Status.htm --http-user=admin --http-passwd=zzlinksys -q
	- That's interesting
139. apache logs go in /var/log/httpd/
140. Eric's setup:
	-> Internet -> OpenBSD w/ PF firewall -> OpenBSD /w Exim MTA and Apache. Fun. 
	- Resources: Exim.org for email
	- OpenBSD.org for the OSes.
	- http://www.openbsd.org/faq/faq6.html for the firewalling with pf
141. cut -f1 -d: /etc/passwd |sort  == sweet. Prints user names from passwd.
142. Mount a drive more than once.  mount -t fstype /dev/whatever /wherever ;   mount --bind /wherever /somewhere-else (phaid on #linuxhelp)
143. fg %number
144. FTP logon:  ftp://user:password@site:port/dir
145. rm -rf to remove fricken folders even if they have stuff in them. danZie on #linuxhelp. Thanks bro!
146. stat filename.txt shows lots of information about a file like the SUID/SGID bits, Sticky bit, inode loc etc.
147. read about lilo and editing your MBR. Might involve dd and hexit or something.
148. uname -a yeilds: Linux linux 2.4.20-4GB #1 Mon Mar 17 17:54:44 UTC 2003 i686 unknown unknown GNU/Linux
149. man pfctl /anchor as per c0n on #linuxhelp.
150. echo -n "text to add to a file" >> linuxnotes.txt
151. Check out pico for text editing instead of vi
152. echo "text to add to file" >>linuxnotes.txt adds that string to the tail of linuxnotes.
153. tcpwrappers use hosts.allow and hosts.deny to restrict who connects with tcp. Nice.
154. MTA moves mail, MUA views it. IE exim=MTA, squirrelmail=MUA.
155. apache logs go to /var/log/httpd/access and error_logs
156. wget 10.5.1.1/Status.htm --http-user=admin --http-passwd=zzlinksys -q
	- That should work with other pages.
157. cardctl is a PC card management program. man cardctl for more. 
158. mpg123 for playing tunes whilst not in X.
159. screen! start a screen session with 'screen vi linuxnotes.txt' A new screen session 
	will start. Use ^aa to switch between them. Sweet
	To view the screen shortcuts enter '^a ?'
	That's control a then control '?'.
160. psyBNC is used to connect to an irc server by bouncing off another server thus scrubbing
	info about yourself. Google psyBNC for details.
161. smbclient -L unknown -I 10.5.1.101 -U% -d3.
	- connected me to my laptop. sweet. Came from linneighborhood smb browser. 
162. mount -t smbfs -o username=,password=valeo //10.5.1.101/D /home/clams/mnt/unknownGFM
	- mounting a windows share from a command prompt. 
163. chkconfig
164. netstat -i to see NIC statistics and info. Sweet. 
165. Mkisofs to create an ISO image, then mount it as a drive. Super sweet. 
	- mkisofs /home/user/docs/ >docsbackup
	-  mount -t iso9660 -o ro,loop=/dev/loop0 image.iso /media/temp
166. irssi -n clams -c irc.aol.com
167. rdesktop is a linux term service client for win term servers
168. Clams: ever tried man iptables-save? or man iptables-restore?
169. Dynamic DNS folks. www.ods.org, www.dnsq.org and www.no-ip.or
170. tcpdump -lntttvs 1600 -Xi ethX
171. tcpdupm -lnetttr 1600 -Xr pflog | /root/bin/pfilter | less -r
172. ifconfig eth0 | awk '/inet addr:/{gsub(/addr:/, , ); print }'
173. iptables -A INPUT -p tcp --dport 0:65535 -m state --state NEW -j LOG
174. restart a process by sending a HangUP :  kill -HUP 93
175. netstat -vat, check connections. 
176. Eterm --cmod 200 -P /home/user/pics/deaddreamer2.jpg (cmod max = 256)
177. /proc/sys/net/ipv4, nice net config files therein. 
178. /usr/src/linux/Documentation/networking
179. ip-sysctl.txt
180. http://www.kernel.org/
181. Mitigation against SYN flooding is increasing the value of /proc/sys/net/ipv4/tcp_max_syn_backlog from 1024
	default to 4096. # echo 4096 >/proc/sys/net/ipv4/tcp_max_syn_backlog
182. http://us4.samba.org/samba/ftp/samba-latest.tar.gz for the latest
183. Some name servers:
	- nameserver 207.69.188.185
	- nameserver 207.69.188.186
	- nameserver 207.69.188.187
184. proftp: installed proftpd, started with /usr/sbin/proftpd after configuring /etc/proftpd.conf to include:
	- running as ftp, not 'nobody'. After nobody gets used to run other services, nobody becomes somebody.
	- I think I'll change the default port to confuse people, heh. 
	- Couldn't, changed to TCP/12 but what happens to the data port? TCP/21 is only the out of band control port, 20 is the data port.
	- Anyhow, when starting proftpd, it reparses the /etc/proftpd.conf file for its configurations.
	- Added S15proftpd to /etc/rc.d/rc5.d/ to start the service when the system starts. 
185. "application launcher" from the taskbar is how a run menu can be placed on the kde task bar. It's pretty cool. Right-click, application launcher.
196.  ptds> SupaFly: find -type f -maxdepth 1 -exec mv {} dest \;
197. date 0829001703.20
	- set the date.
	- MMDDHHMMYY.SS
198. gzip filename[s] to zip up files, not leaving the original unzipped like winzip.
199. logger, uses to make entries into /var/log/messages manually or with a script
200. 09:14 <@app> Clams iptables -P INPUT ACCEPT to clear all rules
201. vga = 792 in lilo.conf is very sweet. Nice useful resolution. =) Thanks idle (#linuxhelp)
202. In Eterm, hitting ctrl+shift+< or > will adjust the text size. 
203. /dev/ttys0 is serial 1.
204 * 1 * * * cp -f /home/user/docs/*.txt /home/user/docs/backupus/ ; logger documents backup occurred
205. Eterm --cmod 90 -P /home/user/pics/deaddreamer2.jpg
206. ln -s /home/user/software/lynx/lynx/lynx /usr/bin/lynx - That created a nice symlink so I can start lynx without moving to the directory
207. added file /usr/bin/setdate with ntpdate 129.132.2.21 in it. Now I can run "setdate" set the time to a time server in die schweiz.
208. Also added /usr/bin/logs, chmod 700 so it's executable so I can run "logs" to view /var/log/messages. Nothing special.
209.  sed -e 's/networkIQ/madlinux/g' linux.htm >linux-ml.htm 
	- That's nice. sed replaced all instances of networkIQ with madlinux and dumped it to linux-ml.htm. Only probley, it said madlinux.net, heh. 
210 sed -e 's/networkIQ.net/madlinux.com/g' linux.htm >linux-ml.htm
	- Nice, replaced all instances of networkIQ.net with madlinux.com in a file, dumped it to another file.
211. crontab stuff: edit the cront entries for root: 
	# crontab -u root -e
	- Below is the format for crontab entries.
	- This line executes the "find" command at 2AM on the 12th of every month that a Sunday or Saturday falls on.
Minute (0-59)  Hour (0-23)  Day of Month (1-31)  Month (1-12 or Jan-Dec)  Day of Week (0-6 or Sun-Sat)  Command 

      0             2                12                     *                          0,6                 /usr/bin/find
kill -HUP 1388 to restart cron after edit
 snort -dev -c /etc/snort/snort.conf