These are some of my experiences with Linux. I learnt most of these from the LUGies and the Internet. These things may or may not work for you. You need to try at your own risk. I am just keeping these files so that I can refer to them often and somebody else could use them. I spent lot of time to find these answers I am putting them here for those who dont have the patience to google. Local Ips
These are some of the ips that will always be local.
10.0.0.0 - 10.255.255.255
172.16.0.0 -172.31.255.255
192.168.0.0 - 192.168.255.255
Note
One may wonder why there is no sequence in the whole stuff. I cant help you anymore in this. With only a Textpad and limited time, I can only do this. I never forget to take small notes whenever I do things. But the problem is I will put the notes somewhere and eventually lose them. That is why this site is here Mainly this site is going to help me whenever I need to refer things later. Also somebody else can make use of it.
Different Linux Distributions
Subject | Slackware | Debian | RedHat |
Package Manager | pkgtool | apt-get | rpm |
source | foo.tgz |
Slackware Package Management
Slackware uses only tarballs. i.e ordinary compressed tar files You can use either pkgtool or command line options The command line options are
installpkg --> To install packages
removepkg --> To remove packages
upgradepkg --> To upgrade packages
makepkg --> To make a Slackware compatible package
rpm2targz --> To make a Slackware package from Rpm -->Usage $:rpm2targz mypackage.rpm
rpm2tgz --> Same as the above
Requirements to build from source
Place for downloaded programs
/tmp or /packages
Place for installing programs
Third Party --> /usr/local
Software for Root User --> /usr/local/sbin
Programs that take varying space like mysql --> /opt
How to Install( 5 steps )
Setting the PATH or environment variables
Note. Keep the Makefile for future use
Edit /etc/profile (slackware) or /etc/bashrc (redhat)
PATH=$PATH:/usr/local/foo/bin
export PATH
Update /etc/profile
source /etc/profile
Update Database
#makewhatis --------> updates whatis
#updatedb ----------> updates database. You can then use locate to locate them
Remove unwanted object files
#make clean
Uninstalling Software
Installing self-extracting binary
Move the file to the desired location. say /usr/local. Just change the file permissions to execute. Then run the binary like ./binary_name.bin (eg. j2sdk-version-linux-i586.bin)
Something about m@Linux experience.
I run Slackware9.0 on a PII box with 4GB HDD and 385MB RAM Drive. (from 16 July 2003) I was running Slackware8.1 on my personal notebook. I upgraded to Slackware9.0 on 16 July 2003(clean Install). I dont know if there is any upgradation option in Slackware. There is a link here http://www.formsys.net/upgrade-slackware.htm But I never tried that.
Rules I usually follow
I always install software and packages at /usr/localThings to remember
These commands may be very handy to anyone who wants to play around with linux
dmesg This will show you all the installed hardware including, hard disk drives, cd rom drives and installed memory.
/sbin/ifconfig This is useful to find your ip number. Usually it will be against eth0
/sbin/lsmod This will list all the loaded modules on your computer.
/sbin/lspci This will list all the PCI buses and the devices connected to them
/sbin/lspnp This will list all the Plug and Play devices with your system, their node numbers, product identification and description. It reads from /proc/bus/pnp tree.
nmap -v ipnumber nmap is Network exploration tool and security scanner It shows the list of ports, state and services
cat file1 file2 > file3 --> cat(Concatenate) takes file1 and file2 as inputs and outputs to file3
cat file1 --> displays the contents of file1
i.e. It takes input from keyboard and output to screen
find / -name "filename" --> Start search from the / directory. Time consuming process
grep (Global Regular Expression Parser) command. Used for pattern matching and filtering ps -ua --> process status command with user and all options. Will display the Parent Process ID with lot more details.
kill chown chmod ugo+x more --> A formatting command. While more is in action (--more- at the bottom of the screen), use b to go back, q to quit without going further down redirection > & >> Six Basic Rules to Understand Linux & Unix commands
MYSECURITY - Thanks to Gerhard Mourani gmourani@openna.com
Files I made Immutable
SAMBA CONFIGURATION
The samba config file is at /etc/samba/smb.conf. There will be a sample file and copy it to smb.conf CUPS - Common Unix Print Systems
By Default upto Slackware9.0, CUPS has not been included with the default packages
So I downloaded cups-1.1.19-source.tar.gz
Untar using tar zxvf cups-1.1.19-source.tar.gz to /usr/local
Install using #./configure ,# make , #make install My Printer is Epson LP8800C Laser Printer
Usage : ps -a | grep httpd --> Probes the active process status that matches httpd
grep ' s ' filename --> looks for pattern with a space before, s and a space after pattern
i.e. grep
If you are using numbers then read permission = 4, write permission = 2, execute permission = 1
##########################################################################################################
Usage : #ls -latr /bin | more --------------> the output of ls is piped as input to more .
less --> similar to more but you need to type 'q' to quit explicitly.
You can also use like #more filename or #less filename to view the contents of the file
These can be used to direct the output of a command to a specific file. But beware that > is extremely dangerous since it may erase your existing files.
Usage :#cat /proc/devices > filename --> Sends the output of the cat command to filename. If already filename exists, it will be replaced with a new file. So make sure before you issue this command.
Usage : #cat /proc/devices >>filename --> Sends the output of the cat to filename and will be added to the end. It is safer compared to the above command.
To read the file you can use #tail filename --> Displays only the last part of the file
Samba took me about a 8 man hours to set it right.
There were no clear instructions on the Internet how to setup samba with a Windows XP machine. I refered a lot and finally get it done.
Now my Linux machine can share files with a Windows2000 server and WinXp machines.
Note : After any modification just run "testparm" to check for syntax errors
#Thanks to Panchal V
# Global parameters
[global]
encrypt passwords = yes
socket options = TCP_NODELAY SO_RCVBUF=8192 SO_SNDBUF=8192
max log size = 0
volume = Slackware
map to guest = Bad User
security = user
workgroup = DGIC_CHUBU
server string = Samba Server
netbios name = MYSAMBA
log file = /var/log/samba/%m.log
smb passwd file = /etc/samba/private/smbpasswd
[homes]
comment = Home Directories
valid users = %S
read only = No
create mask = 0664
directory mask = 0775
[root]
path = /
browseable = no
public = no
writable = no
comment = Root Dir of Linux
[tmp]
path = /tmp
writable = yes
preserve case = yes
map hidden = yes
comment = Store your files on Linux
public = yes
Add users using #smbpasswd -a root
Choose a different password for root for security reasons
Add users for WinXP machine (no password) and Win2000 machine(in my case with password)
#smbd -D
#nmbd -D
Note :
It will create a new init.d directory under /etc/rc.d/
The cups startup/stop script will be located under /etc/rc.d/init.d/cups
use #cups start ==> to start cups
#cups stop ==> to stop cups