How to install and use system-config-network-tui in RHEL-Red Hat/Fedora Linux?

This is the network configuration tool, supporting Ethernet and Wireless

Note: You must have root to install the package. To install this package in Red Hat/Fedora Linux.

#yum install system-config-network-tui

You can check the details of this package system-config-network-tui

# yum info system-config-network-tui
Installed Packages
Name       : system-config-network-tui
Arch       : noarch
Version    : 1.3.99.19
Release    : 2.el5
Size       : 4.7 M
Repo       : installed
Summary    : The NEtwork Adminstration Tool
URL        : http://fedora.redhat.com/projects/config-tools/redhat-config-network.html
License    : GPL
Description: This is the network configuration tool, supporting Ethernet,
: Wireless, TokenRing, ADSL, ISDN and PPP.

 

#system-config-network-tui

Will bring up the following screen:

From here you can edit your wireless/Ethernet or DNS, in my case we only have an Ethernet card.


We are going to edit "eth0"


We have the following options from here:
  • Use DHCP
  • Assign or change the static IP Address, Subnet Mask and Gateway


We can also edit our DNS settings

Assign a primary and secondary DNS server



nbtstat for Linux – nmblookup

Using smblookup on Ubuntu

Install - samba-common-bin
Run - nmblookup -A <ip address>

sif@ sifizm:~/Downloads$ sudo apt-get install samba-common-bin[sudo] password for sif:
Once samba-common-bin is install you can now use nmblookup(nbtstat) to run the following command:

sif@sifizm:~/Downloads$ nmblookup -A 10.1.1.2Looking up status of 10.1.1.2 DT-SIF        <00> -         M <ACTIVE>
	CO            <00> - <GROUP> M <ACTIVE>
	DT-SIF        <20> -         M <ACTIVE> 	CO            <1e> - <GROUP> M <ACTIVE> 

	MAC Address = MACMACMACMAC

sif@sifizm:~/Downloads$ nmblookup -A 10.1.1.3Looking up status of 10.1.1.3
 LT-Sif2       <00> -         M <ACTIVE>
	LT-Sif2       <20> -         M <ACTIVE> 	CO            <00> - <GROUP> M <ACTIVE>
	CO            <1e> - <GROUP> M <ACTIVE> 

	MAC Address = MACMACMACMAC 

Changing your CentOS to use NTP and configure for UTC

Tested on Centos 5 and 6

Install ntp

The ntp package has utilities and daemons that will synchronize your computer’s time to Coordinated Universal Time (UTC) via the NTP protocol and NTP servers. The ntp package includes ntpdate (a program for retrieving the date and time from remote machines via a network) and ntpd (a daemon which continuously adjusts system time). Install the ntp package:

 # yum install ntp

How do I configure an NTP Client?

Simply edit /etc/ntp.conf file, enter:

 # vi /etc/ntp.conf

Make sure the following line exists:

 server ntp.server.com

Where,

ntp.server.com : the hostname or IP address of the site NTP server.  For my network we use the default route.
You can also run ntpd using cron:

 # echo '30 * * * * root /usr/sbin/ntpd -q -u ntp:ntp' > /etc/cron.d/ntpd

The above instructs crond to run ntpd and after setting the clock just exit, and the -u option instructs it to run as the ntp user.

 rm /etc/localtime
 ln -s /usr/share/zoneinfo/UTC /etc/localtime

Installing GNOME Desktop on Centos 6

It used the be in earlier versions of CentOS that one could install a GNOME desktop or KDE desktop by using yum groupinstall “GNOME Desktop” or “KDE Desktop”.

However it is now very generic.

To install it do:

yum groupinstall "Desktop" "X Window System"

Make sure to edit /etc/inittab and change the runlevel to 5, otherwise the desktop environment will not auto start.  (In my case I don’t want it to so I use startX when I need it)

cat /etc/inittab</pre>
...
 id:5:initdefault:
<pre>

Then reboot your CentOS 6 host for the settings to take effect.

Import a list of CSV files into DB

By : Keegan

Import a list of CSV files into their appropriate tables and email the results when finished.

<?php
 # Author: Keegan
 # Email: keegan@sifizm.com
 # Web Site: www.sifizm.com

# I run this script from a cron job every night to update
 # the mysql database I use with my employee web site
 # so it matches my local database every day. Feel free to
 # modify it to meet your specific needs. If you find it
 # usefull, drop me an email and let me know.

# edit the follow six items to use the script

# first connect to your mysql database
 # i have my connection settings in a diferent file
 # so i just include that file in all my scripts
 include(“db.php”);

# assign the tables that you want to import to to the table array
 $table = array(
 ‘table1′,
 ‘table2′,
 ‘table3′,
 ‘table4′,
 ‘table5′,
 );

# if the first row of your csv file contains column headings:
 # $columnheadings=1
 # if the first row does not contain column headings and should be imported:
 # $columnheadings=0
 $columnheadings = 0;

# contains the email address you want the results sent to
 $emailaddress = “user@domain.com”;

# contains the subject you want the message to have
 $subject = “Enter Subject Here”;

# contains the email address that will show in the from line
 $emailfrom = “user@domain.com”;

# you should not have to edit anything below this line

# perform the required operations for every table listed in the table array
 foreach ($table as $tablename) {

# empty the table of its current records
 $deleterecords = “TRUNCATE TABLE `$tablename`”;
 mysql_query($deleterecords);

# intialize your counters for successful and failed record imports
 $pass = 0;
 $fail = 0;

# the csv file needs to be the same name as the table,
 # comma seperated with the columns in the same order as the table,
 # and in the same dir as this script
 $filecontents = file (“$tablename.csv”); # .csv is added to the table name to get the name of the csv file

# every record in the csv file will be inserted into the table unless an error occurs with that record
 for($i=$columnheadings; $i<sizeof($filecontents); $i++) {
 $insertrecord = “Insert Into `$tablename` Values ($filecontents[$i])”;
 mysql_query($insertrecord);
 if(mysql_error()) {
 $fail += 1; # increments if there was an error importing the record
 }
 else
 {
 $pass += 1; # increments if the record was successfully imported
 }
 }

# adds a line to the email message we will send stating how many records were imported
 # and how many records failed for each table
 $message .= “Table $tablename: Success=$pass Failure=$fail \n”;
 }

# set to the date and time the script was run
 $runtime = (date(“d M Y H:i”));

# add the run time to the body of the email message
 $message .= “\nTime of the message: $runtime (server time zone)\n\n”;

# Send the email message
 mail($emailaddress, $subject, $message, “From: ‘$emailfrom’”);

?>
<pre>

Subscribe to RSS Feed Follow me on Twitter!