About admin

My name is Vidyadhar Sarmalkar & I work as a consultant and have done RHCE & CCNA.
Website:
admin has written 229 articles so far, you can find them below.


Data Usage Monitoring with NTM Network Traffic Monitor

Most of the time while travelling I have to carry data card. In some cases data access plan is limited on these data card.

To avoid crossing the data limit, I have to login to service provider / carrier website to check the current data usage.

But now I don’t have to worry about data plans and excess usage due to NETWORK TRAFFIC MONITOR (NTM)

Basically NTM is an application to monitor data usage on particular interface. It can display a complete report for received and transmitted packets. Once the basic configuration is done, it will automatically disconnect you from the network after a certain period of time or after the traffic exceeds the value you set (MB).

By default, NTM will use the “ppp0″ network interface which is your data card interface but if you want it to track your wireless traffic, use “wlan0″ instead.

Following are the characteristics:

  • Choice of the interface to monitoring.
  • Period to monitoring: Day, Week, Month, Year or Custom Days. With autoupdate.
  • Threshold: Auto disconnection if a limit is reached (by NetworkManager).
  • Traffic Monitoring: Inbound, outbound and total traffic; Show the traffic speed.
  • Time Monitoring: Total time of connections in the period.
  • Time Slot Monitoring: Number of sessions used.
  • Reports: Show of average values and daily traffic of a configurable period.
  • Online checking with NetworkManager or by “Ping Mode”.
  • The traffic is attributed to the day when the session began.
  • Not need root privilege.
  • Not invasive, use a system try icon.
  • Tested with: Ubuntu 9.10 (Karmic Koala), Kubuntu 9.10, Xubuntu 9.10, Ubuntu 9.10 Netbook Remix, Ubuntu 9.04 (Jaunty Jackalope), Fedora 11, Fedora 12,

You can download the debian package from http://sourceforge.net/projects/netramon/

Download the package to tmp directory and install it via dpkg command

cd /tmp
wget http://downloads.sourceforge.net/project/netramon/NTM/ntm-1.x/ntm-1.3.deb
sudo dpkg -i ntm-1.3.deb

That’s it. Now you can run NTM from Application > Internet > NTM

Monitor CPU temperature in Ubuntu

Recently I need to monitor CPU temperature as my desktop was getting power off after using it couple hours.
In Ubuntu we can monitor CPU and other system temperatures, fan speeds, and other system data using an application lm-sensors. It can also show this information on your desktop or GNOME panel using one of several other applications.

First we have to install lm-sensors on the system. To do so run,

sudo apt-get install lm-sensors

Run sudo sensors-detect and answer YES to all YES/no questions.

sudo sensors-detect

Following output I received after running above command

# sensors-detect revision 5946 (2011-03-23 11:54:44 +0100)
# Board: Intel Corporation D101GGC
 
This program will help you determine which kernel modules you need
to load to use lm_sensors most effectively. It is generally safe
and recommended to accept the default answers to all questions,
unless you know what you're doing.
 
Some south bridges, CPUs or memory controllers contain embedded sensors.
Do you want to scan for them? This is totally safe. (YES/no): YES
Module cpuid loaded successfully.
Silicon Integrated Systems SIS5595...                       No
VIA VT82C686 Integrated Sensors...                          No
VIA VT8231 Integrated Sensors...                            No
AMD K8 thermal sensors...                                   No
AMD Family 10h thermal sensors...                           No
AMD Family 11h thermal sensors...                           No
AMD Family 12h and 14h thermal sensors...                   No
Intel digital thermal sensor...                             No
Intel AMB FB-DIMM thermal sensor...                         No
VIA C7 thermal sensor...                                    No
VIA Nano thermal sensor...                                  No
 
