########################## # LAST CHANGE : 16.11.2009 ########################## REDHAT Version: 7.x, 8.x 9.x, AS 2.1, AS 3.0, RHEL4, RHEL5 CentOS Version: 5.? SuSE Linux: 10, 11 Ubuntu Linux: lenny, sid ###################################### # englische tastatur im emergency mode ###################################### loadkeys de --> laedt deutsche tastatur ############################################## # Disable the "clear" issued when you exit vim ############################################## When I am in vim (on Linux), and I :wq (or anything that will exit me from the vi session) it does a \u201cclear screen\u201d. If you want this to stop, place the following in your ~/.vimrc set t_ti= t_te= ################ # redhat version ################ [kutz@uriel kutz]$ cat /etc/redhat-release Red Hat Linux release 7.3 (Valhalla) [kutz@uriel kutz]$ uname -a Linux uriel 2.4.18-3custom #3 Thu Jul 25 12:57:32 CEST 2002 i686 unknown oder [kutz@uriel kutz]$ cat /proc/version Linux version 2.4.18-3custom (root@uriel) (gcc version 2.96 20000731 (Red Hat Linux 7.3 2.96-110)) #3 Thu Jul 25 12:57:32 CEST 2002 ##################### # determine 32/64-bit ##################### uname -m 32-bit = i686 64-Bit = x86_64 or Under "flags" parameter, you will see various values. Among them, one is named "tm(transparent mode)" or "rm(real mode)" or "lm(long mode)" 1. rm means: 16 bit processor 2. tm means: 32 bit processor 3. lm means: 64 bit processor or getconf LONG_BIT returns 32 or 64 Bit ##################### # redhat bootet nicht ##################### am bootprompt linux rescue eingeben 1. Setup-CD bootfaehig! bei GRUB Select the line that starts with kernel and type e to edit the line. enter rescue oder emergency oder single emergency mode --> vor ausfuehrung von /etc/rc.d/rc.sysinit kernel bootzeile per grub editieren und emergency dahinter schreiben (blank) single user mode --> vor ausfuehrung von start-skripten kernel bootzeile per grub editieren und s dahinter schreiben (blank) kernelzeile + init=/bin/bash oeffnet root shell ohne pw ################## # boot reihenfolge ################## 1. kernel 2. initrd (module zum zugriff root-partition werden geladen) --> Emergency 3. Init Process ID 1 (0 --> kernel) 4. inittab -> initdefault --> rc.sysinit --> s (single user mode) 5. Aufruf rc.scripte gemaess runlevel aus initdefault ###### # grub ###### kernel /boot/vmlinuz-2.4.18-19.7.x ro root=/dev/hda2 ^^ auch moeglich: kernel /boot/vmlinuz-2.4.18-19.7.x ro root=/dev/hda2 root=LABEL=/ Auf Schreibfehler achten!!! initrd /boot/initrd-2.4.18-19.7.x.img ##################################### # netzwerkkarte einstellungen pruefen ##################################### ethtool -h ethtool version 1.5 Usage: ethtool DEVNAME ethtool -i DEVNAME ethtool -d DEVNAME ethtool -e DEVNAME ethtool -r DEVNAME ethtool -s DEVNAME \ [ speed 10|100|1000 ] \ [ duplex half|full ] \ [ port tp|aui|bnc|mii|fibre ] \ [ autoneg on|off ] \ [ phyad %d ] \ [ xcvr internal|external ] \ [ wol p|u|m|b|a|g|s|d... ] \ [ sopass %x:%x:%x:%x:%x:%x ] \ [ msglvl %d ] -h shows a short help message. -i queries the specified ethernet device for associ- ated driver information. -d retrieves and prints a register dump for the speci- fied ethernet device. -r restarts auto-negotiation on the specified ethernet device, if auto-negotiation is enabled. -s option allows changing some or all settings of the specified ethernet device. All following options only apply if -s was specified. # speed aendern ethtool -s eth3 speed 100 # duplex aendern ethtool -s eth3 duplex full # autoneg aendern ethtool -s eth3 autoneg no ########################## # defaultroute hinzufuegen ########################## # isdn router /usr/sbin/route add -net 0.0.0.0 netmask 255.255.255.240 gw 172.29.73.17 # linux router /usr/sbin/route add -net 0.0.0.0 netmask 255.255.255.0 gw 172.29.73.18 dev eth0 ########################### # statische route eintragen ########################### cat /etc/sysconfig/network-scripts/static-routes eth0 net 172.31.109.0 netmask 255.255.255.0 gw 172.31.109.1 ######################### # interface konfigurieren ######################### neat redhat-config-network ########################### # interface starten stoppen ########################### /etc/sysconfig/network-scripts ./ifup ./ifcfg-eth0:1 ./ifdown ./ifcfg-eth0:1 ./ifup-ppp ./ifcfg-ppp0 ./ifdown-ppp ./ifcfg-ppp0 ifconfig interface down ifconfig interface up ################## # xwindows display ################## normalerweise durch ssh gesetzt auf client export DISPLAY=maschinenname:0.0 auf server xhost + maschinenname ####### # xinet ####### server oder dienste die per xinet angeboten werden, sind folgendermassen zu aktivieren cd /etc/xinetd.d vi servername disable auf no setzen /etc/init.d/xinetd restart ##### # rpm ##### install rpm -i package remove,delete rpm -e package query rpm -q package rpm -qa | grep package list package to filenames rpm -qf filename list all packages including filenames and decription rpm -qali |less list filenames of package [kutz@uriel download]$ rpm -ql gnapster-1.5.0-fr1 /usr/bin/gnapster /usr/share/doc/gnapster-1.5.0 /usr/share/doc/gnapster-1.5.0/AUTHORS /usr/share/doc/gnapster-1.5.0/COPYING /usr/share/doc/gnapster-1.5.0/ChangeLog /usr/share/doc/gnapster-1.5.0/INSTALL /usr/share/doc/gnapster-1.5.0/NEWS /usr/share/doc/gnapster-1.5.0/README /usr/share/doc/gnapster-1.5.0/TODO /usr/share/gnapster /usr/share/gnapster/themes /usr/share/gnapster/themes/cyblue.theme /usr/share/gnapster/themes/cypress.theme /usr/share/gnapster/themes/default.theme /usr/share/gnapster/themes/faded.theme /usr/share/gnome/apps/Internet/gnapster.desktop /usr/share/pixmaps/gnapster.png query package from rpm file [kutz@uriel download]$ rpm -qpi celestia-1.2.4-fr2.i386.rpm Name : celestia Relocations: (not relocateable) Version : 1.2.4 Vendor: Freshrpms.net Release : fr2 Build Date: Wed 03 Jul 2002 06:29:22 PM CEST Install date: (not installed) Build Host: devel.freshrpms.net Group : Amusements/Graphics Source RPM: celestia-1.2.4-fr2.src.rpm Size : 13694785 License: GPL Packager : Matthias Saou URL : http://www.shatters.net/celestia/ Summary : A real-time visual space simulation. Description : Celestia is a free real-time space simulation that lets you experience our universe in three dimensions. Unlike most planetarium software, Celestia doesn't confine you to the surface of the Earth. You can travel throughout the solar system, to any of over 100,000 stars, or even beyond the galaxy. All travel in Celestia is seamless; the exponential zoom feature lets you explore space across a huge range of scales, from galaxy clusters down to spacecraft only a few meters across. A 'point-and-goto' interface makes it simple to navigate through the universe to the object you want to visit. query package from rpm-database rpm -qi packagename query dependencies [kutz@uriel download]$ rpm -qpR ./openssl-0.9.6b-24.i686.rpm mktemp /sbin/ldconfig /sbin/ldconfig rpmlib(PayloadFilesHavePrefix) <= 4.0-1 rpmlib(CompressedFileNames) <= 3.0.4-1 ld-linux.so.2 libc.so.6 libdl.so.2 libcrypto.so.2 /bin/sh libc.so.6(GLIBC_2.0) libc.so.6(GLIBC_2.1) libc.so.6(GLIBC_2.1.3) libc.so.6(GLIBC_2.2) libdl.so.2(GLIBC_2.0) libdl.so.2(GLIBC_2.1) update package Freshen --> paket wird nur dann geupdated wenn installiert rpm -Fvh squid-2.4.STABLE6-6.7.3.i386.rpm Preparing... ########################################### [100%] 1:squid ########################################### [100%] update force package [kutz@uriel download]$ sudo rpm -Fvhf --nodeps openssl-0.9.6b-24.i686.rpm Preparing... ########################################### [100%] 1:openssl ########################################### [100%] rebuilding packages: rpm --rebuild package.src.rpm building rpm packages from SRPM's rpm -iv package.src.rpm cd /usr/src/redhat/SPECS rpm -ba package.spec rpm -Uvh --> update package, wenn nicht installiert --> installiere unter AIX: /opt/freeware/src/packages/ --aid option install rpmdb-redhat-Package rpm -ivh Package --aid (installiert alle dependencies) aehnlich wie yum ######################### # install kernel packages ######################### rpm -ivh kernel-xxx #################### # kernel kompilieren #################### cd /usr/src/linux make menuconfig make dep make bzImage | make zImage make install ####### # lsmod ####### [kutz@uriel kutz]$ lsmod Module Size Used by Tainted: P 3c59x 28392 1 (autoclean) ppp_deflate 4032 0 (autoclean) zlib_deflate 21344 0 (autoclean) [ppp_deflate] ppp_async 8128 0 (autoclean) ppp_generic 24012 0 (autoclean) [ppp_deflate ppp_async] slhc 6348 0 (autoclean) [ppp_generic] i810_audio 22944 1 (autoclean) ac97_codec 11872 0 (autoclean) [i810_audio] soundcore 6532 2 (autoclean) [i810_audio] radeon 96920 1 slhc 6348 0 (autoclean) [ppp_generic] i810_audio 22944 1 (autoclean) ac97_codec 11872 0 (autoclean) [i810_audio] soundcore 6532 2 (autoclean) [i810_audio] radeon 96920 1 agpgart 39232 3 cisco_ipsec 364160 0 (unused) autofs 11812 0 (autoclean) (unused) serial_cs 5312 0 (unused) ds 8544 2 [serial_cs] yenta_socket 12256 2 pcmcia_core 50496 0 [serial_cs ds yenta_socket] ipchains 41704 21 ide-cd 30208 0 (autoclean) cdrom 32096 0 (autoclean) [ide-cd] nls_iso8859-1 3488 1 (autoclean) nls_cp437 5120 1 (autoclean) vfat 12028 1 (autoclean) fat 36984 0 (autoclean) [vfat] usb-uhci 24420 0 (unused) usbcore 72736 1 [usb-uhci] ext3 66272 2 jbd 48824 2 [ext3] ############# # module info ############# [kutz@uriel download]$ modinfo -d 3c59x "3Com 3c59x/3c9xx ethernet driver LK1.1.16 19 July 2001" [kutz@uriel download]$ modinfo -p 3c59x filename: /lib/modules/2.4.18-3custom/kernel/drivers/net/3c59x.o description: "3Com 3c59x/3c9xx ethernet driver LK1.1.16 19 July 2001" author: "Donald Becker " license: "GPL" parm: debug int, description "3c59x debug level (0-6)" parm: options int array (min = 1, max = 8), description "3c59x: Bits 0-3: media type, bit 4: bus mastering, bit 9: full duplex" parm: full_duplex int array (min = 1, max = 8), description "3c59x full duplex setting(s) (1)" parm: hw_checksums int array (min = 1, max = 8), description "3c59x Hardware checksum checking by adapter(s) (0-1)" parm: flow_ctrl int array (min = 1, max = 8), description "3c59x 802.3x flow control usage (PAUSE only) (0-1)" parm: enable_wol int array (min = 1, max = 8), description "3c59x: Turn on Wake-on-LAN for adapter(s) (0-1)" parm: rx_copybreak int, description "3c59x copy breakpoint for copy-only-tiny-frames" parm: max_interrupt_work int, description "3c59x maximum events handled per interrupt" parm: compaq_ioaddr int, description "3c59x PCI I/O base address (Compaq BIOS problem workaround)" parm: compaq_irq int, description "3c59x PCI IRQ number (Compaq BIOS problem workaround)" parm: compaq_device_id int, description "3c59x PCI device ID (Compaq BIOS problem workaround)" parm: watchdog int, description "3c59x transmit timeout in milliseconds" ####### # lspci ####### [kutz@uriel kutz]$ lspci 00:00.0 Host bridge: Intel Corp. 82830 830 Chipset Host Bridge (rev 04) 00:01.0 PCI bridge: Intel Corp. 82830 830 Chipset AGP Bridge (rev 04) 00:1d.0 USB Controller: Intel Corp. 82801CA/CAM USB (Hub (rev 02) 00:1e.0 PCI bridge: Intel Corp. 82801BAM/CAM PCI Bridge (rev 42) 00:1f.0 ISA bridge: Intel Corp. 82801CAM ISA Bridge (LPC) (rev 02) 00:1f.1 IDE interface: Intel Corp. 82801CAM IDE U100 (rev 02) 00:1f.5 Multimedia audio controller: Intel Corp. 82801CA/CAM AC'97 Audio (rev 02) 00:1f.6 Modem: Intel Corp. 82801CA/CAM AC'97 Modem (rev 02) 01:00.0 VGA compatible controller: ATI Technologies Inc Radeon Mobility M6 LY 02:00.0 Ethernet controller: 3Com Corporation 3c905C-TX/TX-M [Tornado] (rev 78) 02:01.0 CardBus bridge: Texas Instruments PCI1420 02:01.1 CardBus bridge: Texas Instruments PCI1420 lspci -v --> more information ###################### # interrupts ermitteln ###################### irq ermitteln [kutz@uriel kutz]$ cat /proc/interrupts CPU0 0: 10559387 XT-PIC timer 1: 25450 XT-PIC keyboard 2: 0 XT-PIC cascade 8: 1 XT-PIC rtc 11: 2014683 XT-PIC usb-uhci, Texas Instruments PCI1420, Texas Instruments PCI1420 (#2), Intel ICH3, eth0 12: 303845 XT-PIC PS/2 Mouse 14: 494156 XT-PIC ide0 15: 683276 XT-PIC ide1 NMI: 0 ERR: 2 ######### # meminfo ######### cat /proc/meminfo ############################# # Eterm pw auf funktionstaste ############################# [kutz@uriel kutz]$ ls -al /etc/Eterm lrwxrwxrwx 1 root root 39 Jul 18 11:38 /etc/Eterm -> /usr/share/Eterm/themes/Eterm/theme.cfg bind ctrl F11 to echo "meinpw" ########### # fetchmail ########### # fetchmail configfile # Do error logging through syslog set syslog #poll popper.zentrale.metronet.de proto pop3 user "po-bereitschaft" is kutz here no fetchall poll mail1.kutz.media-support.de proto imap user "kutz" pass geheim keep is kut z@uriel #poll post.strato.de proto pop3 user "hdkutz@hdkutz.de" pass geheim is kutz@uri el #poll post.strato.de proto pop3 user "webmaster@hdkutz.de" pass geheim is kutz@ uriel ####### # alias ####### [kutz@uriel kutz]$ cat /etc/.alias alias l='ls -atr' alias ll='ls -altr' alias df='df -k' alias du='du -k' alias scp='scp -c blowfish' alias vi='/usr/bin/vim' alias m='sudo less' alias c='clear' alias f='finger' alias ns='nslookup' alias topas='nice -n 20 top -d 2' alias drucke='a2ps --sides=2 -Plp0' alias awksumbyte='awk '\''{ sum +=$5 } END { print "SUM = ", sum; }'\'' ' alias awksumdf='awk '\''{ sum +=$3 } END { print "SUM = ", sum; }'\'' ' alias psf='ps -ef |grep ' alias slog='sudo tail -f /var/log/messages' alias mlog='sudo tail -f /var/log/maillog' alias tunix='/usr/bin/ssh tunix' alias luzifer='/usr/bin/ssh luzifer' ########## # ipchains ########## ipchains (8) - IP firewall administration ipchains-restore (8) - restore IP firewall chains from stdin ipchains-save (8) - save IP firewall chains to stdout Schema zu ipchaines: prerouting -> routing -> input -> forward -> local process -> output -> postrouting ########## # iptables ########## iptables (8) - IP firewall administration iptables-restore (8) - restore IP firewall chains from stdin iptables-save (8) - save IP firewall chains to stdout netfilter "iptables" chains: INPUT OUTPUT FORWARD PREROUTING POSTROUTING Schema zu iptables: prerouting -> routing -> forward -> postrouting oder prerouting -> routing -> input -> local process -> output -> postrouting [kutz@uriel kutz]$ sudo iptables -L -n Chain INPUT (policy ACCEPT) target prot opt source destination block all -- 0.0.0.0/0 0.0.0.0/0 Chain FORWARD (policy ACCEPT) target prot opt source destination block all -- 0.0.0.0/0 0.0.0.0/0 ACCEPT tcp -- 0.0.0.0/0 0.0.0.0/0 tcp flags:0x16/0x02 limit: avg 1/sec burst 5 LOG all -- 0.0.0.0/0 0.0.0.0/0 limit: avg 3/hour burst 5 LOG flags 0 level 4 ACCEPT tcp -- 0.0.0.0/0 0.0.0.0/0 tcp flags:0x17/0x04 limit: avg 1/sec burst 5 ACCEPT icmp -- 0.0.0.0/0 0.0.0.0/0 limit: avg 1/sec burst 5 icmp type 8 Chain OUTPUT (policy ACCEPT) target prot opt source destination Chain block (2 references) target prot opt source destination ACCEPT all -- 0.0.0.0/0 0.0.0.0/0 state RELATED,ESTABLISHED ACCEPT all -- 0.0.0.0/0 0.0.0.0/0 state NEW DROP all -- 0.0.0.0/0 0.0.0.0/0 ############# # erlaube ftp ############# iptables -A INPUT -s any/0 -d any/0 -p tcp --dport 21 -j ACCEPT iptables -A INPUT -s any/0 -d any/0 --sport 1024: --dport 20 -j ACCEPT ############## # verbiete ssh ############## ohne Meldung iptables -A INPUT -s sourceip -p tcp --dport 22 -j DROP mit Meldung iptables -A INPUT -s sourceip -p tcp --dport 22 -j REJECT oder iptables -N logreject iptables -A logreject -j LOG iptables -A logreject -j REJECT iptables -A INPUT -s sourceip -p tcp --dport 22 -j logreject ##################### # loeschen einer rule ##################### iptables -D INPUT -s sourceip -p tcp --dport 22 -j DROP ################# # flush all rules ################# iptables -F ############ # list rules ############ vi /etc/syslog.conf kern.4 /var/log/firewall.log #################### # netcat check ports #################### nc [-e command] [-g intermediates] [-G hopcount] [-i interval] [-lnrtuvz] [-o filename] [-p source port] [-s ip address] [-w timeout] [hostname] [port[s...]] [kutz@uriel download]$ nc localhost 22 SSH-1.99-OpenSSH_3.1p1 Protocol mismatch. oder fuer dns nc -u -w 5 xyz 53 ############ # timeconfig ############ [root@uriel root]# hwclock --show Mon 26 Aug 2002 04:17:32 PM CEST 0.621017 seconds [root@uriel root]# date 0826180702 Mon Aug 26 18:07:00 CEST 2002 [root@uriel root]# date Mon Aug 26 18:07:07 CEST 2002 [root@uriel root]# hwclock --show Mon 26 Aug 2002 04:18:06 PM CEST 0.322015 seconds [root@uriel root]# hwclock --set --date="8/26/02 18:08:50" [root@uriel root]# hwclock --show Mon 26 Aug 2002 06:08:54 PM CEST 0.497662 seconds #################### # runlevel eintraege #################### /sbin/chkconfig --level 345 telnet off /sbin/chkconfig --level 345 finger off /sbin/chkconfig --level 345 lpd off /sbin/chkconfig --level 345 httpd on oder /usr/sbin/ntsysv --> nur fuer aktuellen runlevel /usr/sbin/ntsysv --level --> fuer den unter level spezifizierten runlevel ############### # check service ############### [kutz@uriel kutz]$ sudo chkconfig --list sshd sshd 0:off 1:off 2:on 3:on 4:on 5:on 6:off ####################### # service neu aufnehmen ####################### vi /etc/init.d/setiathome # chkconfig: - 91 35 chkconfig --add setiathome ########################## # services starten stoppen ########################## service start/stop ################# # programm finden ################# [kutz@uriel kutz]$ locate ntsysv /usr/sbin/ntsysv --level /usr/share/man/man8/ntsysv.8.gz ################ # diag interface ################ mii-diag oder ethtool [kutz@uriel networking]$ mii-diag -v mii-diag.c:v2.06 8/7/2002 Donald Becker (becker@scyld.com) http://www.scyld.com/diag/index.html Using the default interface 'eth0'. Using the old SIOCGMIIPHY value on PHY 24 (BMCR 0x3000). Basic mode control register 0x3000: Auto-negotiation enabled. You have link beat, and everything is working OK. This transceiver is capable of 100baseTx-FD 100baseTx 10baseT-FD 10baseT. Able to perform Auto-negotiation, negotiation complete. Your link partner is generating 10baseT link beat (no autonegotiation). End of basic transceiver information. MII PHY #24 transceiver registers: 3000 782d 0041 6800 05e1 0021 0004 2001 0000 0000 0000 0000 0000 0000 0000 0000 0618 0619 0030 4001 40c8 a000 0000 0000 d300 0020 8084 9119 0065 1bef 7fff 0000 ########################## # autoneg full/half duplex ########################## from /usr/src/linux-2.4/Documentation/networking/vortex.txt Module parameters ================= There are several parameters which may be provided to the driver when its module is loaded. These are usually placed in /etc/modules.conf (used to be conf.modules). Example: options 3c59x debug=3 rx_copybreak=300 If you are using the PCMCIA tools (cardmgr) then the options may be placed in /etc/pcmcia/config.opts: module "3c59x" opts "debug=3 rx_copybreak=300" The supported parameters are: debug=N Where N is a number from 0 to 7. Anything above 3 produces a lot of output in your system logs. debug=1 is default. options=N1,N2,N3,... Each number in the list provides an option to the corresponding network card. So if you have two 3c905's and you wish to provide them with option 0x204 you would use: options=0x204,0x204 The individual options are composed of a number of bitfields which have the following meanings: Possible media type settings 0 10baseT 1 10Mbs AUI 2 undefined 3 10base2 (BNC) 4 100base-TX 5 100base-FX 6 MII (Media Independent Interface) 7 Use default setting from EEPROM 8 Autonegotiate 9 External MII 10 Use default setting from EEPROM When generating a value for the 'options' setting, the above media selection values may be OR'ed (or added to) the following: 0x8000 Set driver debugging level to 7 0x4000 Set driver debugging level to 2 0x0400 Enable Wake-on-LAN 0x0200 Force full duplex mode. 0x0010 Bus-master enable bit (Old Vortex cards only) For example: insmod 3c59x options=0x204 will force full-duplex 100base-TX, rather than allowing the usual autonegotiation. full_duplex=N1,N2,N3... Similar to bit 9 of 'options'. Forces the corresponding card into full-duplex mode. Please use this in preference to the `options' parameter. In fact, please don't use this at all! You're better off getting autonegotiation working properly. flow_ctrl=N1,N2,N3... Use 802.3x MAC-layer flow control. The 3com cards only support the PAUSE command, which means that they will stop sending packets for a short period if they receive a PAUSE frame from the link partner. The driver only allows flow control on a link which is operating in full duplex mode. This feature does not appear to work on the 3c905 - only 3c905B and 3c905C have been tested. The 3com cards appear to only respond to PAUSE frames which are sent to the reserved destination address of 01:80:c2:00:00:01. They do not honour PAUSE frames which are sent to the station MAC address. rx_copybreak=M The driver preallocates 32 full-sized (1536 byte) network buffers for receiving. When a packet arrives, the driver has to decide whether to leave the packet in its full-sized buffer, or to allocate a smaller buffer and copy the packet across into it. This is a speed/space tradeoff. The value of rx_copybreak is used to decide when to make the copy. If the packet size is less than rx_copybreak, the packet is copied. The default value for rx_copybreak is 200 bytes. max_interrupt_work=N The driver's interrupt service routine can handle many receive and transmit packets in a single invocation. It does this in a loop. The value of max_interrupt_work governs how mnay times the interrupt service routine will loop. The default value is 32 loops. If this is exceeded the interrupt service routine gives up and generates a warning message "eth0: Too much work in interrupt". hw_checksums=N1,N2,N3,... Recent 3com NICs are able to generate IPv4, TCP and UDP checksums in hardware. Linux has used the Rx checksumming for a long time. The "zero copy" patch which is planned for the 2.4 kernel series allows you to make use of the NIC's DMA scatter/gather and transmit checksumming as well. The driver is set up so that, when the zerocopy patch is applied, all Tornado and Cyclone devices will use S/G and Tx checksums. This module parameter has been provided so you can override this decision. If you think that Tx checksums are causing a problem, you may disable the feature with `hw_checksums=0'. If you think your NIC should be performing Tx checksumming and the driver isn't enabling it, you can force the use of hardware Tx checksumming with `hw_checksums=1'. The driver drops a message in the logfiles to indicate whether or not it is using hardware scatter/gather and hardware Tx checksums. Scatter/gather and hardware checksums provide considerable performance improvement for the sendfile() system call, but a small decrease in throughput for send(). There is no effect upon receive efficiency. compaq_ioaddr=N compaq_irq=N compaq_device_id=N "Variables to work-around the Compaq PCI BIOS32 problem".... watchdog=N Sets the time duration (in milliseconds) after which the kernel decides that the transmitter has become stuck and needs to be reset. This is mainly for debugging purposes, although it may be advantageous to increase this value on LANs which have very high collision rates. The default value is 5000 (5.0 seconds). enable_wol=N1,N2,N3,... Enable Wake-on-LAN support for the relevant interface. Donald Becker's `ether-wake' application may be used to wake suspended machines. Media selection --------------- A number of the older NICs such as the 3c590 and 3c900 series have 10base2 and AUI interfaces. Prior to January, 2001 this driver would autoeselect the 10base2 or AUI port if it didn't detect activity on the 10baseT port. It would then get stuck on the 10base2 port and a driver reload was necessary to switch back to 10baseT. This behaviour could not be prevented with a module option override. Later (current) versions of the driver _do_ support locking of the media type. So if you load the driver module with modprobe 3c59x options=0 it will permanently select the 10baseT port. Automatic selection of other media types does not occur. Transmit error, Tx status register 82 ------------------------------------- This is a common error which is almost always caused by another host on the same network being in full-duplex mode, while this host is in half-duplex mode. You need to find that other host and make it run in half-duplex mode or fix this host to run in full-duplex mode. As a last resort, you can force the 3c59x driver into full-duplex mode with options 3c59x full_duplex=1 but this has to be viewed as a workaround for broken network gear and should only really be used for equipment which cannot autonegotiate. # Suse ETHTOOL_OPTIONS='speed 100 duplex full autoneg off' # Redhat + Centos ETHTOOL_OPTS="speed 100 duplex full autoneg off" ######################## # linux tuning parameter ######################## [kutz@uriel vm]$ pwd /proc/sys/vm [kutz@uriel vm]$ for i in `ls *` > do > echo "Beginn $i" > cat $i > done Beginn bdflush 40 0 0 0 500 3000 60 0 0 Beginn freepages 798 1533 2044 Beginn kswapd 512 32 8 Beginn max_map_count 65536 Beginn max-readahead 127 Beginn min-readahead 3 Beginn overcommit_memory 0 Beginn page-cluster 3 Beginn pagetable_cache 25 50 ####################### # filessystem erstellen ####################### [root@uriel root]# mkfs.ext3 /dev/hda7 mke2fs 1.27 (8-Mar-2002) Filesystem label= OS type: Linux Block size=4096 (log=2) Fragment size=4096 (log=2) 432000 inodes, 863485 blocks 43174 blocks (5.00%) reserved for the super user First data block=0 27 block groups 32768 blocks per group, 32768 fragments per group 16000 inodes per group Superblock backups stored on blocks: 32768, 98304, 163840, 229376, 294912, 819200 Writing inode tables: done Creating journal (8192 blocks): done Writing superblocks and filesystem accounting information: done This filesystem will be automatically checked every 26 mounts or 180 days, whichever comes first. Use tune2fs -c or -i to override. ######### # apropos ######### erstellen whatis db /usr/sbin/makewhatis ######################### # passwoerter vorschlagen ######################### apg ################ # mount msdos cd ################ sudo mount -t vfat -r -o remount /dev/cdrom /mnt/cdrom ####### # touch ####### zeitstempel aendern touch -t 0210221017 Verkaufsliste.xls touch -a 1022101702 Verkaufsliste.xls ################################### # Galeon Frequently Asked Questions ################################### How do I change the User Agent (Browser Identification) string that galeon uses? This feature is already implemented. It is not in the UI because there was a mozilla bug (in the java plugin) that made galeon to crash at startup with some strings. You can set the user agent from the command line using GConf: 1. To get the current user agent: gconftool -g /apps/galeon/Advanced/Network/user_agent 2. To set the user agent to XXX: gconftool -s /apps/galeon/Advanced/Network/user_agent --type=string "XXX" 3. To restore the default user agent: gconftool -s /apps/galeon/Advanced/Network/user_agent --type=string default Config auslesen: [kutz@uriel kutz]$ gconftool-1 -g /apps/galeon/Advanced/Network/user_agent Default (recommended) Config aendern: [kutz@uriel kutz]$ gconftool-1 -s /apps/galeon/Advanced/Network/user_agent --type=string "Mozilla/5.0 Galeon/1.2.6 (X11; Linux i686; U;) Gecko/20020326 (compatible; MSIE 8.0; Windows MUSTDIE)" Config zuruecksetzen: [kutz@uriel kutz]$ gconftool-1 -s /apps/galeon/Advanced/Network/user_agent --type=string default ################# # network adapter ################# mii-diag [root@uriel log]# mii-diag Using the default interface 'eth0'. Basic registers of MII PHY #24: 3000 782d 0041 6800 05e1 41e1 0007 2801. The autonegotiated capability is 01e0. The autonegotiated media type is 100baseTx-FD. Basic mode control register 0x3000: Auto-negotiation enabled. You have link beat, and everything is working OK. Your link partner advertised 41e1: 100baseTx-FD 100baseTx 10baseT-FD 10baseT. End of basic transceiver information. mii-tool to switch from autoneg to 10baseT-HD enter mii-tool -F 10baseT-HD to switch from 10baseT-HD to autoneg 100baseTx-FD enter mii-tool -A 100baseTx-FD to reset the settings to default enter mii-tool -R to restart autoneg enter mii-tool -r -F media, --force=media Disable autonegotiation, and force the MII to either 100baseTx-FD, 100baseTx-HD, 10baseT-FD, or 10baseT-HD operation. -A media,..., --advertise=media,... Enable and restart autonegotiation, and advertise only the specified media technologies. Multiple technologies should be separated by commas. Valid media are 100baseT4, 100baseTx-FD, 100baseTx-HD, 10baseT-FD, and 10baseT-HD. ######################## # ip command cheat sheet ######################## I really do think that ip is a big improvement from ifconfig , route , ifup , ifdown , and the other commands it replaces. Still I seem to have trouble remembering which commands you need to use the word \u201cdev\u201d and which ones you don\u2019t and similar minor semantic issues (like parameter ordering). So I decided to try and compile a list of commands I commonly use to be used as a reference for studying. I\u2019m going to use eth0 as the device for these examples so just replace that with the interface to manipulate. link * ip link - show link info for all interfaces * ip link show up - show link info for interfaces that are \u201cup\u201d * ip link show eth0 show link info for eth0 * ip link set eth0 up - use instead of ifup (though not entirely equivalent) * ip link set eth0 down - use instead of ifdown (though not entirely equivalent) * ip link set eth0 promisc on - turn on promiscuous mode * ip link set eth0 promisc off - turn off promiscuous mode * ip link set eth0 txqlen 1000 - set txqueuelen (can also use \u201ctxqueuelen\u201d) * ip link set eth0 mtu 1500 - set mtu addr * ip addr - show addr info for all interfaces * ip link show up - show addr info for interfaces that are \u201cup\u201d * ip link show eth0 show addr info for eth0 * ip addr add 10.10.10.10/32 dev eth0 - add ip address and subnet to eth0 o also works: ip addr add dev eth0 10.10.10.10/32 * ip addr del 10.10.10.10/32 dev eth0 - remove ip address and subnet from eth0 o also works: ip addr del dev eth0 10.10.10.10/32 * ip addr flush dev eth0 - remove all addresses from eth0 route * ip route - list all routes * ip route flush - clear routing table * The rest of the route commands are outside the scope of this page. But here are the basic commands for managing routes without the required parameters. o ip route add - add a new route o ip route change - change an existing route o ip route replace - change route if it exists, add if it does not o ip route del - delete route (without parameters this will delete the default route) ########################## # ip forwarding aktivieren ########################## vi /etc/sysctl.conf # Controls IP packet forwarding net.ipv4.ip_forward = 1 oder [root@uriel root]# sysctl -? usage: sysctl [-n] variable ... sysctl [-n] -w variable=value ... sysctl [-n] -a sysctl [-n] -p (default /etc/sysctl.conf) sysctl [-n] -A ################# # service restart ################# [kutz@uriel xcat]$ sudo /sbin/service syslog restart Shutting down kernel logger: [ OK ] Shutting down system logger: [ OK ] Starting system logger: [ OK ] Starting kernel logger: [ OK ] [kutz@uriel xcat]$ slog Sep 2 15:29:41 uriel (Server)[6383]: swd_pclraw: Write_pid: write failed - No space left on device Sep 2 15:37:04 uriel kernel: Kernel logging (proc) stopped. Sep 2 15:37:04 uriel kernel: Kernel log daemon terminating. Sep 2 15:37:05 uriel syslog: klogd shutdown succeeded Sep 2 15:37:05 uriel exiting on signal 15 Sep 2 15:37:05 uriel syslogd 1.4.1: restart. Sep 2 15:37:05 uriel syslog: syslogd startup succeeded Sep 2 15:37:05 uriel kernel: klogd 1.4.1, log source = /proc/kmsg started. Sep 2 15:37:05 uriel syslog: klogd startup succeeded Sep 2 15:37:05 uriel syslog: syslogd shutdown succeeded ########### # chkconfig ########### [root@uriel root]# /sbin/chkconfig --list | grep ':on' keytable 0:off 1:on 2:on 3:on 4:on 5:on 6:off atd 0:off 1:off 2:off 3:on 4:on 5:on 6:off syslog 0:off 1:off 2:on 3:on 4:on 5:on 6:off gpm 0:off 1:off 2:on 3:on 4:on 5:on 6:off vpnclient_init 0:off 1:off 2:off 3:on 4:on 5:on 6:off kudzu 0:off 1:off 2:off 3:on 4:on 5:on 6:off netfs 0:off 1:off 2:off 3:on 4:on 5:on 6:off network 0:off 1:off 2:on 3:on 4:on 5:on 6:off random 0:off 1:off 2:on 3:on 4:on 5:on 6:off rawdevices 0:off 1:off 2:off 3:on 4:on 5:on 6:off pcmcia 0:off 1:off 2:on 3:on 4:on 5:on 6:off apmd 0:off 1:off 2:on 3:on 4:on 5:on 6:off iptables 0:off 1:off 2:on 3:on 4:on 5:on 6:off crond 0:off 1:off 2:on 3:on 4:on 5:on 6:off anacron 0:off 1:off 2:on 3:on 4:on 5:on 6:off lpd 0:off 1:off 2:on 3:on 4:on 5:on 6:off ntpd 0:off 1:off 2:off 3:on 4:off 5:off 6:off ################## # remove a service ################## [root]# LIST="kudzu apmd autofs iptables ipchains rawdevices lpd rhnsd" [root]# for SERVICE in $LIST; do /sbin/chkconfig --del ${SERVICE}; done ############################ # syslog config syslogserver ############################ [root]# vi /etc/sysconfig/syslog Change the following line: SYSLOGD_OPTIONS="-m 0" To: SYSLOGD_OPTIONS="-m 0 -r" Syslog is now able to accept syslog from other servers ################### # man path anpassen ################### vi /etc/man.config ########## # basename ########## loescht pfadangaben vor dateinamen [kutz@uriel kutz]$ basename austausch/betrieb/os/linux/commands.txt commands.txt ######### # dirname ######### loescht dateiname aus pfadname [kutz@uriel kutz]$ dirname austausch/betrieb/os/linux/commands.txt austausch/betrieb/os/linux ######### # mkisofs ######### [kutz@uriel tsm5.1]$ sudo mkisofs -U -o ./tsm51.iso /mnt/cdrom/ Warning: creating filesystem that does not conform to ISO-9660. 6.72% done, estimate finish Thu Sep 11 11:40:04 2003 13.41% done, estimate finish Thu Sep 11 11:40:11 2003 20.12% done, estimate finish Thu Sep 11 11:39:49 2003 26.82% done, estimate finish Thu Sep 11 11:40:41 2003 33.53% done, estimate finish Thu Sep 11 11:40:55 2003 40.24% done, estimate finish Thu Sep 11 11:41:01 2003 46.95% done, estimate finish Thu Sep 11 11:41:06 2003 53.65% done, estimate finish Thu Sep 11 11:41:11 2003 60.35% done, estimate finish Thu Sep 11 11:41:15 2003 67.06% done, estimate finish Thu Sep 11 11:41:17 2003 73.77% done, estimate finish Thu Sep 11 11:41:17 2003 80.45% done, estimate finish Thu Sep 11 11:41:18 2003 87.17% done, estimate finish Thu Sep 11 11:41:18 2003 93.87% done, estimate finish Thu Sep 11 11:41:17 2003 Total translation table size: 0 Total rockridge attributes bytes: 0 Total directory bytes: 241664 Path table size(bytes): 580 Max brk space used 18c000 74576 extents written (145 Mb) exclude some files: [kutz@uriel tsm5.1]$ sudo mkisofs -U -o ./tsm51_publications.iso -x /mnt/cdrom/mvs -x /mnt/cdrom/hpx /mnt/cdrom/ Warning: creating filesystem that does not conform to ISO-9660. 5.25% done, estimate finish Thu Sep 11 11:57:22 2003 10.50% done, estimate finish Thu Sep 11 11:57:12 2003 ... ######################### # check mount of isoimage ######################### [kutz@uriel tsm5.1]$ sudo mount tsm51.iso -r -t iso9660 -o loop /mnt/loop ##################### # brennen unter linux ##################### modul ide-scsi muss geladen sein! append "hdc=ide-scsi" # isofile erzeugen mkisofs -v -L -l -J -D -V "Pago" -o /tmp/marketing.iso /tmp/bruzzl/ # bus anzeigen cdrecord -scanbus zeigt brenner # simulation cdrecord -dummy -v dev=6,0,0 speed=2 /tmp/dingens.iso # brennen cdrecord -v dev=6,0,0 speed=2 /tmp/dingens.iso # CD Image erstellen dd if=/dev/cdrom of=/tmp/bruzzl/dingens.iso # CDRW cleanen cdrecord -v dev=6,0,0 blank=fast mount cdimage.raw -r -t iso9660 -o loop /mnt # dvd iso image brennen /usr/bin/growisofs -dvd-compat -Z /dev/sr0=/home/kutz/download/hmc/HMC_Recovery_V7R3.4.0_1.iso # All your CLI CD/DVD Burning Needs with wodim, genisoimage, growisofs, and cdrdao Problems with burning mostly happen with the frontend (k3b, gnomebaker, and the dreaded brasero), not so much with the backends (growisofs, wodim or cdrdao). So why not just learn how to do it on the command line? What devices to use, as $user: To check the cd/dvd drive options and capabilities for ATAPI devices: $ wodim --devices wodim: Overview of accessible drives (2 found) : --------------------------------------------------------- 0 dev='/dev/scd0' rwrw-- : 'AOPEN' 'CD-RW CRW2440' 1 dev='/dev/scd1' rwrw-- : '_NEC' 'DVD_RW ND-3540A' --------------------------------------------------------- Other alternatives are: $ wodim dev=/dev/scd0 driveropts=help -checkdrive and $ wodim -prcap Here are some useful examples using \u2019scd0\u2032: Information about a blank CD/DVD: $ wodim dev=/dev/scd0 -atip or $ cdrdao disk-info --device ATA:1,0,0 Delete a rewritable disk: $ wodim -blank=fast -v dev=/dev/scd0 or $ cdrdao blank --device ATA:1,0,0 --blank-mode minimal Clone a cd: $ cdrdao copy --fast-toc --device ATA:1,0,0 --buffers 256 -v2 Clone a cd on the fly: $ cdrdao copy --fast-toc --source-device ATA:1,1,0 --device ATA:1,0,0 --on-the-fly --buffers 256 --eject -v2 Create an audio cd from wav files with 12x speed: $ wodim -v -eject -pad -dao speed=12 dev=/dev/scd0 defpregap=0 -audio *.wav Burn a cd from bin/cue files: $ cdrdao write --speed 24 --device ATA:1,0,0 --eject filenam.cue Burn an ISO image: $ wodim dev=/dev/scd0 driveropts=burnfree,noforcespeed fs=14M speed=8 -dao -eject -overburn -v something.iso If you get a driveropts error, it is because burnfree is deprecated for some devices, therefore: $ wodim dev=/dev/scd0 driveropts=noforcespeed fs=14M speed=8 -dao -eject -overburn -v something.iso or $ wodim dev=/dev/scd0 fs=14M speed=8 -dao -eject -overburn -v something.iso Create an ISO image with all files (and subdirs) of a directory. This can be burned with the command above (burn ISO image): $ genisoimage -o myImage.iso -r -J -l directory If you have a DVD burner, you can also use growisofs for burning to DVD, like burning an ISO image to DVD: $ growisofs -dvd-compat -Z /dev/dvd=image.iso Burn multiple files to DVD: $ growisofs -Z /dev/dvd -R -J file-1 file-2 file-3 ... If there is space left on the DVD, you can append more files: $ growisofs -M /dev/dvd -R -J file-1 file-2 file-3... To finalise the session, you use: $ growisofs -M /dev/dvd=/dev/zero ################### # audio cd kopieren ################### # scsi id rauskriegen cdrdao scanbus # kopieren mit image cdrdao read-cd --device 6,0,0 --driver generic-mmc audiocd.toc # schreiben cdrdao write --device 6,0,0 --speed 8 --driver generic-mmc audiocd.toc oder cdrecord -v -audio -pad dev=6,0,0 speed=4 /home/jensens/cdr/*wav ####################### # dvd erstellen aus iso ####################### dvdrecord -v -dao dev=6,0,0 /tmp/dingens.iso ###### # wget ###### hole vz von http-server export http_proxy=http://proxy:3128 wget --proxy=on --http-user=anonymous --http-passwd=hkutz@swd-ag.de -nH -r --cut-dirs=2 http://archive.unibe.ch/tsm/clients/clients515/win32/winme/Disk1/ ####### # quota ####### edit /etc/fstab insert usrquota,grpquota like desired mount -o remount /filesystem touch /filesystem/aquota.user touch /filesystem/aquota.group quotacheck -cm /filesystem quotaon /filesystem edquota username setquota -u username 0 0 60 100 /home --> username darf 60 files soft und 100 files hardlimit anlegen setquouta -u username 4096 5120 /home --> username darf 4096 bloecke soft und 5120 bloecke hardlimit anlegen edit timelimits of quota edquota -t nach umount/mount unbedingt quotaon -a durchfuehren !!! ############## # redhat quota ############## Edit /etc/fstab to look like this (I added ,usrquota,grpquota to partition LABEL=/home): LABEL=/ / ext3 defaults 1 1 none /dev/pts devpts gid=5,mode=620 0 0 LABEL=/home /home ext3 defaults,usrquota,grpquota 1 2 none /proc proc defaults 0 0 none /dev/shm tmpfs defaults 0 0 /dev/hda5 swap swap defaults 0 0 /dev/cdrom /mnt/cdrom udf,iso9660 noauto,owner,kudzu,ro 0 0 /dev/fd0 /mnt/floppy auto noauto,owner,kudzu 0 0 Then run: touch /home/aquota.user /home/aquota.group chmod 600 /home/aquota.* mount -o remount /home quotacheck -avugm quotaon -avug ############ # /etc/issue ############ login anpassen ############## # alternatives ############## switched zwischen configs (z.B. MTA) hin und her ACHTUNG! Der alte Dienst wird nicht beendet. /usr/sbin/alternatives --help /usr/sbin/alternatives --config mta ################ # aktiviere pop3 ################ chkconfig --level 3 ipop3 on begrenzen ueber tcp-wrapper /etc/hosts.allow ipop3d: LOCAL .example.com /etc/hosts.deny ipop3d: ALL ################# # aktiviere pop3s ################# chkconfig --level 3 ipop3s on ################ # aktiviere imap ################ chkconfig --level 3 imap on ################# # aktiviere imaps ################# chkconfig --level 3 imaps on ssl cert erstellen cd /usr/share/ssl rm imapd.pem make ############## # apache https ############## cd /etc/httpd/conf make server.crt --> erstellt key --> erstellt crt move in entsprechende subdir oder vi /etc/httpd/conf.d/ssl.conf ##### # yum ##### Alle CD kopieren in VZ yum-arch ausfuehren --> erstellt header vi /etc/yum.conf Eintragen Server z.B. per http (Follow Symlink eingetragen?) dazu auf Server ln -s /var/ftp/pub /var/www/html linken yum info auf client ausfuehren yum list available --> listet alle Packages die verfuegbar sind ##### # apt ##### apt-get update - Paketlisten updaten apt-get dist-upgrade - Essentielle Distributionspakete werden geupdated apt-get upgrade - Alle installierten Pakte werden, falls moeglich, geupdated apt-cache search suchwort - Paketlisten nach "suchwort" durchsuchen ########### # automount ########### vi /etc/auto.master /vzname /etc/auto.vzname --timeout=60 vi /etc/auto.vzname * -rw nfsserver:/vzname/& service autofs start chkconfig --level 35 autofs on ############################### # imap ssl zertifikat erstellen ############################### cd /usr/share/ssl/certs rm imapd.pem make imapd.pem ausfuellen chkconfig --level 35 imapd on service xinetd restart ######################################## # kudzu - automatische hardwareerkennung ######################################## service kudzu start abschalten auf server - dauert zu lang beim reboot chkconfig --level 35 kudzu off ################### # virtual webserver ################### ################################## # mknod device entry not available ################################## less /usr/src/linux*/Documentation/devices.txt RedHat 7.3 less /usr/share/doc/MAKEDEV-3.3/devices.txt RH AS 3.0 less /usr/share/doc/MakeDev/devices.txt [root@uriel doc]# ls -al /dev/hda brw-rw-rw- 1 root disk 3, 0 Apr 11 2002 /dev/hda mknod hda b 3 0 ######### # e2label ######### generiert label auf partitionen [root@uriel doc]# e2label /dev/hda2 / # e2label /dev/hda2 / Jetzt kann in /etc/fstab darauf referenziert werden per LABEL=/ / ext3 defaults 1 1 ####################### # remount root rw if ro ####################### cat /proc/mounts mount -o remount,rw /dev/root / ######## # hdparm ######## [root@uriel root]# hdparm -Tt /dev/hda /dev/hda: Timing buffer-cache reads: 128 MB in 0.69 seconds =184.62 MB/sec Timing buffered disk reads: 64 MB in 2.95 seconds = 21.70 MB/sec [root@uriel root]# hdparm -Tt /dev/sda /dev/sda: Timing buffer-cache reads: 128 MB in 0.74 seconds =173.83 MB/sec Timing buffered disk reads: 64 MB in 92.64 seconds =707.39 kB/sec [root@uriel root]# hdparm /dev/hda /dev/hda: multcount = 16 (on) I/O support = 0 (default 16-bit) unmaskirq = 0 (off) using_dma = 1 (on) keepsettings = 0 (off) nowerr = 0 (off) readonly = 0 (off) readahead = 8 (on) geometry = 2432/255/63, sectors = 39070080, start = 0 busstate = 1 (on) [root@uriel root]# hdparm /dev/sda /dev/sda: readonly = 0 (off) geometry = 24792/255/63, sectors = 398295040, start = 0 [root@uriel root]# hdparm -c3 -m16 /dev/hda /dev/hda: setting 32-bit I/O support flag to 3 setting multcount to 16 multcount = 16 (on) I/O support = 3 (32-bit w/sync) [root@uriel root]# hdparm -Tt /dev/hda /dev/hda: Timing buffer-cache reads: 128 MB in 0.90 seconds =142.47 MB/sec Timing buffered disk reads: 64 MB in 3.02 seconds = 21.19 MB/sec #################### # bootsektor sichern #################### ide dd if=/dev/hda of=bootsector.bin bs=512 count=1 scsi dd if=/dev/sda of=bootsector.bin bs=512 count=1 ########################### # dialin server unter linux ########################### http://doc.thepenguin.de/isdn.shtml http://capi4linux.thepenguin.de/ http://www.redhat.com/archives/redhat-list-de/2003-April/msg00038.html http://www.google.de/search?hl=de&ie=UTF-8&oe=UTF-8&q=isdn+%2Bdialin+%2Bredhat+&+btnG=Google-Suche&meta=lr%3Dlang_de ######### # vcd rip ######### Bin und Cue File erzeugen vcdimager inputfile.mpg -c outputfile.cue -b outputfile.bin -p -v VCD schreiben cdrdao write --device 0,1,0 --speed 4 outputfile.cue info üngelegte VCD vcdrip -d --cdrom-device=/dev/cdrom VCD rip (mpg File erzeugen) vcdrip -v --cdrom-device=/dev/cdrom --rip vcdpad biegt korrupte mpg files wieder hin ########## # divx2dvd ########## ffmpeg -i my_video.avi -target dvd -aspect 16:9 -sameq my_dvd_video.mpg mkdir DVD dvdauthor --title -f my_dvd_video.mpg -o DVD dvdauthor -T -o DVD growisofs -dvd-compat -dvd-video -speed=4 -Z /dev/dvd ./DVD/* ########################## # 19 great uses for ffmpeg ########################## ffmpeg is a multiplatform, open-source library for video and audio files. I have compiled 19 useful and amazing commands covering almost all needs: video conversion, sound extraction, encoding file for iPod or PSP, and more. Getting infos from a video file ffmpeg -i video.avi Turn X images to a video sequence ffmpeg -f image2 -i image%d.jpg video.mpg This command will transform all the images from the current directory (named image1.jpg, image2.jpg, etc\u2026) to a video file named video.mpg. Turn a video to X images ffmpeg -i video.mpg image%d.jpg This command will generate the files named image1.jpg, image2.jpg, \u2026 The following image formats are also availables : PGM, PPM, PAM, PGMYUV, JPEG, GIF, PNG, TIFF, SGI. Encode a video sequence for the iPpod/iPhone ffmpeg -i source_video.avi input -acodec aac -ab 128kb -vcodec mpeg4 -b 1200kb -mbd 2 -flags +4mv+trell -aic 2 -cmp 2 -subcmp 2 -s 320x180 -title X final_video.mp4 Explanations : * Source : source_video.avi * Audio codec : aac * Audio bitrate : 128kb/s * Video codec : mpeg4 * Video bitrate : 1200kb/s * Video size : 320px par 180px * Generated video : final_video.mp4 Encode video for the PSP ffmpeg -i source_video.avi -b 300 -s 320x240 -vcodec xvid -ab 32 -ar 24000 -acodec aac final_video.mp4 Explanations : * Source : source_video.avi * Audio codec : aac * Audio bitrate : 32kb/s * Video codec : xvid * Video bitrate : 1200kb/s * Video size : 320px par 180px * Generated video : final_video.mp4 Extracting sound from a video, and save it as Mp3 ffmpeg -i source_video.avi -vn -ar 44100 -ac 2 -ab 192 -f mp3 sound.mp3 Explanations : * Source video : source_video.avi * Audio bitrate : 192kb/s * output format : mp3 * Generated sound : sound.mp3 Convert a wav file to Mp3 ffmpeg -i son_origine.avi -vn -ar 44100 -ac 2 -ab 192 -f mp3 son_final.mp3 Convert .avi video to .mpg ffmpeg -i video_origine.avi video_finale.mpg Convert .mpg to .avi ffmpeg -i video_origine.mpg video_finale.avi Convert .avi to animated gif(uncompressed) ffmpeg -i video_origine.avi gif_anime.gif Mix a video with a sound file ffmpeg -i son.wav -i video_origine.avi video_finale.mpg Convert .avi to .flv ffmpeg -i video_origine.avi -ab 56 -ar 44100 -b 200 -r 15 -s 320x240 -f flv video_finale.flv Convert .avi to dv ffmpeg -i video_origine.avi -s pal -r pal -aspect 4:3 -ar 48000 -ac 2 video_finale.dv Or: ffmpeg -i video_origine.avi -target pal-dv video_finale.dv Convert .avi to mpeg for dvd players ffmpeg -i source_video.avi -target pal-dvd -ps 2000000000 -aspect 16:9 finale_video.mpeg Explanations : * target pal-dvd : Output format * ps 2000000000 maximum size for the output file, in bits (here, 2 Gb) * aspect 16:9 : Widescreen Compress .avi to divx ffmpeg -i video_origine.avi -s 320x240 -vcodec msmpeg4v2 video_finale.avi Compress Ogg Theora to Mpeg dvd ffmpeg -i film_sortie_cinelerra.ogm -s 720x576 -vcodec mpeg2video -acodec mp3 film_terminémpg Compress .avi to SVCD mpeg2 NTSC format: ffmpeg -i video_origine.avi -target ntsc-svcd video_finale.mpg PAL format: ffmpeg -i video_origine.avi -target pal-svcd video_finale.mpg Compress .avi to VCD mpeg2 NTSC format: ffmpeg -i video_origine.avi -target ntsc-vcd video_finale.mpg PAL format: ffmpeg -i video_origine.avi -target pal-vcd video_finale.mpg Multi-pass encoding with ffmpeg ffmpeg -i fichierentree -pass 2 -passlogfile ffmpeg2pass fichiersortie-2 ####################### # iso dvdimage erzeugen ####################### readcd dev=/dev/hda f=/home/kutz/download/RHEL-5_i386_DVD.iso ############################## # compile optionen fuer redhat ############################## Wo bekomme ich heraus welche standart Compileroptionen bei Redhat zu nutzen sind? $ rpm --redhatprovides /usr/lib/rpm/redhat/rpmrc redhat-rpm-config-8.0.32-1 $ less /usr/lib/rpm/redhat/rpmrc ############### # broadcastping ############### BROADCAST=172.31.109.255 INTERFACE=172.31.109.211 ping -b $BROADCAST -I $INTERFACE $GATEWAY ping -I $INTERFACE 172.31.109.2 ping -I $INTERFACE 172.31.109.3 arping -c 3 -A -I eth0:3 $INTERFACE ############ # raid array ############ feline:~ # mdadm --detail /dev/md0 /dev/md0: Version : 00.90.01 Creation Time : Wed Mar 2 13:07:49 2005 Raid Level : raid1 Array Size : 6297344 (6.01 GiB 6.45 GB) Device Size : 6297344 (6.01 GiB 6.45 GB) Raid Devices : 2 Total Devices : 2 Preferred Minor : 0 Persistence : Superblock is persistent Update Time : Thu Sep 14 14:58:47 2006 State : clean, no-errors Active Devices : 2 Working Devices : 2 Failed Devices : 0 Spare Devices : 0 Number Major Minor RaidDevice State 0 8 1 0 active sync /dev/sda1 1 8 17 1 active sync /dev/sdb1 UUID : d6ed3a37:d7218f3b:2ce006b7:b6093687 Events : 0.11634174 ########################### # Command Description ########################### apropos word Show commands pertinent to word. See also threadsafe which command Show full path name of command time command See how long a command takes time cat Start stopwatch. Ctrl-d to stop. See also sw nice info Run a low priority command (info in this case) renice 19 -p $$ Make shell (script) low priority. Use for non interactive tasks look prefix Quickly search (sorted) dictionary grep --color expr...ion /usr/share/dict/words Highlight occurances of regular expression in dictionary gpg -c file Encrypt file gpg file.gpg Decrypt file alias hd='od -Ax -tx1z -v' Handy hexdump. (usage e.g.: hd /proc/self/cmdline | less) alias realpath='readlink -f' Canonicalize path. (usage e.g.: realpath ~/../$USER) set | grep $USER Search current environment ls /usr/bin | pr -T9 -W$COLUMNS Print in 9 columns to width of terminal touch -c -t 0304050607 file Set file timestamp (YYMMDDhhmm) dir navigation cd - Go to previous directory cd Go to home directory (cd dir && command) Go to dir, execute command and return to current dir pushd . Put current dir on stack so you can popd back to it CDs gzip < /dev/cdrom > cdrom.iso.gz Save copy of data cdrom mkisofs -V NAME -r dir | gzip > cdrom.iso.gz Create cdrom image from contents of dir mount -o loop cdrom.iso /mnt/dir Mount the cdrom image at /mnt/dir (read only) cdrecord -v dev=/dev/cdrom blank=fast Clear a CDRW gzip -dc cdrom.iso.gz | cdrecord -v dev=/dev/cdrom - Burn cdrom image (use dev=ATAPI -scanbus to confirm dev) cdparanoia -B Rip audio tracks from CD to wav files in current dir cdrecord -v dev=/dev/cdrom -audio *.wav Make audio CD from all wavs in current dir (see also cdrdao) oggenc --tracknum='track' track.cdda.wav -o 'track.ogg' Make ogg file from wav file archives tar c dir/ | bzip2 > dir.tar.bz2 Make archive of dir/ bzip2 -dc dir.tar.bz2 | tar x Extract archive (use gzip instead of bzip2 for tar.gz files) tar c dir/ | gzip | gpg -c | ssh user@remote 'dd of=dir.tar.gz.gpg' Make encrypted archive of dir/ on remote machine find dir/ -name '*.txt' | tar c --files-from=- | bzip2 > dir_txt.tar.bz2 Make archive of subset of dir/ and below find dir/ -name '*.txt' | xargs cp -a --target-directory=dir_txt/ --parents Make copy of subset of dir/ and below ( tar c /dir/to/copy ) | ( cd /where/to/ && tar x -p ) Copy (with permissions) copy/ dir to /where/to/ dir ( cd /dir/to/copy && tar c . ) | ( cd /where/to/ && tar x -p ) Copy (with permissions) contents of copy/ dir to /where/to/ ( tar c /dir/to/copy ) | ssh -C user@remote 'cd /where/to/ && tar x -p' Copy (with permissions) copy/ dir to remote:/where/to/ dir dd bs=1M if=/dev/hda | gzip | ssh user@remote 'dd of=hda.gz' Backup harddisk to remote machine rsync (Use the --dry-run option for testing) rsync -P rsync://rsync.server.com/path/to/file file Only get diffs. Do multiple times for troublesome downloads rsync --bwlimit=1000 fromfile tofile Locally copy with rate limit. It's like nice for I/O rsync -az -e ssh --delete ~/public_html/ remote.com:'~/public_html' Mirror web site (using compression and encryption) rsync -auz -e ssh remote:/dir/ . && rsync -auz -e ssh . remote:/dir/ Synchronize current directory with remote one file searching alias l='ls -l --color=auto' quick dir listing ls -lrt List files by date. See also newest find -name '*.[ch]' | xargs grep -E 'expr' Search 'expr' in this dir and below. See also findrepo find -type f -print0 | xargs -r0 grep -F 'string' Search all regular files for 'string' in this dir and below find -maxdepth 1 -type f | xargs grep -F 'string' Search all regular files for 'string' in this dir find -maxdepth 1 -type d | while read dir; do echo $dir; echo cmd2; done Process each item with multiple commands (in while loop) find -type f ! -perm -444 Find files not readable by all (useful for web site) find -type d ! -perm -111 Find dirs not accessible by all (useful for web site) locate -r 'file[^/]*\.txt' Search cached index for names. This re is like glob *file*.txt networking (Note ifconfig, route, mii-tool, nslookup commands are obsolete) ip link show List interfaces ethtool interface List interface status ip link set dev eth0 name wan Rename eth0 to wan ip addr add 1.2.3.4/24 brd + dev eth0 Add ip and mask(255.255.255.0) ip link set dev interface up Bring interface up (or down) ip route add default via 1.2.3.254 Set default gateway to 1.2.3.254 tc qdisc add dev lo root handle 1:0 netem delay 20msec Add 20ms latency to loopback device (for testing) tc qdisc del dev lo root Remove latency added above host pixelbeat.org Lookup ip address for name or vice versa hostname -i Lookup local ip address (equivalent to host `hostname`) netstat -tupl List internet services on a system netstat -tup List active connections to/from system wget (multi purpose download tool) (cd cmdline && wget -nd -pHEKk http://www.pixelbeat.org/cmdline.html) Store local browsable version of a page to the current dir wget -c http://www.example.com/large.file Continue downloading a partially downloaded file wget -r -nd -np -l1 -A '*.jpg' http://www.example.com/ Download a set of files to the current directory wget ftp://remote/file[1-9].iso/ FTP supports globbing directly wget -q -O- http://www.pixelbeat.org/timeline.html | grep 'a href' | head Process output directly echo 'wget url' | at 01:00 Download url at 1AM to current dir wget --limit-rate=20k url Do a low priority download (limit to 20KB/s in this case) wget -nv --spider --force-html -i bookmarks.html Check links in a file wget --mirror http://www.example.com/ Efficiently update a local copy of a site (handy from cron) windows (note samba is the package that provides all this windows specific networking support) smbtree Find windows machines. See also findsmb nmblookup -A 1.2.3.4 Find the windows (netbios) name associated with ip address smbclient -L windows_box List shares on windows machine or samba server mount -t smbfs -o fmask=666,guest //windows_box/share /mnt/share Mount a windows share echo 'message' | smbclient -M windows_box Send popup to windows machine (off by default in XP sp2) math echo '(1 + sqrt(5))/2' | bc -l Quick math (Calculate \u03c6) echo 'obase=16; ibase=10; 123' | bc Base conversion (decimal to hexadecimal) echo $((0x2dec)) Base conversion (hex to dec) ((shell arithmetic expansion)) echo 'pad=20; min=64; (100*10^6)/((pad+min)*8)' | bc More complex (int) e.g. This shows max FastE packet rate echo 'pad=20; min=64; print (100E6)/((pad+min)*8)' | python Python handles scientific notation echo 'pad=20; plot [64:1518] (100*10**6)/((pad+x)*8)' | gnuplot -persist Plot FastE packet rate vs packet size text manipulation (note sed uses stdin and stdout, so if you want to edit files, append newfile) sed 's/string1/string2/g' Replace string1 with string2 sed 's/\(.*\)1/\12/g' Modify anystring1 to anystring2 sed '/ *#/d; /^ *$/d' Remove comments and blank lines sed ':a; /\\$/N; s/\\\n//; ta' Concatenate lines with trailing \ sed 's/[ \t]*$//' Remove trailing spaces from lines sed 's/\([\\`\\"$\\\\]\)/\\\1/g' Escape shell metacharacters active within double quotes sed -n '1000p;1000q' Print 1000th line sed -n '10,20p;20q' Print lines 10 to 20 sed -n 's/.*<[tT][iI][tT][lL][eE]>\(.*\)<\/[tT][iI][tT][lL][eE]>.*/\1/p;T;q' Extract title from HTML web page sort -t. -k1,1n -k2,2n -k3,3n -k4,4n Sort IPV4 ip addresses echo 'Test' | tr '[:lower:]' '[:upper:]' Case conversion tr -dc '[:print:]' < /dev/urandom Filter non printable characters grep 'processor' /proc/cpuinfo | wc -l Count lines set operations (Note LANG=C is for speed) (Note also these assume no duplicate lines within a file) LANG=C sort file1 file2 | uniq Union of unsorted files LANG=C sort file1 file2 | uniq -d Intersection of unsorted files LANG=C sort file1 file1 file2 | uniq -u Difference of unsorted files LANG=C sort file1 file2 | uniq -u Symmetric Difference of unsorted files LANG=C comm file1 file2 | sed 's/^\t*//' Union of sorted files LANG=C comm -12 file1 file2 Intersection of sorted files LANG=C comm -13 file1 file2 Difference of sorted files LANG=C comm -3 file1 file2 | sed 's/^\t*//' Symmetric Difference of sorted files calendar cal -3 Display a calendar cal 9 1752 Display a calendar for a particular month year date -d fri What date is it this friday. See also day date --date='25 Dec' +%A What day does xmas fall on, this year date --date '1970-01-01 UTC 1234567890 seconds' Convert number of seconds since the epoch to a date TZ=':America/Los_Angeles' date What time is it on West coast of US (use tzselect to find TZ) echo "mail -s 'get the train' P@draigBrady.com < /dev/null" | at 17:45 Email reminder echo "DISPLAY=$DISPLAY xmessage cooker" | at "NOW + 30 minutes" Popup reminder locales printf "%'d\n" 1234 Print number with thousands grouping appropriate to locale echo "I live in `locale territory`" Extract info from locale database locale | cut -d= -f1 | xargs locale -kc | less List fields in locale database LANG=en_IE.utf8 locale int_prefix Lookup locale info for specific country. See also ccodes disk space (See also FSlint) ls -lSr Show files, biggest last du -s * | sort -k1,1rn | head Show top disk users in current dir. See also dutop df -h Show free disk space df -i Show free inodes fdisk -l Show disks partitions sizes and types (run as root) rpm -q -a --qf '%10{SIZE}\t%{NAME}\n' | sort -k1,1n List all packages by installed size (Bytes) on rpm distros dpkg-query -W -f='${Installed-Size;10}\t${Package}\n' | sort -k1,1n List all packages by installed size (KBytes) on deb distros dd bs=1 seek=2TB if=/dev/null of=ext3.test Create a large test file (taking no space). See also truncate monitoring/debugging strace -c ls >/dev/null Summarise/profile system calls made by command strace -f -e open ls >/dev/null List system calls made by command ltrace -f -e getenv ls >/dev/null List library calls made by command lsof -p $$ List paths that process id has open lsof ~ List processes that have specified path open tcpdump not port 22 Show network traffic except ssh. See also tcpdump_not_me ps -e -o pid,args --forest List processes in a hierarchy ps -e -o pcpu,cpu,nice,state,cputime,args --sort pcpu | sed '/^ 0.0 /d' List processes by % cpu usage ps -e -orss=,args= | sort -b -k1,1n | pr -TW$COLUMNS List processes by mem usage. See also ps_mem.py ps -C firefox-bin -L -o pid,tid,pcpu,state List all threads for a particular process ps -p 1,2 List info for particular process IDs last reboot Show system reboot history. free -m Show amount of (remaining) RAM (-m displays in MB) watch -n1 'cat /proc/interrupts' Watch changeable data continuously System information (see also sysinfo) hdparm -i /dev/hda Show info about disk hda hdparm -tT /dev/hda Do a read speed test on disk hda badblocks -s /dev/hda Test for unreadable blocks on disk hda mount | column -t Show mounted filesystems on the system (and align output) cat /proc/partitions Show all partitions registered on the system grep MemTotal /proc/meminfo Show RAM total seen by the system grep "model name" /proc/cpuinfo Show CPU(s) info lspci -tv Show PCI info lsusb -tv Show USB info recode (Obsoletes iconv, dos2unix, unix2dos) recode -l | less Show available conversions (aliases on each line) recode windows-1252.. file_to_change.txt Windows "ansi" to local charset (auto does CRLF conversion) recode utf-8/CRLF.. file_to_change.txt Windows utf8 to local charset recode iso-8859-15..utf8 file_to_change.txt Latin9 (western europe) to utf8 recode ../b64 < file.txt > file.b64 Base64 encode recode /qp.. < file.txt > file.qp Quoted printable decode recode ..HTML < file.txt > file.html Text to HTML recode -lf windows-1252 | grep euro Lookup table of characters echo -n 0x80 | recode latin-9/x1..dump Show what a code represents in latin-9 charmap echo -n 0x20AC | recode ucs-2/x2..latin-9/x Show latin-9 encoding echo -n 0x20AC | recode ucs-2/x2..utf-8/x Show utf-8 encoding interactive mc Powerful filemanager that can browse rpm, tar, ftp, ssh, ... screen Virtual terminals with detach capability, ... links Web browser gnuplot Interactive/scriptable graphing octave Matlab like environment #################### # partition loeschen #################### shred -f -v -n 35 /dev/hdax [1]Sys Admin Pocket Survival Guide - Linux [2]Home [3]Solaris [4]HP-UX [5]AIX [6]NetApp [7]EMC [8]LDAP _________________________________________________________________ This Linux guide is my own notes on Linux, for stuff that I did not like to documents that I have found on the internet. It is RedHat centric. [9]CentOS is supposed to be a "rebadged/un-commercialized" version of RHEL, keeping binary-level compatibilities at major release level, thus the discussion should apply equally to CentOS. HOW-TO Linux Admin 101 Linux init mode are not "cumulative". So, if default init is 5, script in run level 3 would not be run. If adding a Start script, may want to add them in both in rc3.d and rc5.d, unless it is really only wished to be available at one of the run level and not the other. Kill script should be placed in rc6.d, which shutdown/reboot scan. RHEL3 - binary compatible with FC2 (but FC2 is EOL) RHEL4 - binary compatible with FC3 (and maybe FC4) Single User Mode To boot into single user mode for maintenance, enter "linux single" or "linux emergency" at the LILO boot: prompt. If using GRUB, then, at the menu for choosing kernel, do: hit 'e' then arrow down to the kernel line hit 'e' again add 'single' to the end of the line hit enter hit 'b' to boot lather, rinse, repeat Core dump Linux kernel panic does not core dump to a file. it will print output of the kernel core dump result to the stdout device: a vga screen or a serial console. To setup serial console, do: console=ttyS0,115200 console=tty0 but this would mean console boot/shutdown/panic message will no longer be send to the VGA, but to serial port. VGA may get a spawned login prompt after OS is up. Linux "deviation" from Solaris Some of the most notable things that Linux does rather differently than Solaris or traditional Unix. * xinetd * Gnome/KDE for Display Manager (see XDMCP). * 64-bit Platforms RHEL 3.0 and 4.0 maintains simultaneous relese/update levels for 64-bit platforms as their popular 32-bit x86 OS. Just need to get the "special" distro ISO to install on the 64-bit hardware and it will be good to go. Not all the AS/ES/WS flavor maybe available to all platform. RHEL 4.0 rhel-ia64-as-4 Red Hat Enterprise Linux AS (v. 4 for 64-bit Intel Itan ium) rhel-x86_64-as-4 Red Hat Enterprise Linux AS (v. 4 for 64-bit AMD64/Inte l EM64T) rhel-ppc-as-4 Red Hat Enterprise Linux AS (v. 4 for 64-bit IBM POWER) rhel-s390-as-4 Red Hat Enterprise Linux AS (v. 4 for 31-bit IBM S/390) rhel-s390x-as-4 Red Hat Enterprise Linux AS (v. 4 for 64-bit IBM zSerie s) rhel-i386-as-4 Red Hat Enterprise Linux AS (v. 4 for 32-bit x86) [ty pical intel pentium 4/80x86 release] rhel-i386-ws-4 Red Hat Enterprise Linux WS (v. 4 for 32-bit x86) RHEL 3.0 rhel-ia64-as-3 Red Hat Enterprise Linux AS (v. 3 for Itanium) rhel-x86_64-as-3 Red Hat Enterprise Linux AS (v. 3 for AMD64/Intel EM64T ) rhel-ppc-as-3 Red Hat Enterprise Linux AS (v. 3 for iSeries and pSeri es) Commands for 64-bit info: ld -V # shows supported emulation for a given machine # eg: elf_x86_64 elf_i386 i386linux 64-bit and rpm AMD64 RedHat Linux utilize lots of rpm that has ARCH set to x86_64 (instead of the traditional i386). rpm -q by default won't tell you. Use something like rpm -q --qf '%{NAME} %{VERSION} %{RELEASE} (%{ARCH})\n' Package_Name to see which one you have installed. In 64-bit machines, most of the packages are x86_64. But quite often you will have a matching package of the same name, but is i386 ARCH. Some apps don't understand 64bit libs, so these older libs are sometime needed. There are also some compat libs. My friend Vic says: * Compatibility Arch Support Crapload of i386 binaries and libraries that run on x86_64 RedHat systems * Compatibility Arch Development Support You'll need some packages in Compatibility Arch Development Support to build i386 RPMs or compile 32 bit binaries on an x86_64 system. I find it annoying to install the Compatibility Arch Support group, though. For instance, let's say you have an x86_64 arch server. You want some i386 compatibility for some random library. Let's say zlib.i386 for whatever reason. Maybe some 3rd party application needs to run as a 32 bit binary and requires zlib's /usr/lib/libz.so.1 instead of zlib.x86_64's /usr/lib64/libz.so.1 You can just install Compatibility Arch Support and not worry about it, or go back an install zlib.i386 specifically. If you install the whole Compatibility Arch Support group, you are going to end up with all the freakin' i386 packages designed to run on x86_64 systems. Which means, you'll get a lot of crap you don't want to be living on a light weight server. For instance, kdebase.i386, gnome-blah.i386 and such. One thing that is very useful to have is firefox.i386 or mozilla.i386 on an x86_64 system. Most plugins don't play well with 64-bit browsers. So, in short -- you can remove what you don't need :) Initial Setup Things to keep in mind when installing Linux. For RHEL 3 and 4, once the OS is installed, additional international language support cannot be added (easily), RH recommends a reinstall. So, if you might need to support any given natural language, install it when you do the system install! Starting with Fedora Core 4, additional language can be added from system-configure-packages. Updating Machine Binary Compatibility The Linux community embraces the source code, and compatibility between different release is to recompile the code. Binary compatibility is not maintained between different (minor) releases of the glibc. So, be careful not to update the libraries, kernels, and gcc compiler unless you are ready to recompile everything in the system! (And if you have 3rd party libraries dependencies, then really think twice before changing the system library level). If using up2date for RHEL, it would be safe as only compatible updates are listed in the channel. I would assume the same is true for yum. (Add chart about system levels, see gmail). XDMCP enabling XDMCP will allow program like X Manager to use browser and login via v irtual screen, fully X Manager, Remote Display Manager style, rather than having to login using ssh and start VNC first. However, VNC is nicer in that the session stays on the server, XDMCP, if client is a laptop and disconnect, session will be reset. Note that botyh XDMCP and VNC are insecure by default! vi /etc/X11/fs/config # don't listen to TCP ports by default for security reasons ###no-listen = tcp ### commented out line above to enable XDMCP service xfs restart vi /etc/X11/xdm/xdm-config ! SECURITY: do not listen for XDMCP or Chooser requests ! Comment out this line if you want to manage X terminals with xdm !!!DisplayManager.requestPort: 0 !!!Line above commented out to enable XDMCP vi /etc/X11/xdm/Xaccess # * #any host can get a login window * # have start by itself will allow all host to get login window vi /etc/X11/gdm/gdm.conf [xdmcp] ###Enable=false Enable=true ### XDMCP is enabled using the above clause ### this file need to be updated when GNOME is default windows manager/Display Manager vi /etc/kde/kdm/kderc [Xdmcp] ###Enable=false Enable=true ### XDMCP is enabled using the above clause ### this file need to be updated when KDE is default windows manager/Display Ma nager chmod 444 /etc/X11/xdm/Xservers # probably correct already chmod 755 /etc/X11/xdm/Xsetup_0 older config need to update /etc/X11/XF86Config, but circa 2003 most distro use Xorg, check /etc/X11/xorg.conf and ensure FontPath uses Xserver: FontPath "unix/:7100" restart X: - killall gdm-binary # if running GNOME by default - ctrl+alt+bacckspace # if in front of maching/keyboard - init 3; init 5 # This may work - reboot # :) LDAP See the [10]LDAP doc for more details. authconfig # TUI, select to use ldap, etc. # upon completion, ldap should work for user login. # multiple server can be listed using comma separation # or space separated in /etc/sysconfig/authconfig /etc/sysconfig/autofs # update BASEDN to define where autofs will look for ma ps. eg # BASEDN="ou=us,dc=unixville,dc=com" service autofs restart # restart autofs to effect the changes /usr/lib/autofs/autofs-ldap-auto-master # list all known automount maps from ldap Kickstart A step-by-step command listing for setting up kickstart, (hopefully easier to read than Red Hat kickstart instructions, once it is working, tweaking it is much easier to comprehend). ... Quick Ref Connectivity (Network) mii-tool -vv # determine NIC speed, duplex. ethtool -i eth0 # list ethernet driver info Spawn login session on serial port: echo "7:2345:respawn:/sbin/agetty -h 9600 ttyS0" >> /etc/inittab echo "8:2345:respawn:/sbin/agetty -h 9600 ttyS1" >> /etc/inittab above does NOT redirect VGA to console, to do that, use (nothing will show on VGA output at boot): [check zambeel notes, TBA] Hardware related command lspci # list pci info Package/Software management rpm is a basic command to manage software packages, available in just about every linux distro. up2date is a Red Hat Network moneyware to automatically download updates and install them. YUM is the freeware version, used by Fedora (from Yellow Dog distro) and actually better than up2date. But for those paying money to RH for support, keep to their tool maybe advisible. rpm -ivh [path/file.rpm] # install rpm, vh = verbose hash for progress moni tor --nodeps # install pkg even if fail dependencies check --noorder # for File in `ls -1`; do rpm -ivh --nodeps $File; done # install all rpm in a dir eg cdrom # it seems that already installed packages will be overwritten by default # there is no "force" options needed to overwrite package to redo bad install. rpm -qa # query for all installed rpm packages in the mach ine rpm -qa arch=i386 # same as above, specifying 32-bit binaries rpm -qa arch=x86_64 # same as above, specifying 64-bit binaries for AM D 64 / Intel EM64T rpm -qa | grep glibc # query for glibc version rpm -qpl [rpmfile] # list where are the files installed to. rpm -ql [pck_name] # query installed package to see where files were send to # (partial package name will work). rpm -qi # query info of a specified package. rpm -qf /path/file # query see which package installed the given file rpm -e [pck_name] # erase pcka_name as listed in rpm -qa from comput er. stop if it break deps rpm -e [pck_name] --nodeps # forceful erase, even if it breaks dependencies. -Uvh [pkgname] # Upgrade (erasing old packages, which install don 't do) # h= print hash sign as it goes, # v = nicely formated output rpm -Fvh *.rpm # Freshen/update all rpm if an older version is in stalled # eg. Refresh from AS 4.0 Update 1 to Update 2 vi a -F of all the rpm from cd. -V [pkgname] # Verify integrity of installed package. rpm -qa --qf '%{NAME} \t\t %{VERSION} \t %{RELEASE} \t %{ARCH}\n' # display whether a given package is 32-bit i386 or x86_64. echo "%_query_all_fmt %%{name}-%%{version}-%%{release}.%%{arch}" >> ~/.rpmm acros # to set the rpm query arch stuff permanently in the rpm query macro # fedora does something like this by default. up2date # GUI/CLI program to download patches, need RH registration. up2date ypbind # ypdate ypbind client package to latest versio n #up2date nis # update the nis package to latest version (??) up2date libstdc++-3.2.3-42 # update a specific rpm up2date -l # list available downloads up2date -d # download patches (as per config) up2date -i # install downloaded patches up2date --config # run configuration (GUI or TUI), register mach ine, set exclusion, etc yum # yellow dog update modified, better rpm updated than u p2date # run cmd by itself will do all update automatically. # not installed by default in RHEL 4, only in FC. yum update # can be added to cronjob for auto update yum list # list avail pkg and version number yum list autofs # list installed and avail pkg/ver for the pkg autofs yum info [pkgname] # only display info of avail packages, opt followed by pkg name. yum install yumex # donwload and install the Yum Extender (GUI) rpm System Services chkconfig # Easiest way to manipulate rc services, # bettter than ntsysv or mangling xinetd file m anually! chkconfig --list xinetd # see if xinetd service is enabled chkconfig --list rsh # see if specific xinetd service is running, eg rsh chkconfig --list telnet # see if specific xinetd service is running, eg telnet chkconfig --list autofs # see if specific xinetd service is running, eg autofs automount chkconfig --list amd # see if specific xinetd service is running, eg amd automount chkconfig --add ypbind # register ypbind into service db chkconfig --level 345 ypbind on # enable ypbind on run level 3,4,5 chkconfig --level 345 rsh on # enable rsh on run level 3,4,5, starting the s ervice now also. chkconfig --level 35 httpd on # enable httpd in init 3 and 5 chkconfig vsftpd on # enable ftp as xinetd controlled service (le vel 2,3,4,5) chkconfig talk off # disable talk as xinetd controlled service (al l level) service iptables stop # temporary stop firewall service (till reboot) service iptables status # check running status chkconfig --level 345 iptables stop # disable firewall service from startin g on run level 3,4,5 # RHEL 2.1 use ipchains. for SVC in `ls -1 /etc/xinetd.d`; do chkconfig --list $SVC; done # see which xinetd service is on or off. for SVC in `ls -1 /etc/init.d`; do chkconfig --list $SVC; done # see which init service run when # but some file are not actually service serviceconf # GUI, see what service run at what run level. redhat-config-services # same as above ntsysv # TUI of serviceconf iptables system-config-authconfig # GUI tool to set firewall rules /etc/sysconfig/iptables... # firewall rule config file LVM File System: FS: one ext3 fs on top of a given LV. Logical: LV: many virtual/logical partitioins on top of a single VG. Aggregation: VG: volume group, encapsulate many PVs. Physical: PV: whole disk or partition system-config-lvm # GUI for LVM. Pretty neat. lvm # interactive shell for LVM, all cmd av ail as stand alone. pvdisplay # display info such as PV size, PE size , avail PE. pvcreate /dev/sda2 # create pv on partition, def RHEL 4 se tup pvcreate /dev/sde vgdisplay # display vol grp info such as lvm/lvm2 . -v # list all LV on the vol group, which P V it uses. vgcreate VolGroup00 /dev/sda2 # create a new VG, this is the def in R HEL 4 setup. vgextend vgreduce lvscan # brief list of LV and their si ze. lvdisplay # show info of all LV: path, LV size, Status, which VG it resides in. lvdisplay /dev/VolGroup00/LogVol01 # display specific info of a si ngle LV (instead of all LV) lvcreate -n LogVol00 --size 500M VolGroup00 # create a new LV called LogVol 00 of size 100 MB lvextend -L+100M /dev/VolGroup00/LogVol01 # extend existing LV (hosting s wap of fs) by given size # -L20G would set exact size of 20G lvremove # remove unused LV mkfs -j /dev/VolGroup00/LogVol02 # create fs on the LV (-j will use joun al, ie ext3) # NOTE: old kernel may give error. 2.6 .16-1.2069_FC4 works. mkswap /dev/VolGroup00/LogVol02 # create swap partition on the LV # Doesn't seems to work, actually confu ses kernel to the point that # all subsequent mkfs command will also be refused. BUG??!! e2fsadm # extend or reduce fs and LVM1 at the s ame time # but not avail with LVM2 (eg FC4, RHEL 4) ext2online /dev/VolGroup00/LogVol00 # extend ext3 FS online (for LVM 1 or 2 ) ext2online / # can use mount point instead of dev pa th ext2resize # change ext2 FS after it has been UNMO UNTED. ?? does not exist?? resize2fs /dev/VolGroup00/lv101 1000000 # reduce ext2/ext3 FS to size to exactl y 1,000,000 bytes. # UMOUNT+FSCK FIRST lvreduce -L1G /dev/VolGroup00/LogVol00 # reduce the LV the FS is on # (Don't make it smaller than FS size!) # After these procedure, there maybe so me left over space, # if using ext3, can use ext2online to reclaim the space. # ext2 somehow can't be re-expanded, us e ext3 !! # use tunefs -j to convert to ext3 :) /etc/fstab # typically list which LV dev used by w hich FS ?? # no cmd to display what LV is being us ed by which FS :( [11] http://www.redhat.com/magazine/009jul05/features/lvm2/ Kernel Kernel Compilation compiling linux kernel (similar procedure for old 2.4, new 2.4, and 2.6) download kernel source (srpm, rpm -ivh ...) Get the version applicaple to the base OS (eg RH 8.0) and kernel similar to the one installed (latest maybe okay, but then other support may not be available). [ For ES2.1/RH7.2, building custom kernel just req getting RPMS packages for: kernel-headers-2.4.9-e.12 (disk1) kernel-source-2.4.9-e.12 (disk2) SRPMS are not needed! Though there are dependencies such as gcc, glibc-dev, kernel dev, etc, which are RPMS, not Source RPMS! Files from SRPMS/ are not really needed unless really do heavy dev, and they do not show up in rpm -qa! Note that RH does not provide support for customized kernel. ] cd /usr/src/linux-2.4* [ use /usr/src/kernels/2.6.11-* for FC4 ] make menuconfig this lauches a text menu program to createa config file. * indicates compiled into kernel M indicates loadable modules. make xconfig # GUI, an alnternate to the TUI menuconfig. # RHEL 2.1 (RH 7.2) GUI is a big grid # 2.6 kernel is a tree based GUI with lot of explanations; auto compile when done. make dep; make bzImage; make modules make modules_install #make install # may not be avail. cp vmlinux... ... For old machines runing LiLo (RHEL 2.1 and older): cp /etc/lilo.conf.anaconda /etc/lilo.conf vi /etc/lilo.conf /sbin/lilo -v -C /etc/lilo.conf to install a new boot loader w/ new config into MBR. For newer machines running Grub (RHEL 3.0/RH 8.0/Fedora): grub /etc/grub.conf (link to /boot/grub/grub.conf). edit of such file doesn't require lilo install, but then need to reactivate gru b... --- From README - make config : standard kernel compiling config. - Alternate configuration commands are: "make menuconfig" Text based color menus, radiolists & dialogs. "make xconfig" X windows based configuration tool. "make oldconfig" Default all questions based on the contents of your existing ./.config file. Then do: make bzImage # create compressed kernel image # files are placed in .../linux/arch/i386/boot/bzImage make bzdisk # optional, make boot floppy disk. make modules # needed if anything is in loadable module make modules_install # suggested to do backup, but not sure where Upgrading Kernel Upgrading RH kernel, just need to get the later RPMS, package format kernel-VER .rpm, and install that. No other packages are needed, and no recompiling needed. It insall a stock RH tested general kernel. rpm -Uvh new-kernel-ref.rpm Install stuff like /boot/vmlinux-... vmlinuz-... System.map-... initrd-... plus lot of files with version number on filename into /lib, etc The rpm has to be from RH. Changes to /boot/grub/grub.conf may be needed. Easiest is just to use up2date and let it update kernel also, then just reboot, it will do all the necesary update and changes. Kernel Tuning ipcs -l # display interprocess communication parameters sysctl main tool to viewing kernel parameters -a display parameter and its setting. -w write new value for a given param -n supress printing of key, just print value. -p re-read /etc/sysctl.conf and make changes effective immediately eg: $ sysctl kernel.threads-max kernel.threads-max = 20479 $ sysctl -n kernel.shmmax 33554432 $ sysctl -a ... kernel.tainted = 0 kernel.core_name_format = core kernel.core_uses_pid = 0 kernel.child-runs-first = 1 kernel.panic = 0 kernel.domainname = brio.com kernel.hostname = lancer kernel.version = #1 SMP Tue Feb 11 02:24:10 EST 2003 kernel.osrelease = 2.4.9-e.12smp kernel.ostype = Linux fs.aio-max-pinned = 163836 fs.aio-max-size = 131072 ... Alternatively, the kernel params are listed in /proc/sys and they can be viewed or changed like all the other /proc parameters. eg: $ cat /proc/sys/kernel/sem # semaphore :: semmsl semmns semopm semmni 250 32000 32 128 $ cat /proc/sys/kernel/shmmax 33554432 $ cat /proc/sys/kernel/threads-max 20479 $ Changing kernel parameters: Edit /etc/sysctl.conf for permanent changes that persist thru reboot. Run sysctl -p to read this file and make changes effective immediately eg, for ora10g R2 install, add the following to /etc/sysctl.conf to modify equiv params in /proc/sys/kernel/shmmax and sem: kernel.shmmax=1036870912 kernel.sem=250 32000 100 128 Or, for one time change: echo VALUE > /proc/sys/kernel/file eg: echo "250 32000 100 128" > /proc/sys/kernel/sem Kernel Tuning Links [12]http://www-106.ibm.com/developerworks/linux/library/l-adfly.html?ca=den- wud describe the major /proc entries in Linux, what they do and stuff. Oracle 10g install on linux params are described in: [13]http://www.puschitz.com/InstallingOracle10g.shtml [14]http://groups.google.com/groups?q=increase+thread+linux&start=10&hl=en&l r=&ie=UTF-8&oe=UTF-8&selm=jw98.77j.1%40gated-at.bofh.it&rnum=20 A thread where it seems linux kernel only support 1024 threads. Changes would be in the config file and recompile kernel. Info on 2.4 [15]http://www.volano.com/linux.html Older info, 2.2 kernel. Info about source file to change to alter kernel param. SE Linux Red Hat Enterprise Linux 4.0 ships with an implementation of Security Enhanced Linux. They use "targeted policy" which only limits functionality to a pre-defined set of deamon processes. The defined set will then have to obey the Mandatory Access Control (MAC) and become more secure even when exploited. The rest of the process are monitored but are freely allowed to change state, and thus they will operate more like the traditional Discretionary Access Control (DAC). Overall, enabling SELinux in RHEL 4 is largely safe and don't cause too much headache. A few known places are known to break, such as chroot, dhcp. Some places it may cause lots of logging. Specific daemons (eg SNMPD) can be excempt from the SELinux targeted policy via: A1. Modify the /etc/selinux/targeted/booleans file. A2. Change snmpd_disable_trans=0 to snmpd_disable_trans=1 A3. reboot your server -or- B1. echo "1 1" > /selinux/booleans/snmpd_disable_trans B2. echo "1" > /selinux/commit_pending_bools B3. Check that the value in /etc/selinux/targeted/booleans is changed to snmpd_disable_trans=1 http://www.redhat.com/docs/manuals/enterprise/RHEL-4-Manual/selinux-guide/rhlco mmon-section-0010.html Linux Desktop Progies mtv mpegtv ($10 shareware req reg) for viewing mpeg video. mpegtv .com mvtp cli of mtv, free. -z = 2x2 zoom. -G+10+10 = place window in specified +x+y geometry mpeg_play bmrc.berkeley.edu mpeg video player. in old a.out (ZMAGIC) bin ary though. avail for solaris, etc. mpegplay mpeg video player found in Knoopix distro. xine free video player (vcd, dvd, avi, but no mpeg?). http://xinehq .de. totem alternate front end UI for xine. mpg123 cli for playing mp3 audio mpg321 drop in replacement for mpg123 xmms winamp like mp3 player (GUI for mpg123?) kate KDE editor w/ many extras, like CLI window, mgnt tabs, somewhat like Visual Studio editor lynx text based web browser elinks a much better text based browser BitchX a text based irc client irssi a newer text based irc client, some cmd same as BitchX --- fsview # A GUI to see directory/file space usage, kinda intere sting. redhat-logiviewer # GUI tool to parse many diff logs ethereal is replaced by wireshark but that only install text-based snooper called /usr/sbin/tshark older ethereal comes with a gtk+, gnome, kde package. But those are somehow no longer shipped (by up2date, rpmfind). Links Stress test program, to help diag nasty hardware problems: * [16]http://www.memtest86.com/ memory test * [17]http://members.dslextreme.com/users/billw/gkrellm/gkrellm.html gkrellm, may just seems like a pretty display program * [18]http://secure.netroedge.com/~lm78/ lm_sensors Linux hardware sensor, limited use * [19]http://www-128.ibm.com/developerworks/linux/library/l-hw1/ IBM write up on hw troubleshooting * [20]Fedora FAQ Very good step by step procedure on how to do many things in Fedora Linux * [21]Linux RPM, many linux flavors, but no more RHEL rpms. * [22]Fedora RPM, for those not avail thru YUM. * _________________________________________________________________ TBD # cmd.linux.ref # some content formerly adapted from cmd.admin.ref. ************************************************************ Red Hat 4.0 (and not available in 3.0) ************************************************************ /usr/sbin/system-config-kickstart kickstart configurator. system-config-netboot pxe, tftp boot setup system-config-language GUI language config tooll for the machi ne many of these system-config-* had been named redhat-config-* in RH 3.0 ************************************************************ Red Hat 9.0 2003/07 Also for RH 3.0 (and presumably available in RH 4.0) ************************************************************ /etc/X11/XF86Config # config file read by X server. redhat-config-xfree86 # config tool to create XF86Config, try system-config-d isplay in ES 4.0 and later. redhat-config-* # lot of red hat gui config tool. nautilus # file explorer gqview # acdsee like image viewer hwbrowser # GUI hardware browser, in /usr/bin ************************************************************ Red Hat ES 2.1 (7.2 base) ************************************************************ /usr/sbin/setup # rh version of aix smitty, not all that. gnorpm # GUI rpm manager, not in 3.0 or 4.0 (/usr/bin) ************************************************************ /etc/sendmail.cf edit DS line to read DSsv-smtp.hybridauto.com and sv-smtp will become the smarthost that will be used to realy all the outbou nd mail. linux adding route cmd: route add default gw 192.168.1.1 route delete -net 172.16.16.0 netmask 255.255.255.0 eth3 route add -net 172.16.16.0 netmask 255.255.255.0 gw 172.16.0.1 eth2 (but going out from first interface) route add -net 172.16.16.0 netmask 255.255.255.0 gw 172.16.0.1 metric 1 dev eth2 route add -net 172.16.16.0 netmask 255.255.255.0 dev eth3 ypcat (group, passwd) ypstart # linux ypbind ypinit # client, specify machines to bind to # server, specify whether master or slave # Often messed up client, "up2date yp" to ensure running latest code with bug fixes. ypwhich # tell what NIS server machine is bound to. passwd yppasswd (obsolete, for combatibility only) ypcat -k auto.master (-k to display the key name too!) ypcat -k auto.direct (the direct map, use /-) /etc/init.d/autofs # most standard automount from auto.master, etc. # /net need to be enabled by uncommenting entry in /etc /auto.master . # Some version of autofs (eg RH 4.0) have nasty bug tha t stale NFS mount # may result in autofs daemon wanting to erase all file s on server, # at the very least, seen it cause lot of errors in sys log. /etc/init.d/amd # an alternate for automount for /net/HOST/... paths # install as up2date am-utils, and enable always start via ntsysv # amd maybe a bit older than autofs and performance may not be as good. /etc/rc.d/init.d/ /etc/rc[35].d/ # newer RH system, note that links need exist in 3 and 5 runlevel # what init level machine currently in who -r # RH 9 and AS 3.0 (cmd exist in Solaris) /etc/inetd.conf /etc/xinetd.conf, /etc/xinetd.d/ /etc/printcap or /etc/printer.conf /etc/motd /etc/release # see which os cd was used eg sol 8 01/00 for Jan 2000 build. /etc/resolv.conf # dns setup /etc/nsswitch.conf # order of search for files/dns/nis /etc/fstab du -kxS * = display space usage Summary for only (x) one file sys (ie loc al) linux only du -kl = local disk in solaris? df -kl = report fs space usage of local fs, solaris and linux dhclient = get dhcp address from server for current client. ifconfig hme0 dhcp see purple book. ******************************************************************************* * linux: ******************************************************************************* * irouted printtool (red hat print config) e-conf enlightment configuration linux-conf most essential config of linux in here control-panel old red hat panel, configure network, printer, etc mkswap /dev/hdd3 # def RHEL 2.1 swap dev mkswap /dev/VolGroup00/LogVol01 # def RHEL 4 swap dev swapon -s # list swap dev (eg, which LV is swap p artion hosted on) swapon -a # turn on all swap partitions/files swapoff -a # turn off all swap partitions/files fdisk /dev/hda mkfs -t ext3 /dev/hdd2 # create a new fs on ide drive secondary slave. # probably only create as ext2; then: tune2fs -j /dev/hda3 # add journaling to it via tune2fs (manual for ext2 in 2.1) # (probably automatic/default in ext3/as 3.0) e2label /dev/hda3 [Partition-Label] view/change label of a partition used in /etc/fstab LABEL=/label-name for mounting so that mapping does not have to be maintained in fstab findfs LABEL=/boot # determine which disk host a given FS with the assigne d label. raven:/usr/local/bin/wshaper traffic shaping and throttle specific connection bandwidth usage. ntsysv text based UI for enabling service such as telnet/rlogin/vsftp, etc. Need to have ntsysv-1.3.13.2-0.3.rpm xterm, use rxvt color scheme, grey on black. MiscFixed font, 8pt. ************************************************** Linux on HP Intel HP Smart array rpm eg: hpacucli-7.60-18 part of HP/Compaq ProLiant Support Pack (PSP) More info: http://www1.jpn.hp.com/products/software/oe/linux/mainstream/bin/support/doc/ge neral/mgmt/acuxe/v731-1cli/hpacucli-7.31-1.linux.txt /usr/sbin/hpacucli => ctrl all show # list all controller => ctrl all show status # show controller info => ctrl slot=0 array all show # list all array in a given controller => ctrl slot=0 array all show status # array status, an array is a mirror se t. => ctrl slot=0 array A show # give info and config of a specific ar ray To find RAID config, simply: cat /proc/driver/cciss/cciss0 HP System Health Application and Isight Management Agent - hpasm For Proliant servers eg DL 585 rpm -ivh hpasm-7.6.0-111.rhel3.i386.rpm hpasm activate # activate and configure SNMP strings, etc /etc/init.d/hpasm reconfigure # change settings it create a bunch of cma* process For command usage, see http://gentoo-wiki.com/HOWTO_Use_Hpasm _________________________________________________________________ [Doc URL: [23]http://www.cs.fiu.edu/~tho01/psg/linux.html] (cc) Tin Ho. See [24]main page for copyright info. _________________________________________________________________ [25][taos_banner1.gif] "LYS on the outside, LKS in the inside" "AUHAUH on the outside, LAPPLAPP in the inside" References Visible links 1. http://www.cs.fiu.edu/~tho01/psg/ 2. http://www.cs.fiu.edu/~tho01/psg/psg.html 3. http://www.cs.fiu.edu/~tho01/psg/sol.html 4. http://www.cs.fiu.edu/~tho01/psg/hpux.html 5. http://www.cs.fiu.edu/~tho01/psg/aix.html 6. http://www.cs.fiu.edu/~tho01/psg/netapp.html 7. http://www.cs.fiu.edu/~tho01/psg/emc.html 8. http://www.cs.fiu.edu/~tho01/psg/ldap.html 9. http://www.cs.fiu.edu/~tho01/psg/centos.org 10. http://www.cs.fiu.edu/~tho01/psg/ldap.html 11. http://www.redhat.com/magazine/009jul05/features/lvm2/ 12. http://www-106.ibm.com/developerworks/linux/library/l-adfly.html?ca=den-wud 13. http://www.puschitz.com/InstallingOracle10g.shtml 14. http://groups.google.com/groups?q=increase+thread+linux&start=10&hl=en&lr=&ie=UTF-8&oe=UTF-8&selm=jw98.77j.1%40gated-at.bofh.it&rnum=20 15. http://www.volano.com/linux.html 16. http://www.memtest86.com/ 17. http://members.dslextreme.com/users/billw/gkrellm/gkrellm.html 18. http://secure.netroedge.com/~lm78/ 19. http://www-128.ibm.com/developerworks/linux/library/l-hw1/ 20. http://www.fedorafaq.org/ 21. http://www.cs.fiu.edu/~tho01/psg/www.rpmfind.net 22. http://www.cs.fiu.edu/~tho01/psg/www.freshrpm.net 23. http://www.cs.fiu.edu/~tho01/psg/linux.html" 24. http://www.cs.fiu.edu/~tho01/psg/psg.html 25. http://www.taos.com/ Hidden links: 26. http://www.cs.fiu.edu/~tho01/psg/64bit_and_rpm 27. http://www.cs.fiu.edu/~tho01/psg/linux.html ############################## # sysreport under redhat linux ############################## sysreport -norpm (older versions than RHES5) sosreport -noprm ################ # GPG-Key import ################ rpm --import http://kerp-mob056.unity.media.corp/CentOS_5.1_Final/RPM-GPG-KEY-CentOS-5 ######### # bonding ######### 1) Created bonding devices in "/etc/modprobe.conf" file alias bond0 bonding options bonding miimon=100 mode=1 2) Edit the "/etc/sysconfig/network-scripts/ifcfg-eth0 and ifcfg-eth1" configuration /etc/sysconfig/network-scripts/ifcfg-eth0 DEVICE=eth0 USERCTL= no ONBOOT=yes MASTER=bond0 SLAVE=yes BOOTPROTO=none /etc/sysconfig/network-scripts/ifcfg-eth1 DEVICE=eth1 USERCTL= no ONBOOT=yes MASTER=bond0 SLAVE=yes BOOTPROTO=none 3) Created a network script for the bonding device is "/etc/sysconfig/network-scripts/ifcfg-bond0" DEVICE=bond0 USERCTL=no ONBOOT=yes NETMASK=255.255.255.0 GATEWAY=xxx.xxx.xxx.xxx IPADDR=xxx.xxx.xxx.xxx ########## # groupadd ########## ID= GROUP= groupadd -g $ID $GROUP cat /tmp/group-to-be-add | while read i do ID=`echo $i|awk -F":" '{print $1}'` GROUP=`echo $i|awk -F":" '{print $2}'` groupadd -g $ID $GROUP done 1984:bb: ######### # useradd ######### ID= GROUP= USER= HOME= GECOS= cat /tmp/user-to-be-added | while read i do ID=`echo $i|awk -F":" '{print $1}'` GROUP=`echo $i|awk -F":" '{print $2}'` USER=`echo $i|awk -F":" '{print $3}'` HOME=`echo $i|awk -F":" '{print $4}'` GECOS=`echo $i|awk -F":" '{print $5}'` useradd -u $ID -g $GROUP -d ${HOME} -c "${GECOS}" -m ${USER} done 1984:bb:bb:/home/bb:Big Brother Systemueberwachung: 12350:users:kutz:/home/kutz:Hans-Dieter Kutz: 4444:users:tom:/home/tom:Thomas Bojahr: 204:users:andreas:/home/andreas:Andreas Fatum: ######### # netstat ######### netstat -an|awk '/tcp/ {print $6}'|sort|uniq -c # list programms opened the port netstat -tuvnap # How to read netstat output tcp 0 0 192.168.22.6:55017 www.oreillynet.com:www ESTABLISHED ^ ^ ^ ^ ^ ^ ^ ^ | | | | | | | | | | | | port remote port Connection | | | your machine server State | | bytes in send queue | Bytes in recive queue | type of connection Connection State can be StateDescription LISTEN accepting connections ESTABLISHED connection up and passing data SYN_SENT TCP; session has been requested by us; waiting for reply from remote endpoint SYN_RECV TCP; session has been requested by a remote endpoint for a socket on which we were listening LAST_ACK TCP; our socket is closed; remote endpoint has also shut down; we are waiting for a final acknowledgement CLOSE_WAIT TCP; remote endpoint has shut down; the kernel is waiting for the application to close the socket TIME_WAIT TCP; socket is waiting after closing for any packets left on the network CLOSED socket is not being used (FIXME. What does mean?) CLOSING TCP; our socket is shut down; remote endpoint is shut down; not all data has been sent FIN_WAIT1 TCP; our socket has closed; we are in the process of tearing down the connection FIN_WAIT2 TCP; the connection has been closed; our socket is waiting for the remote endpoint to shut down Active UNIX domain sockets (servers and established) Proto RefCnt Flags Type State I-Node Path unix 2 [ ACC ] STREAM LISTENING 21775 /tmp/.X11-unix/X0 unix 2 [ ACC ] STREAM LISTENING 22279 /var/run/sock.sock | | | | | | | | | | Stream State Inode disk file | | Flags | Reference Count Protocol A Unix domain socket (UDS) or IPC socket (inter-process communication socket) is a virtual socket, similar to an internet socket that is used in POSIX operating systems for inter-process communication. The correct standard POSIX term is POSIX Local IPC Sockets. These connections appear as byte streams, much like network connections, but all data remains within the local computer. In addition to sending data, processes can send file descriptors across a Unix domain socket connection using the sendmsg() and recvmsg() system calls. ##### # vnc ##### How to use VNC or your laptop as Console while loading Linux boot:linux vnc vncpassword=password for Redhat boot:install vnc=1 vncpassword=password for SUSE LINUX How to create a filesystem in Linux mkreiserfs /dev/sda1 to create a reiser filesystems of SUSE mke2fs -j /dev/sda1 to create ext3 filesystems Where is the WWNN and WWPN displayed in RHEL 4 and SLES9? Description: An Emulex HBA is installed into RHEL 4 or SLES 9. The OS finds and installs a driver. How do I discover the WWNN and WWPN? Resolution: 1 of 2 Use the 'cd' command to change directory to this location: /sys/class/scsi_host Use the 'ls' command to list the host adapter numbers. Use 'cd' to enter each directory and use 'ls -l' to list the contents. Any with entries that list lpfc are Emulex HBAs. Use 'cd' to enter the appropriate directories and use the following commands to list information for the hardware and driver: WWPN: cat port_name WWNN cat node_name NOTE: SLES 9 may be running driver v 2.10g. If no Emulex HBA are found in /sys/class/scsi_host, cd /proc/scsi/lpfc. If this exists, cat the adapter numbers found there. Solutions 2 For RHEL , cat lpfc_drvr_info, cat hdw, For SuSE, /sys/class/scsi_host, /proc/scsi/lpfc, SuSE Enterprise Linux 9, SLES 9, Novell How to Mount a CD-ROM (Linux) Login as root or root authority mount /mnt/cdrom or mount -o exec /mnt/cdrom If your CD-ROM was not automatically mounted, enter: mount -t iso9660 -o ro /dev/cdrom /mnt/cdrom ################################################# # To find world-writable files, use this command: ################################################# find / -perm -002 \( -type f -o -type d \) -ls ####################################### # Find files modified at a certain time ####################################### To find all files that was modified since a specific time ago (i.e an hour ago, a day ago, 24 hours ago, a weeks ago and so on) in Unix environment, the find command will come in handy. To find all files modified in the last 24 hours (last full day) in current directory and its sub-directories: find . -mtime -1 -print Flag -mtime -1 option tells find command to look for files modified in the last day (24 hours). Flag -print option will cause find command to print the files\u2019 location. -print can be replaced with -ls if you want a directory-listing-type response. To find all files modified in the last 24 hours (last full day) in a particular specific directory and its sub-directories: find /directory_path -mtime -1 -print The command is basically the same with the earlier command, just that now you no need to cd (change directory) to the directory you want to search. To find all files with regular file types only, and modified in the last 24 hours (last full day) in current directory and its sub-directories: find /directory_path -type f -mtime -1 -print To find all files that are modified today only (since start of day only, i.e. 12 am), in current directory and its sub-directories: touch -t `date +%m%d0000` /tmp/$$ find /tmefndr/oravl01 -type f -newer /tmp/$$ rm /tmp/$$ The first command can be modified to specify other date and time, so that the commands will return all files that have changed since that particular date and time. ############################## # How do I disable the zeroconf route so that the system will boot without the 169.254.0.0 / 255.255.0.0 route? ############################## Symptom: Every time the system boots, the zeroconf route (169.254.0.0) is enabled. You manually disable it by turning off the firewall and remove the route with 169.254.0.0 / 255.255.0.0 using the route command. Example output of the route with the zeroconf route enables would like similar to the following: # route Kernel IP routing table Destination Gateway Genmask Flags Metric Ref Use Iface 10.15.50.0 * 255.255.252.0 U 0 0 0 eth0 169.254.0.0 * 255.255.0.0 U 0 0 0 eth0 Solution: To disable the zeroconf route during system boot, edit the /etc/sysconfig/network file and add the following NOZEROCONF value to the end of the file: NETWORKING=YES HOSTNAME=localhost.localdomain NOZEROCONF=yes ################# # create tempfile ################# dd if=/dev/zero of=/tmp/1gbfile bs=1048576 count=1000 rm -f /tmp/1gbfile ############################################### # Executing multiple commands with FIND command ############################################### find . -iname *.flac -exec sh -c "flac2vorbis {} && rm {}" \; ######################################## # Run rtorrent as a daemon in Arch Linux ######################################## Copy this into /etc/rc.d/rtorrent and add the daemon to /etc/rc.conf. Make sure you change USER in the script below to your user name #!/bin/bash . /etc/rc.conf . /etc/rc.d/functions case "$1" in start) stat_busy "Starting rtorrent" su rtorrent -c 'screen -d -m rtorrent' &> /dev/null if [ $? -gt 0 ]; then stat_fail else add_daemon rtorrent stat_done fi ;; stop) stat_busy "Stopping rtorrent" killall -w -s 2 /usr/bin/rtorrent &> /dev/null if [ $? -gt 0 ]; then stat_fail else rm_daemon rtorrent stat_done fi ;; restart) $0 stop sleep 1 $0 start ;; *) echo "usage: $0 {start|stop|restart}" esac exit 0 ####################### # create new filesystem ####################### DEVICE=sdb VG_NAME=hunter_data LV_NAME=silent_data pvcreate /dev/${DEVICE} vgcreate -v $VG_NAME /dev/${DEVICE} lvcreate --name ${LV_NAME} --size 30g ${VG_NAME} mkfs.ext3 /dev/${VG_NAME}/${LV_NAME} mkdir /silent_hunter_data mount /dev/${VG_NAME}/${LV_NAME} /silent_hunter_data ################### # filesystem extend ################### umount /silent_hunter_data lvextend --size +19g /dev/hunter_data/silent_data e2fsck -f /dev/hunter_data/silent_data resize2fs /dev/hunter_data/silent_data mount /silent_hunter_data http://tldp.org/HOWTO/LVM-HOWTO/extendlv.html 11.9. Extending a logical volume To extend a logical volume you simply tell the lvextend command how much you want to increase the size. You can specify how much to grow the volume, or how large you want it to grow to: # lvextend -L12G /dev/myvg/homevol lvextend -- extending logical volume "/dev/myvg/homevol" to 12 GB lvextend -- doing automatic backup of volume group "myvg" lvextend -- logical volume "/dev/myvg/homevol" successfully extended will extend /dev/myvg/homevol to 12 Gigabytes. # lvextend -L+1G /dev/myvg/homevol lvextend -- extending logical volume "/dev/myvg/homevol" to 13 GB lvextend -- doing automatic backup of volume group "myvg" lvextend -- logical volume "/dev/myvg/homevol" successfully extended will add another gigabyte to /dev/myvg/homevol. After you have extended the logical volume it is necessary to increase the file system size to match. how you do this depends on the file system you are using. By default, most file system resizing tools will increase the size of the file system to be the size of the underlying logical volume so you don't need to worry about specifying the same size for each of the two commands. 1. ext2/ext3 Unless you have patched your kernel with the ext2online patch it is necessary to unmount the file system before resizing it. (It seems that the online resizing patch is rather dangerous, so use at your own risk) # umount /dev/myvg/homevol/dev/myvg/homevol # resize2fs /dev/myvg/homevol # mount /dev/myvg/homevol /home If you don't have e2fsprogs 1.19 or later, you can download the ext2resize command from ext2resize.sourceforge.net and use that: # umount /dev/myvg/homevol/dev/myvg/homevol # ext2resize /dev/myvg/homevol # mount /dev/myvg/homevol /home For ext2 there is an easier way. LVM 1 ships with a utility called e2fsadm which does the lvextend and resize2fs for you (it can also do file system shrinking, see the next section). Warning LVM 2 Caveat There is currently no e2fsadm equivalent for LVM 2 and the e2fsadm that ships with LVM 1 does not work with LVM 2. so the single command # e2fsadm -L+1G /dev/myvg/homevol is equivalent to the two commands: # lvextend -L+1G /dev/myvg/homevol # resize2fs /dev/myvg/homevol Note Note You will still need to unmount the file system before running e2fsadm. 2. reiserfs Reiserfs file systems can be resized when mounted or unmounted as you prefer: * Online: # resize_reiserfs -f /dev/myvg/homevol * Offline: # umount /dev/myvg/homevol # resize_reiserfs /dev/myvg/homevol # mount -treiserfs /dev/myvg/homevol /home 3. xfs XFS file systems must be mounted to be resized and the mount-point is specified rather than the device name. # xfs_growfs /home 4. jfs Just like XFS the JFS file system must be mounted to be resized and the mount-point is specified rather than the device name. You need at least Version 1.0.21 of the jfs-utils to do this. # mount -o remount,resize /home Warning Known Kernel Bug Some kernel versions have problems with this syntax (2.6.0 is known to have this problem). In this case you have to explicitly specify the new size of the filesystem in blocks. This is extremely error prone as you must know the blocksize of your filesystem and calculate the new size based on those units. Example: If you were to resize a JFS file system to 4 gigabytes that has 4k blocks, you would write: # mount -o remount,resize=1048576 /home ############# # resolv.conf ############# search domain.name nameserver IP nameserver IP options rotate options timeout 3