Posts

Showing posts with the label redhat

Get a List of rpms for a Specific Program or Version

Image
Systems that use rpm as the package manager can often be managed by using yum, but sometimes a simple rpm command can quickly give the required information. The RPM Package Manager has a huge number of options, but most commonly only a few are used on a regular basis. Get a list of rpms for mysql-5.1   Check for mysql version 5.1   $ rpm -qa |grep mysql | grep 5.1 mysql-test-5.1.52-1.el6_0.1.x86_64 mysql-connector-java-5.1.12-2.el6.x86_64 mysql-bench-5.1.52-1.el6_0.1.x86_64 mysql-server-5.1.52-1.el6_0.1.x86_64 mysql-connector-odbc-5.1.5r1144-7.el6.x86_64 mysql-5.1.52-1.el6_0.1.x86_64 mysql-libs-5.1.52-1.el6_0.1.x86_64 mysql-devel-5.1.52-1.el6_0.1.x86_64 Of course we can use egrep, and sort to get a more specific list $ rpm -qa |egrep -i "bash|ntpdate|httpd"|sort bash-4.1.2-8.el6.x86_64 ntpdate-4.2.4p8-2.el6.x86_64 xargs - build and execute command lines from standard input Now suppose we want to remove all the rpms found by the rpm query. Sometimes we can ...

Advanced Linux Networking Tools

Image
Some of the more common tools for advanced networking include: tcpdump, netstat, wireshark, and tshark. A previous article covered Basic Linux Networking Tools . Discover Switch Information Now for the advanced stuff. We use tcpdump, and write it to a file pkt.cap. Then we use tshark to read the file. How to check the router to which the linux host is connected. # tcpdump -nvi eth0 -c 1 -s 1500 -w pkt.cap ether proto 0xaa and ether dst 01:00:0c:cc:cc:cc and ether\[20\] \=\= 0x20 and ether\[21\] \=\= 0x00 # tshark -V -r pkt.cap # tcpdump -nvi eth0 -c 1 -s 1500 -w pkt.cap ether proto 0xaa and ether dst 01:00:0c:cc:cc:cc and ether\[20\] \=\= 0x20 and ether\[21\] \=\= 0x00;tshark -V -r pkt.cap tcpdump: listening on eth0, link-type EN10MB (Ethernet), capture size 1500 bytes 1 packets captured 1 packets received by filter 0 packets dropped by kernel Running as user "root" and group "root". This could be dangerous. Frame 1 (416 bytes on wire, 416 bytes captured) Arrival T...

Basic Linux Networking Tools

Image
Verify Network Connection Most people, who have been around redhat linux for a while, know how to check the IP address, and MAC address using ifconfig. Next, they would typically use route -n (or netstat -r) to find the gateway, and then ping it to verify a connection. Then maybe check duplex and speed using ethtool. Check the IP Address # ifconfig eth0 eth0 Link encap:Ethernet HWaddr 00:15:17:C1:54:D4 inet addr:10.10.5.67 Bcast:10.10.5.255 Mask:255.255.255.0 inet6 addr: fe80::215:17ff:fec1:54d4/64 Scope:Link UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:342967 errors:0 dropped:0 overruns:0 frame:0 TX packets:353260 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:64963573 (61.9 MiB) TX bytes:262444897 (250.2 MiB) Memory:b8820000-b8840000 Discover the Gateway Address Then, it is common to check the default route with route -n, or netstat -nr. # route -n Kernel...

Yum Repositories for RHEL 5

Image
Sometimes we need a RHEL5 Repository that includes software not released by Redhat. It may be that we need a newer version, or simply something that was not included in our installation, and is not part of the standard redhat repositories. Missing RPM Have you ever tried to install something with yum, only to find that the package is not available? $sudo yum -y install vlc Password: Server | 1.3 kB 00:00 Updates | 951 B 00:00 Workstation | 1.1 kB 00:00 addons | 951 B 00:00 base | 2.1 kB 00:00 extras | 2.1 kB 00:00 update | 1.9 kB 00:00 Excluding Packages in global exclude list Finished...

RHCE Flash Cards

Image
I came up with some flashcards based on commonly used redhat linux commands. Here is my working draft. RHCE -Flash-Cards These notes should be helpful to anyone working on Redhat Enterprise Linux (RHEL), or preparing for the RHCE exam. My RHCE Study Guide was hugely popular, but unfortunately it had some potential copyright issues. This group of flashcards has also been released as a quick study guide, or cheat sheet, and contains much of the same original study guide material, but with all proprietary information removed. This 3-page guide is listed as RHCE Flash Cards (condensed version) How These Slides Were Created These slides were produced using OpenOffice.org Impress. Created Slides Saved as html Copied contents of html between body tags to .page files. Used a bash shell script with sed, and awk to get the files to appear properly for webgen. See script here— html2page.html Ran webgen on the directory to generate .html Also .pdf files were saved from Openoffice.org Wri...

Network Config

Image
How Do I Configure Networking in RedHat Linux? Depending on the version of RedHat, or Fedora: redhat-config-network system-config-network bash-2.05b$ which redhat-config-network /usr/bin/redhat-config-network bash-2.05b$ Network Related Files: /etc/sysconfig/network-scripts/ifcfg-eth0 /etc/sysconfig/network /etc/hosts /etc/resolv.conf For more details, remember that the Red Hat Manuals are available online: http://www.redhat.com/docs/manuals Network Info: http://www.redhat.com/docs/manuals/enterprise/RHEL-4-Manual/ref-guide/s1-networkscripts-interfaces.html rhce linux