Some Super I/O chips contain embedded sensors. We have to write to
standard I/O ports to probe them. This is usually safe.
Do you want to scan for Super I/O sensors? (YES/no): Yes
Probing for Super-I/O at 0x2e/0x2f
Trying family `National Semiconductor'...                   No
Trying family `SMSC'...                                     Yes
Found `SMSC DME1737 Super IO'                               
    (hardware monitoring capabilities accessible via SMBus only)
Probing for Super-I/O at 0x4e/0x4f
Trying family `National Semiconductor'...                   No
Trying family `SMSC'...                                     No
Trying family `VIA/Winbond/Nuvoton/Fintek'...               No
Trying family `ITE'...                                      No
 
Some systems (mainly servers) implement IPMI, a set of common interfaces
through which system health data may be retrieved, amongst other things.
We first try to get the information from SMBIOS. If we don't find it
there, we have to read from arbitrary I/O ports to probe for such
interfaces. This is normally safe. Do you want to scan for IPMI
interfaces? (YES/no): Yes
Probing for `IPMI BMC KCS' at 0xca0...                      No
Probing for `IPMI BMC SMIC' at 0xca8...                     No
 
Some hardware monitoring chips are accessible through the ISA I/O ports.
We have to write to arbitrary I/O ports to probe them. This is usually
safe though. Yes, you do have ISA I/O ports even if you do not have any
ISA slots! Do you want to scan the ISA I/O ports? (yes/NO): Yes
Probing for `National Semiconductor LM78' at 0x290...       No
Probing for `National Semiconductor LM79' at 0x290...       No
Probing for `Winbond W83781D' at 0x290...                   No
Probing for `Winbond W83782D' at 0x290...                   No
 
Lastly, we can probe the I2C/SMBus adapters for connected hardware
monitoring devices. This is the most risky part, and while it works
reasonably well on most systems, it has been reported to cause trouble
on some systems.
Do you want to probe the I2C/SMBus adapters now? (YES/no): yes
Using driver `i2c-piix4' for device 0000:00:14.0: ATI Technologies Inc IXP SB400 SMBus Controller
Module i2c-dev loaded successfully.
 
Next adapter: SMBus PIIX4 adapter at 0b00 (i2c-0)
Do you want to scan it? (YES/no/selectively): yes
Client found at address 0x2e
Probing for `Myson MTP008'...                               No
Probing for `National Semiconductor LM78'...                No
Probing for `National Semiconductor LM79'...                No
Probing for `National Semiconductor LM80'...                No
Probing for `National Semiconductor LM85'...                No
Probing for `National Semiconductor LM96000 or PC8374L'...  No
Probing for `Analog Devices ADM1027'...                     No
Probing for `Analog Devices ADT7460 or ADT7463'...          No
Probing for `SMSC EMC6D100 or EMC6D101'...                  No
Probing for `SMSC EMC6D102'...                              No
Probing for `SMSC EMC6D103'...                              No
Probing for `SMSC EMC6D103S'...                             No
Probing for `Winbond WPCD377I'...                           No
Probing for `Analog Devices ADT7467 or ADT7468'...          No
Probing for `Analog Devices ADT7470'...                     No
Probing for `Analog Devices ADT7473'...                     No
Probing for `Analog Devices ADT7475'...                     No
Probing for `Analog Devices ADT7476'...                     No
Probing for `Analog Devices ADT7490'...                     No
Probing for `Andigilog aSC7611'...                          No
Probing for `Andigilog aSC7621'...                          No
Probing for `National Semiconductor LM87'...                No
Probing for `Analog Devices ADM1024'...                     No
Probing for `National Semiconductor LM93'...                No
Probing for `National Semiconductor LM94'...                No
Probing for `Winbond W83781D'...                            No
Probing for `Winbond W83782D'...                            No
Probing for `Winbond W83791D'...                            No
Probing for `Winbond W83792D'...                            No
Probing for `Winbond W83793R/G'...                          No
Probing for `Nuvoton W83795G/ADG'...                        No
Probing for `Winbond W83627HF'...                           No
Probing for `Winbond W83627EHF'...                          No
Probing for `Winbond W83627DHG/W83667HG/W83677HG'...        No
Probing for `Asus AS99127F (rev.1)'...                      No
Probing for `Asus AS99127F (rev.2)'...                      No
Probing for `Asus ASB100 Bach'...                           No
Probing for `Winbond W83L786NR/NG/R/G'...                   No
Probing for `Winbond W83L785TS-S'...                        No
Probing for `Analog Devices ADM9240'...                     No
Probing for `Dallas Semiconductor DS1780'...                No
Probing for `National Semiconductor LM81'...                No
Probing for `Analog Devices ADM1026'...                     No
Probing for `Analog Devices ADM1025'...                     No
Probing for `Maxim MAX6639'...                              No
Probing for `Texas Instruments AMC6821'...                  No
Probing for `Analog Devices ADM1029'...                     No
Probing for `Analog Devices ADM1030'...                     No
Probing for `Analog Devices ADM1031'...                     No
Probing for `Analog Devices ADM1022'...                     No
Probing for `Texas Instruments THMC50'...                   No
Probing for `Analog Devices ADM1028'...                     No
Probing for `Texas Instruments THMC51'...                   No
Probing for `ITE IT8712F'...                                No
Probing for `SMSC DME1737'...                               Success!
    (confidence 6, driver `dme1737')
