LinuxNotes.txt Bikle --------------- This file contains some random notes I gathered during my interactions with Linux. Some Linux tips: check version of binutils: rpm -qa | grep binutils check Level of glibc: rpm -qa | grep glibc rpm installation demo: unzip p2414946_902_LINUX.zip rpm -Uvh --force binutils-2.11.90.0.8-13.i386.rpm another: [root@bobcat /CD]# rpm -Uvh flash-plugin-6.0.79-1.i386.rpm warning: flash-plugin-6.0.79-1.i386.rpm: V3 DSA signature: NOKEY, key ID 8df56d05 Preparing... ########################################### [100%] 1:flash-plugin ########################################### [100%] Red Hat/Mandrake/Debian Mozilla Registering flashplayer as a XPCOM component in /usr/lib/mozilla-1.0.1 Setup is complete. [root@bobcat /CD]# Enabling FTP and Telnet - cd to /etc/xinetd.d - vi wu-ftpd - Change the disable field from "yes" to "no". - Save changes. - vi telnet - Change the disable field from "yes" to "no" - Save changes 2. Capture Original rpm Configuration a) cd to /home. Here create a directory called "stage" b) chmod 777 stage c) cd stage d) rpm -qa > rpm.org 4. Verify Kernel Level (2.4.9 or greater) a) cd /boot/grub b) more grub.conf 5. Verify Level of ksh Package a) rpm -qa | grep pdksh b) To obtain RPMs bring up a browser and connect to: c) http://www.rpmfind.net d) Click on "go directly to the RPM database" e) Search on "pdksh" f) Find a pdksh rpm for "RedHat -7.3 for i386" g) Download this to the /home/stage directory you created 8. Set ulimits NOTE: The ·@oracle· prefix in the example given below denotes setting these values for users belonging to the ·group· named oracle. In this testcase both a user and group named oracle were present. Make sure to specify the settings at a group or user level as desired, and use the correct names of the groups and/or users as they exist on your OS. The top of the limits.conf file explains how to do this in detail. a) cd /etc/security b) vi limits.conf c) add the following lines, without the leading \ signs, and replace by a TAB character: \@oraclehardnofile65535 \@oraclehardnproc16384 d) save the file. Although SHMMIN, SHMSEG, and SHMVMX are mentioned in the install guide with specific values they should be set to, a place to edit these could not be found. They may be specified into the kernel at compile time. You can ignore those settings. These are the steps to specify this: a) cd /etc b) vi sysctl.conf c) add the following lines: # Oracle 9iAS semaphores, SEMMSL, SEMMNS, SEMOPM, SEMMNI kernel.sem = 100 32000 100 100 # Oracle 9iAS set max shared memory kernel.shmmax = 2147483648 #Oracle 9iAS set max shared memory segments per entire system kernel.shmmni = 100 #Oracle 9iAS set available port range net.ipv4.ip_local_port_range = 1024 65000 #Oracle 9iAS set max file handles fs.file-max = 65536 d) save the file and reboot. 10. Verify Kernel Parameters a) cd /proc/sys/kernel b) cat sem - SEMMSL, SEMMNS, SEMOPM, SEMMNI : => 100 32000 100 100 c) cat shmmax - SHMMAX: => 2147483648 d) ipcs -lm |grep min - SHMMIN: => 1 e) cat shmmni - SHMMNI: => 100 f) ipcs -ls |grep semaphore - SHMVMAX: =>32767 g) cd /proc/sys/net/ipv4, cat ip_local_port_range - net.ipv4.ip_local_port_range :=> 1024 65000 h) cd /proc/sys/fs, cat file-max - file-max: => 65536 NOTE ** executing ./sbin/sysctl -A , shows a number of kernel parameters as well. oooooooooo this suggests that if I go to /proc/sys/kernel and edit files there, the changes will be temporary. permanent changes go here: /etc/sysctl.conf oooooooooo we have 2 files which affect bash: .bash_profile .bashrc I'm not sure which is called last the doc just sets a duplicate path in each WHAT ARE SOME OTHER USEFUL LINUX TIPS? 1. Determine MAC Address & IP Address Information On Linux systems, the ethernet device is typically called eth0. In order to find the MAC address of the ethernet device, you must first become root, through the use of su. Then, type ifconfig -a and look up the relevant info. For example: # ifconfig -a eth0 Link encap:Ethernet HWaddr 00:60:08:C4:99:AA inet addr:131.225.84.67 Bcast:131.225.87.255 Mask:255.255.248.0 UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:15647904 errors:0 dropped:0 overruns:0 TX packets:69559 errors:0 dropped:0 overruns:0 Interrupt:10 Base address:0x300 The MAC address is the HWaddr listed on the first line. In the case of this machine, it is 00:60:08:C4:99:AA. 2. DNS options: Red Hat Advanced Server 2.1 will attempt to resolve hostnames 2 times. If your DNS servers are very busy, the lookup might fail and the SQL*Net connections might be lost. You can solve this by editing /etc/resolv.conf: - options attempts:5 - options timeout:15 ANY RELATED DOCUMENTS? The following related whitepaper can be found on OTN: "Tips and techniques: Install and Configure Oracle9i on Red Hat Linux Advanced Server" http://otn.oracle.com/tech/linux/pdf/installtips_final.pdf 09-01-2003 ----------- I tinkered with rpm today. Here is a screen dump of me removing an rpm: [root@bobcat SUNWappserver7]# rpm -qa | grep imq imq-3.0.1-01 [root@bobcat SUNWappserver7]# [root@bobcat SUNWappserver7]# rpm -e --nodeps 'imq-3.0.1-01' [root@bobcat SUNWappserver7]# rpm -qa | grep imq [root@bobcat SUNWappserver7]# Here is some shell syntax which loops through a set of rpms which contain the string SUNW in their names: #!/bin/bash echo "Killing any running Appserver Processes..." killall -9 appservd killall -9 appservd-wdog killall -9 imqbrokerd echo "Uninstalling Application Server..." for i in `rpm -qa|grep SUNW`;do echo "Removing rpm $i";rpm -e --nodeps $i;done Notice use of the 'killall' command. I use it when I'm too lazy to look up a pid and kill the pid; this is very handy. Creation of .iso files: Create a CD image mkisofs -f -iso-level=1 -J -r -T -pad -v -o $outfile -V "$title" $dir Will create the ISO-file $outfile containing a CD filesystem from directory $dir with title $title. Make a 1-to-1 copy of a data CD nice --18 dd if=/dev/cdrom of=/tmp/cd.iso Will make a 100% copy of the data CD and write it into the ISO file /tmp/cd.iso nice --18 cdrecord -v -dummy -data /tmp/cd.iso more info from http://howto.gp.mines.edu/howtowiki/LinuxCd This document gives a very short overview over using CDs and audio files under the Linux command line. There are a lot of graphic programs that can accomplish the same tasks. However, they often give you less control than the commands below. It is recommanded to create functions or aliases in your favorite shell for the command lines below so you don't have to remember (or look up) the exact syntax each time. Rip an audio CD nice --18 cdparanoia -X -B -w --force-read-speed 1 Will rip the audio CD and deposit .wav files in the current directory. If the first track does not start at the beginning (sector 0) of the disc, the unused space before the first song will be written as a very short track00.cdda.wav. Delete that file. Program used: [WWW]cdparanoia Create an audio CD nice --18 cdrecord -v -dummy -dao -useinfo -pad -audio *.wav Will write all the .wav files to the empty CD, creating a standard audio CD. Program used: [WWW]cdrecord See below for notes on cdrecord. Create a CD image mkisofs -f -iso-level=1 -J -r -T -pad -v -o $outfile -V "$title" $dir Will create the ISO-file $outfile containing a CD filesystem from directory $dir with title $title. The filesystem contained in the ISO file should be readable by any OS on any system. Program used: [WWW]mkisofs Write ISO (CD image) file to raw CD nice --18 cdrecord -v -dummy -data xxx.iso Will write the specified .iso file to the CD, creating a (supposedly) data CD. Program used: [WWW]cdrecord See below for notes on cdrecord. Make a 1-to-1 copy of a data CD nice --18 dd if=/dev/cdrom of=/tmp/cd.iso Will make a 100% copy of the data CD and write it into the ISO file /tmp/cd.iso nice --18 cdrecord -v -dummy -data /tmp/cd.iso Will write the ISO file to the CD, creating a perfect copy of the original Programs used: [WWW]dd and [WWW]cdrecord See below for notes on cdrecord. Converting MP3s to raw audio to create audio CDs mpg123 -s $src | sox -c2 -s -w -t raw -r 44100 - -t wav - > $dest Will convert the .mp3 file $src to the .wav file $dest, if you want to make an audio CD from the mp3s. Programs used: [WWW]mpg123 or [WWW]mpg321, [WWW]sox Converting raw audio WAV files to MP3 lame --r3mix infile.wav outfile.mp3 Will encode the raw WAV file infile.wav to the MP3 file outfile.mp3 using high quality settings. Program used: [WWW]lame. For quality considerations, see [WWW]r3mix.net Notes about cdrecord: * When first using a cdwriter, test how it performs with the "-dummy" option. This won't write anything, just see if all the speeds match. * The commands here rely on /etc/cdrecord.conf, to specify what kind of CD writer we are using. Do a "man cdrecord" to learn how to set this up correctly. See /etc/cdrecord.conf on sonduk or tyndall for an example. For security, set the buffer size higher than recommanded and the speed lower than the maximum speed of the drive. * When creating audio CDs, use only CD-R, not CD-RW media. CD-RW can not be played by many audio CD players. To create nice CD covers, look at disc-cover at http://home.wanadoo.nl/jano/disc-cover.html. It is very cool program. Usually it will recognize the audio CD and download the list of song names automatically from the Internet. It can even find and include the original front cover picture! RPMs of the necessary software to run disc-cover are provided. If you need help, please don't hesitate to ask Hans: hans@acoustics.mines.edu Re: Two networks on one card AJ (aj@bigmouse.net) Sun, 24 Oct 1999 11:17:06 -0700 * Messages sorted by: [ date ][ thread ][ subject ][ author ] * Next message: Sharad Joshi: "Re: Is the same 157.253...." * Previous message: Harry Brueckner: "Two networks on one card" * Maybe in reply to: Harry Brueckner: "Two networks on one card" linux can do anything. basically dump these commands in rc.local file, I am sure there is a much better way, but this is quick and easy if you notice eth2 belongs to 2 networks, and have had a linux box connected off of 1 NIC to 4 networks with IPs on each ############################### /sbin/ifconfig lo 127.0.0.1 /sbin/ifconfig eth0 up /sbin/ifconfig eth1 up /sbin/ifconfig eth2 up ### that will activate the NICx as long as the modules are loaded /sbin/ifconfig eth0 204.239.26.209 netmask 255.255.255.0 /sbin/ifconfig eth1 204.239.27.238 netmask 255.255.255.0 /sbin/ifconfig eth2 204.174.40.229 netmask 255.255.255.0 /sbin/ifconfig eth2:0 10.100.254.254 netmask 255.255.0.0 /sbin/ifconfig eth2:1 10.100.0.1 netmask 255.255.0.0 /sbin/ifconfig eth2:2 10.100.1.1 netmask 255.255.0.0 ### and now all the physical interfaces and virtual interfaces are defined ### IP addresses assigned and bound all that is left is the routing /sbin/route add -net 127.0.0.0 /sbin/route add -net 204.239.26.0 netmask 255.255.255.0 dev eth0 /sbin/route add -net 204.239.27.0 netmask 255.255.255.0 dev eth1 /sbin/route add -net 204.174.40.0 netmask 255.255.255.0 dev eth2 /sbin/route add -net 10.100.0.0 netmask 255.255.0.0 dev eth2:0 /sbin/route add -net 10.100.0.0 netmask 255.255.0.0 dev eth2:1 /sbin/route add -net 10.100.0.0 netmask 255.255.0.0 dev eth2:2 ### now the server should know all the networks attached to it /sbin/route add -host 204.239.26.209 eth0 /sbin/route add -host 204.239.27.238 eth1 /sbin/route add -host 204.174.40.229 eth2 /sbin/route add -host 10.100.254.254 eth2:0 /sbin/route add -host 10.100.0.1 eth2:1 /sbin/route add -host 10.100.1.1 eth2:2 ### the routing table should be complete except for default gateway /sbin/route add default gw 204.239.26.100 ----- Original Message ----- From: Harry Brueckner To: Sent: Sunday, October 24, 1999 10:58 AM Subject: Two networks on one card Hello, I have two networks, lets say 192.168.1.0 and 192.168.2.0. The first one is the network where each host gets its single "hardware address" in which gets assigned to the networkcard of each host, like: 192.168.1.1 192.168.1.2 192.168.1.3 ... Now I also have addresses which I want to use for virtual stuff, like WWW servers. So I want to use a second network for this and use those IP numbers for virtual services only so I can easily move them from one host to another in case I have to loadbalance some machines. So the assignment is e.g. 192.168.1.1 hosts: 192.168.2.1 192.168.2.2 192.168.2.5 192.168.1.2 hosts: 192.168.2.3 192.168.2.4 192.168.1.3 hosts: 192.168.2.6 The assignment of my "physical" network works fine and the network is up and running. And now comes the part where I dont know what to do. Of course each computer only has one ethernet card I can only assign one IP address to it and for virtual addresses I did not find out how to configure them properly when they are NOT within the same network as the device they are assigned to. :-/ Any ideas how to get this to work? Harry Here are some notes related to installation of software. The information applies to installation of jEdit but points out some more general behavior of use to the Linux Admin: If you use apt4rpm, urpmi, or a similar tool with an RPM-based Linux distribution, you can automatically stay up to date with the latest version of jEdit using the JPackage RPM repository from: http://www.jpackage.org To install jEdit via Debian Linux apt-get, add the following lines to your /etc/apt/sources.list: deb http://dl.sourceforge.net/sourceforge/jedit ./ deb-src http://dl.sourceforge.net/sourceforge/jedit ./ Then, just run apt-get update, followed by apt-get install jedit or apt-get source jedit. I found apt-get here: [root@d-sfo06-83-179 wsdp]# which apt-get /usr/bin/apt-get [root@d-sfo06-83-179 wsdp]# I looked at it: [root@d-sfo06-83-179 wsdp]# apt-get apt 0.5.5cnc6 for linux i386 compiled on Jul 19 2003 21:23:24 Usage: apt-get [options] command apt-get [options] install|remove pkg1 [pkg2 ...] apt-get [options] source pkg1 [pkg2 ...] apt-get is a simple command line interface for downloading and installing packages. The most frequently used commands are update and install. Commands: update - Retrieve new lists of packages upgrade - Perform an upgrade install - Install new packages (pkg is libc6 not libc6.rpm) remove - Remove packages source - Download source archives build-dep - Configure build-dependencies for source packages dist-upgrade - Distribution upgrade, see apt-get(8) clean - Erase downloaded archive files autoclean - Erase old downloaded archive files check - Verify that there are no broken dependencies Options: -h This help text. -q Loggable output - no progress indicator -qq No output except for errors -d Download only - do NOT install or unpack archives -s No-act. Perform ordering simulation -y Assume Yes to all queries and do not prompt -f Attempt to continue if the integrity check fails -m Attempt to continue if archives are unlocatable -u Show a list of upgraded packages as well -b Build the source package after fetching it -D When removing packages, remove dependencies as possible -c=? Read this configuration file -o=? Set an arbitary configuration option, eg -o dir::cache=/tmp See the apt-get(8), sources.list(5) and apt.conf(5) manual pages for more information and options. This APT has Super Cow Powers. [root@d-sfo06-83-179 wsdp]# I should read up on this or get a demo at an installfest. I found a handy utility named rpm2cpio: rpm2cpio jedit-4.1-1.noarch.rpm > jedit-4.1-1.noarch.cpio rpm2cpio jedit-4.1-1.noarch.rpm | cpio -itc