Feh.

Ok, this is my personal linux cheat sheet. I use it for Sifl at home and Chester at work. Its specific to me and what I use it for. Hence - cheat sheet. schwack is my personal linux bitch, so umm....a lot of this came from him helping me. Thanks.

apache
IPchains
Ports
Permissions
Links
Network Stuff


mv Move
mkdir Make Directory
ls list files
cd change directory
rm

remove/delete

-la long all
./ current directory
ln -s link
pwd shows working directory

get out of vi esc :q!
get out of vi and save esc :wq

untar

tar -zxvf blah.tgz
./configure
make
make install

show who is in ftp ftpwho
to spy ps aux | grep username
to get on undernet BitchX Sherrod us.undernet.org

Apache
/var/lib/apache/htdocs Contains all the html files for the web, on sifl.

ipchains ipchains -A input -s 0bf -d 0m -j ACCEPT
-s source
-d destination
-A appends a rule to a chain
-j join this crap to the following target

There are basically 3 destinations
that network traffic has [chains]
like if you ipchains -A input that says that anyting after that is applied to inbound packets
input In the machine
output out of the machine
forward through the machine

targets ACCEPT
DENY
ipchains -A output -p tcp --dport 80 -j DENY That would block any web traffic (port 80) going OUT the interface -p for protocol [ie apache would be down, no Dita pr0n]
ipchains -A output -s 192.168.1.2 -d 24.31.120.69 -j DENY

That rule is DENY -s olly -d silf then
Windows couldn't connect to linux
but could olly still get on the internet

DENY PACKETS DESTINED FOR 24.31.120.69
but when you request www.google.com.. thats not 24.31.120.69
so it only applies to request to that ip
olly's gateway is the other nic of sifl, the 192.168.1.1

ipchains -A input -d 24.31.120.69 -p tcp --dport 22 -j DENY

sifl denies ssh traffic coming in


Network stuff
nmap commands
-sS syn scan instead of a tcp scan
-O OS
Ex: nmap -sS -O 192.168.0.1
nmap www.rock.com > somfile.txt > pipes the output of commands to a file
nmap www.rock.com > existing.txt >> pipes the output to an existing file
| pipes the output to another command
cat somelog | grep sherrod that would send the cat to grep.. to filger for sherrod

Ports  
80 web
21 ftp
22 ssh
25 incoming mail SMTP
110 outgoing mail (pop)
119 newsgroups
137-139 microsoft network crap

Permissions
you can see the owner from ls -l
2 write, delete
1 execute
7 read, write, delete, and execute
rwxrwxrwx The first group is what the owner can do
The second group is for users in the GROUP the file belongs to
The third groups is for everybody else

for happy fun 0bf


Fun and Excitment  
Regular Expression stuff http://www.devshed.com/Server_Side/Administration/RegExp/
MySQL  
This guide walks you through installing a web server, an SQL database server, and a server-side scripting tool that ties everything together. Some of the more popu lar tools for doing this are Apache, MySQL, and PHP3.

http://www.devshed.com/Server_Side/Administration/Database/
Beginning MySQL Tutorial
http://www.devshed.com/Server_Side/MySQL/Intro/