Probing for `SMSC SCH5027D-NW'...                           No
Probing for `SMSC EMC2103'...                               No
Probing for `Fintek F75373S/SG'...                          No
Probing for `Fintek F75375S/SP'...                          No
Probing for `Fintek F75387SG/RG'...                         No
Probing for `Winbond W83791SD'...                           No
Client found at address 0x50
Probing for `Analog Devices ADM1033'...                     No
Probing for `Analog Devices ADM1034'...                     No
Probing for `SPD EEPROM'...                                 Yes
    (confidence 8, not a hardware monitoring chip)
Probing for `EDID EEPROM'...                                No
Client found at address 0x52
Probing for `Analog Devices ADM1033'...                     No
Probing for `Analog Devices ADM1034'...                     No
Probing for `SPD EEPROM'...                                 Yes
    (confidence 8, not a hardware monitoring chip)
 
Next adapter: Radeon i2c bit bus DVI_DDC (i2c-1)
Do you want to scan it? (YES/no/selectively): yes
 
Next adapter: Radeon i2c bit bus VGA_DDC (i2c-2)
Do you want to scan it? (YES/no/selectively): yes
 
Next adapter: Radeon i2c hw bus MM_I2C (i2c-3)
Do you want to scan it? (YES/no/selectively): yes
 
Next adapter: Radeon i2c bit bus MONID (i2c-4)
Do you want to scan it? (YES/no/selectively): yes
Client found at address 0x50
Probing for `Analog Devices ADM1033'...                     No
Probing for `Analog Devices ADM1034'...                     No
Probing for `SPD EEPROM'...                                 No
Probing for `EDID EEPROM'...                                Yes
    (confidence 8, not a hardware monitoring chip)
Client found at address 0x51
Probing for `Analog Devices ADM1033'...                     No
Probing for `Analog Devices ADM1034'...                     No
Probing for `SPD EEPROM'...                                 No
Client found at address 0x52
Probing for `Analog Devices ADM1033'...                     No
Probing for `Analog Devices ADM1034'...                     No
Probing for `SPD EEPROM'...                                 No
Client found at address 0x53
Probing for `Analog Devices ADM1033'...                     No
Probing for `Analog Devices ADM1034'...                     No
Probing for `SPD EEPROM'...                                 No
 
Next adapter: Radeon i2c bit bus GPIOPAD_MASK (i2c-5)
Do you want to scan it? (YES/no/selectively): yes
 
Now follows a summary of the probes I have just done.
Just press ENTER to continue: 
 
Driver `dme1737':
  * Bus `SMBus PIIX4 adapter at 0b00'
    Busdriver `i2c_piix4', I2C address 0x2e
    Chip `SMSC DME1737' (confidence: 6)
 
To load everything that is needed, add this to /etc/modules:
#----cut here----
# Chip drivers
dme1737
#----cut here----
If you have some drivers built into your kernel, the list above will
contain too many modules. Skip the appropriate ones!
 
Do you want to add these lines automatically to /etc/modules? (yes/NO)yes
Successful!
 
Monitoring programs won't work until the needed modules are
loaded. You may want to run 'service module-init-tools start'
to load them.
 
Unloading i2c-dev... OK
Unloading cpuid... OK

At the end of sensors-detect, a list of modules that needs to be loaded will displayed. Type “yes” to have sensors-detect insert those modules into /etc/modules, or edit /etc/modules yourself.

Next, run “sudo service module-init-tools start”. This will read the changes you made to /etc/modules in above step, and insert the new modules into the kernel.

sudo service module-init-tools start

Next, you should test that lm-sensors works correctly. Run the “sensors” command and check the output. Example output is below:

sensors
acpitz-virtual-0
Adapter: Virtual device
temp1:        +40.0°C  (crit = +75.0°C)
 
dme1737-i2c-0-2e
Adapter: SMBus PIIX4 adapter at 0b00
5VSB:         +0.00 V  (min =  +0.00 V, max =  +6.64 V)  ALARM
Vcore:        +1.36 V  (min =  +0.00 V, max =  +2.99 V)
+3.3V:        +3.38 V  (min =  +0.00 V, max =  +4.38 V)
+5V:          +5.17 V  (min =  +0.00 V, max =  +6.64 V)
+12V:        +12.18 V  (min =  +0.00 V, max = +15.94 V)
3VSB:         +3.37 V  (min =  +0.00 V, max =  +4.38 V)
Vbat:         +0.00 V  (min =  +0.00 V, max =  +4.38 V)
fan1:        2276 RPM  (min =    0 RPM)
fan2:           0 RPM  (min =    0 RPM)
fan3:           0 RPM  (min =    0 RPM)
fan4:           0 RPM  (min =    0 RPM)
temp1:        +43.2°C  (low  = -127.0°C, high = +69.0°C)
SIO Temp:     +44.2°C  (low  = -127.0°C, high = +69.0°C)
temp3:        +59.0°C  (low  = -127.0°C, high = +69.0°C)  ALARM
cpu0_vid:    +1.088 V

The sensor output may be tweaked by editing the “/etc/sensors.conf” file. It is possible to correct inaccurate scaling too. For details check “man sensors.conf”.

You can also install xsensors to view the temperature graphically. To do so run

sudo apt-get install xsensors

Now go to Applications > System Tools > Xsensors. You will get following screen depending on your configuration.

Readers if you are using any other tool, please let us know the same.

Automatically Install Updates Ubuntu

Updating your system at periodic time is a good practice. But some of us forgot to do so. In search of automatic updates I found Unattended Upgrade. You can modify the package as per your need.

To start, first you need to install Unattended-Upgrade

sudo apt-get install unattended-upgrades

Unattended-Upgrade calls /etc/cron.daily/apt
To set everything first create a file /etc/apt/apt.conf.d/10periodic and edit it with your favorite editor. For eg I am attaching my file below.

sudo /etc/apt/apt.conf.d/10periodic
APT::Periodic::Enable "1";
APT::Periodic::Update-Package-Lists "1";
APT::Periodic::Download-Upgradeable-Packages "1";
APT::Periodic::AutocleanInterval "5";
APT::Periodic::Unattended-Upgrade "1";
APT::Periodic::RandomSleep "1800";
APT::Periodic::Verbose "1";

Note: Details about what these values mean may be found in the header of the /etc/cron.daily/apt file.
When the apt job starts, it will sleep for a random period between 0 and APT::Periodic::RandomSleep seconds. The default value is “1800″ so that the script will stall for up to 30 minutes (1800 seconds) so that the mirror servers are not crushed by everyone running their updates all at the same time. Only set this to 0 if you use a local mirror and don’t mind the load spikes. Note that while the apt job is sleeping it will cause the execution of the rest of your cron.daily jobs to be delayed.

Now edit /etc/apt/apt.conf.d/50unattended-upgrades, it should look like below:

// Automatically upgrade packages from these (origin, archive) pairs
Unattended-Upgrade::Allowed-Origins {    
    // ${distro_id} and ${distro_codename} will be automatically expanded
    "${distro_id} stable";
    "${distro_id} ${distro_codename}-security";
    "${distro_id} ${distro_codename}-updates";
//  "${distro_id} ${distro_codename}-proposed-updates";
};
 
// List of packages to not update
Unattended-Upgrade::Package-Blacklist {
//  "vim";
//  "libc6";
//  "libc6-dev";
//  "libc6-i686";
};
 
// Send email to this address for problems or packages upgrades
// If empty or unset then no email is sent, make sure that you 
// have a working mail setup on your system. The package 'mailx'
// must be installed or anything that provides /usr/bin/mail.
Unattended-Upgrade::Mail "root@localhost";
 
// Do automatic removal of new unused dependencies after the upgrade
// (equivalent to apt-get autoremove)
Unattended-Upgrade::Remove-Unused-Dependencies "true";
 
// Automatically reboot *WITHOUT CONFIRMATION* if a 
// the file /var/run/reboot-required is found after the upgrade 
//Unattended-Upgrade::Automatic-Reboot "false";

Note : The double “//” serve as comments, so whatever follows “//” will not be evaluated

Now create STAMP file,

touch /var/lib/apt/periodic/update-stamp
touch /var/lib/apt/periodic/download-upgradeable-stamp
touch /var/lib/apt/periodic/upgrade-stamp
touch /var/lib/apt/periodic/autoclean-stamp

Now we will set cronjob to run the unattended-update

su
crontab -e
19 13 * * * /etc/cron.daily/apt > /home/vidyadhar/apt.log 2>&1

That’s it. The task will run at 1:19 PM every day.

Create Wifi Hotspot in Windows

This tutorial will guide you in setting up your laptop as a wifi-hotspot to share wifi or dial-up connection. I am using Windows 7 as a base OS and connectify to work as wifi-hotspot.

In this way you can share your internet / wifi / dial-up connection with your wifi enabled device.

Requirement:
OS Windows 7 (Not tried on XP)
WIFI enabled laptop
Connectify. You can download the free version from here.

1. To start the process download and install Connectify from above link.
2. After installation it will ask to reboot the machine, do the same.
3. After restart you will see Connectify icon in task bar notification area.

4. Click on the Icon. Now we need to create wifi-hostspot. Fill up require details as per your wifi configuration and click on Start Hostspot. For better understanding see below screenshot.

Remember Select the proper network adapter in Internet option. If you are getting connected to internet via dial up connection select dial up connection in Internet option. I am using wireless network connection to connect internet.

5. Now setup your wifi enabled device to use our laptop connection as an access point. I have tried the same with Nokia phone. After successful connection you will see your device in Client tab.

That’s it. Enjoy your new wifi-hotspot.

Page 10 of 46« First...«8910111213»203040...Last »
rss twitter facbook

Categories

Archives