Total Pageviews

Google Ads

Saturday, September 21, 2013

Linux Sensors

Q. How do I read CPU core temperature data from a shell prompt under Linux operating system? How do I monitor my cpu hardware?

A. You can use Linux hardware monitoring tool such as lm_sensor. This tool provides some essential tools for monitoring the hardware health of Linux systems containing hardware health monitoring hardware such as the LM78, and LM75.
This tool use the System Management Bus (SMBus or SMB), which is a simple two-wire bus, derived from I²C and used for communication with low-bandwidth devices on a motherboard, especially power related chips such as a laptop's rechargeable battery subsystem. Other devices might include temperature, fan, or voltage sensors; and lid switches. PCI add-in cards may connect to an SMBus segment.

Install lm_sensors / lm-sensors package

This package may or may not be installed. Type the following command to install software on CentOS / RHEL / Fedora Linux:
# yum install lm_sensors
If you are using Debian / Ubuntu Linux, enter:
$ sudo apt-get install lm-sensors

Configure lm_sensors

To detect hardware monitoring chips, type the following command as the root user:
# sensors-detect
OR
$ sudo sensors-detect
Sample output:
# sensors-detect revision 4609 (2007-07-14 09:28:39 -0700)
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.
We can start with probing for (PCI) I2C or SMBus adapters.
Do you want to probe now? (YES/no):
Probing for PCI bus adapters...
Use driver `i2c-i801' for device 0000:00:1f.3: Intel 82801G ICH7
We will now try to load each adapter module in turn.
Module `i2c-i801' already loaded.
If you have undetectable or unsupported adapters, you can have them
scanned by manually loading the modules before running this script.
To continue, we need module `i2c-dev' to be loaded.
Do you want to load `i2c-dev' now? (YES/no):
Module loaded successfully.
We are now going to do the I2C/SMBus adapter probings. Some chips may
be double detected; we choose the one with the highest confidence
value in that case.
If you found that the adapter hung after probing a certain address,
you can specify that address to remain unprobed.
Next adapter: saa7133[0] (i2c-0)
Do you want to scan it? (YES/no/selectively):
Client found at address 0x47
Handled by driver `ir-kbd-i2c' (already loaded), chip type `Pinnacle PCTV'
    (note: this is probably NOT a sensor chip!)
Client found at address 0x4b
Handled by driver `tuner' (already loaded), chip type `tda8290+75a'
    (note: this is probably NOT a sensor chip!)
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'...                                No
Next adapter: SMBus I801 adapter at 4000 (i2c-1)
Do you want to scan it? (YES/no/selectively):
Client found at address 0x2e
Probing for `Myson MTP008'...                               No
Probing for `National Semiconductor LM78'...                No
Probing for `National Semiconductor LM78-J'...              No
Probing for `National Semiconductor LM79'...                No
Probing for `National Semiconductor LM80'...                No
Probing for `National Semiconductor LM85 or LM96000'...     No
Probing for `Analog Devices ADM1027, ADT7460 or ADT7463'... No
Probing for `SMSC EMC6D100, EMC6D101 or EMC6D102'...        No
Probing for `Analog Devices ADT7462'...                     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 `Andigilog aSC7611'...                          No
Probing for `Andigilog aSC7621'...                          Success!
    (confidence 5, driver `to-be-written')
Probing for `National Semiconductor LM87'...                No
Probing for `National Semiconductor LM93'...                No
Probing for `Winbond W83781D'...                            No
Probing for `Winbond W83782D'...                            No
Probing for `Winbond W83792D'...                            No
Probing for `Winbond W83793R/G'...                          No
Probing for `Winbond W83791SD'...                           No
Probing for `Winbond W83627HF'...                           No
Probing for `Winbond W83627EHF'...                          No
Probing for `Winbond W83627DHG'...                          No
Probing for `Asus AS99127F (rev.1)'...                      No
Probing for `Asus AS99127F (rev.2)'...                      No
Probing for `Asus ASB100 Bach'...                           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 `Analog Devices ADM1024'...                     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 `ITE IT8712F'...                                No
Probing for `SMSC DME1737'...                               No
Probing for `Fintek F75373S/SG'...                          No
Probing for `Fintek F75375S/SP'...                          No
Probing for `Fintek F75387SG/RG'...                         No
Probing for `Winbond W83791D'...                            No
Client found at address 0x44
Probing for `Maxim MAX6633/MAX6634/MAX6635'...              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
Some chips are also 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):
Probing for `National Semiconductor LM78' at 0x290...       No
Probing for `National Semiconductor LM78-J' 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
Probing for `Silicon Integrated Systems SIS5595'...         No
Probing for `VIA VT82C686 Integrated Sensors'...            No
Probing for `VIA VT8231 Integrated Sensors'...              No
Probing for `IPMI BMC KCS' at 0xca0...                      No
Probing for `IPMI BMC SMIC' at 0xca8...                     No
Some Super I/O chips may also contain 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):
Probing for Super-I/O at 0x2e/0x2f
Trying family `National Semiconductor'...                   No
Trying family `SMSC'...                                     Yes
Found `SMSC LPC47M182 Super IO Fan Sensors'
    (but not activated)
Probing for Super-I/O at 0x4e/0x4f
Trying family `National Semiconductor'...                   No
Trying family `SMSC'...                                     No
Trying family `VIA/Winbond/Fintek'...                       No
Trying family `ITE'...                                      No
Some CPUs or memory controllers may also contain embedded sensors.
Do you want to scan for them? (YES/no):
AMD K8 thermal sensors...                                   No
Intel Core family thermal sensor...                         Success!
    (driver `coretemp')
Intel AMB FB-DIMM thermal sensor...                         No
Now follows a summary of the probes I have just done.
Just press ENTER to continue:
Driver `to-be-written' (should be inserted):
  Detects correctly:
  * Bus `SMBus I801 adapter at 4000'
    Busdriver `i2c-i801', I2C address 0x2e
    Chip `Andigilog aSC7621' (confidence: 5)
Driver `coretemp' (should be inserted):
  Detects correctly:
  * Chip `Intel Core family thermal sensor' (confidence: 9)
I will now generate the commands needed to load the required modules.
Just press ENTER to continue:
To make the sensors modules behave correctly, add these lines to
/etc/modules:
#----cut here----
# I2C adapter drivers
i2c-i801
# Chip drivers
# no driver for Andigilog aSC7621 yet
coretemp
#----cut here----
Do you want to add these lines to /etc/modules automatically? (yes/NO)
This is an interactive program that will walk you through the process of scanning your system for various hardware monitoring chips, or sensors, supported by libsensors, or more generally by the lm_sensors tool suite. For my system coretemp and i2c-i801 driver need to loaded in order to see sensors data. Type 'YES" to update /etc/modules files. Now you need to reboot the box. Alternatively, you can load all drivers using modprobe command
# modprobe coretemp
# modprobe i2c-i801

How do I read sensors chip data such as temperature?

Type the following command at shell prompt:
$ sensors
Sample output:
coretemp-isa-0000
Adapter: ISA adapter
Core 0:      +59°C  (high =  +100°C)
coretemp-isa-0001
Adapter: ISA adapter
Core 1:      +59°C  (high =  +100°C)
coretemp-isa-0002
Adapter: ISA adapter
Core 2:      +55°C  (high =  +100°C)
coretemp-isa-0003
Adapter: ISA adapter
Core 3:      +56°C  (high =  +100°C)
Here is another output from Intel xeon server box:
w83627hf-i2c-0-2d
Adapter: SMBus I801 adapter at 1100
VCore 1:   +4.08 V  (min =  +1.34 V, max =  +1.49 V)       ALARM
VCore 2:   +4.08 V  (min =  +1.34 V, max =  +1.49 V)       ALARM
+3.3V:     +4.08 V  (min =  +3.14 V, max =  +3.46 V)       ALARM
+5V:       +5.11 V  (min =  +4.73 V, max =  +5.24 V)
+12V:     +11.73 V  (min = +10.82 V, max = +13.19 V)
-12V:      +1.21 V  (min = -13.18 V, max = -10.88 V)       ALARM
-5V:       +2.24 V  (min =  -5.25 V, max =  -4.75 V)       ALARM
V5SB:      +5.51 V  (min =  +4.73 V, max =  +5.24 V)       ALARM
VBat:      +0.54 V  (min =  +2.40 V, max =  +3.60 V)       ALARM
fan1:        0 RPM  (min =    0 RPM, div = 2)
fan2:        0 RPM  (min = 2689 RPM, div = 2)              ALARM
fan3:        0 RPM  (min = 6553 RPM, div = 2)              ALARM
temp1:       -48°C  (high =    -1°C, hyst =   -25°C)   sensor = thermistor
temp2:     -48.0°C  (high =   +80°C, hyst =   +75°C)   sensor = thermistor
temp3:     -48.0°C  (high =   +80°C, hyst =   +75°C)   sensor = thermistor
vid:      +1.419 V  (VRM Version 11.0)
alarms:
beep_enable:
          Sound alarm enabled
w83627hf-isa-0290
Adapter: ISA adapter
VCore 1:   +4.08 V  (min =  +1.34 V, max =  +1.49 V)       ALARM
VCore 2:   +4.08 V  (min =  +1.34 V, max =  +1.49 V)       ALARM
+3.3V:     +4.08 V  (min =  +3.14 V, max =  +3.46 V)       ALARM
+5V:       +5.11 V  (min =  +4.73 V, max =  +5.24 V)
+12V:     +11.73 V  (min = +10.82 V, max = +13.19 V)
-12V:      +1.29 V  (min = -13.18 V, max = -10.88 V)       ALARM
-5V:       +2.24 V  (min =  -5.25 V, max =  -4.75 V)       ALARM
V5SB:      +5.48 V  (min =  +4.73 V, max =  +5.24 V)       ALARM
VBat:      +0.54 V  (min =  +2.40 V, max =  +3.60 V)       ALARM
fan1:        0 RPM  (min =    0 RPM, div = 2)
fan2:        0 RPM  (min = 2689 RPM, div = 2)              ALARM
fan3:        0 RPM  (min = 6553 RPM, div = 2)              ALARM
temp1:       -48°C  (high =    -1°C, hyst =   -25°C)   sensor = thermistor
temp2:     -48.0°C  (high =   +80°C, hyst =   +75°C)   sensor = thermistor
temp3:     -48.0°C  (high =   +80°C, hyst =   +75°C)   sensor = thermistor
vid:      +1.419 V  (VRM Version 11.0)
alarms:
beep_enable:
          Sound alarm enabled

Friday, September 20, 2013

ssh-add error Could not open a connection to your authentication agent

Follow

 cd path-to-Git/bin (for example,cd C:\Program Files\Git\bin)  
 bash  
 exec ssh-agent bash  
 ssh-add path/to/.ssh/id_rsa  
 git clone ssh://git@git-server:7999/OPEN/open-repo.git c:\git\123  



Thursday, September 19, 2013

Windows SSH keygen

Just created my key without any problem (Seven Ultimate 64bits, msysgit 1.6.5.1.1367.gcd48)
$ ssh-keygen -C "vonc@xxxx" -t rsa
Generating public/private rsa key pair.
Enter file in which to save the key (/c/Users/VonC/.ssh/id_rsa):# just press enter
                                                                # to accept the
                                                                # default location
Enter passphrase (empty for no passphrase):                     
Enter same passphrase again:
Your identification has been saved in /c/Users/VonC/.ssh/id_rsa.
Your public key has been saved in /c/Users/VonC/.ssh/id_rsa.pub.
The key fingerprint is:
xx:yy:zz:aa:bb:cc:... vonc@xxxx
With the result:
VonC@P ~/.ssh
$ ls -alrt
total 10
-rw-r--r--    1 VonC Administ      642 May 23 21:47 known_hosts
drwxr-xr-x   43 VonC Administ    16384 Jun 15 17:01 ..
-rw-r--r--    1 VonC Administ      398 Jun 19 16:14 id_rsa.pub
-rw-r--r--    1 VonC Administ     1675 Jun 19 16:14 id_rsa
drwxr-xr-x    2 VonC Administ        0 Jun 19 16:14 .
Could you check in your bash session what value your $HOME environment variable is set?
VonC@P ~/.ssh
$ env|grep HOME
HOMEPATH=\Users\VonC
HOME=/c/Users/VonC     # <=== this must be correctly set
HOMEDRIVE=C:

Sunday, September 15, 2013

Ubuntu 13.04 tweak

Things/Tweaks to do after Install of Ubuntu 13.04 Raring Ringtail

Ubuntu 13.04 Raring Ringtail has been released, Ubuntu team has done really good job on 13.04. This Ubuntu release is much better than last release. Unity is much faster, responsive and a lot of things is better in 13.04. So after a-lot of work today bring this article for you. After applying these tweaks you can get more better experience with new Ubuntu. After these tweaks we can say your Ubuntu is ready to use, Every tweak is tested by NoobsLab. So lets start tweak to your Ubuntu 13.04.


1: Tweak Tools:
Gnome Tweak Tool is well-known powerful tweak tool, With this tool you can manage your Ubuntu environment like: Change theme, icons, fonts, cursor and so on options.
Unity Tweak Tool is a configuration tool for the Unity Desktop, providing users access to features and configuration options not (obviously) accessible, and brings them all together in a polished & easy-to-use interface.
Install Tweak Tools with following commands:




Also Checkout Ubuntu Tweak


2: Synaptic and Compiz (CCSM) with extra plugins:
Synaptic is a graphical package management program for apt. It provides the same features as the apt-get command line utility with a GUI front-end based on Gtk+.
CCSM, short for CompizConfig Settings Manager, is a configuration tool for Compiz Fusion. It is used to configure the many plugins included in Compiz and Compiz Fusion, as well as the use of various profiles and intergrating better with existing desktop settings.
To install Compiz Config Setting Manager enter following command in Terminal:




Go to Dash and Search "CCSM" or "synaptic"


3: Enable Hibernate option:
Ubuntu has disabled hibernate option, So here is tweak to enable hibernate.
Open Terminal and enter following command:



copy and paste the following code in file:
[Re-enable Hibernate]
Identity=unix-user:*
Action=org.freedesktop.upower.hibernate
ResultActive=yes
Save file and Exit, then Restart and check.


4: Remove White Dots from Login Screen
If you want to remove white dots from login screen of Ubuntu 13.04, So here is a easy tweak for you.
Enter following commands in Terminal:







5: Disable Guest Account:
Guest account is enable by default in Ubuntu, It means anybody can login with guest account in your Ubuntu. So here is tweak to disable guest account.
Open Terminal and enter following command to open file in text editor:



Now add the following line at the end of file.
allow-guest=false
If you want to disable Remote Login, Then add following line at the end of file.
greeter-show-remote-login=false
Save and close file, Now Restart to see effect.


6: Improve Unity Performance, Remove Online Search Lenses:
If you don't like online search in Unity, You can disable it from Settings -> Privacy then Turn off online search.
Alternatively you can remove online search lenses from Unity, Following commands will remove Shopping, Music, Photos, Gwibber and Video lenses and make Unity much responsive:








You will not see anymore online searches in dash.

Unity Record your activity, You can adjust your privacy by enable/disable these features.


7: Disable overlay Scrollbars:
You can disable overlay scrollbars, if you don't like that.
Enter following command in terminal to disable overlay scrollbar:




If you want to get back overlay bar, enter following command:





8: Show username on panel:
UserName is disabled by default in Ubuntu, So here is tweak you can enable it very easily.
Enter following command in terminal:




To remove name from panel, Enter following command:





9: Disable System Crash Reports:
If you are experiencing something crashes in your Ubuntu, and you don't like to be notify with reports. You can disable them easily.
Enter following commands to disable crash reports:



Now text file will open, In the last line you will see "enabled=1" change it to "enabled=0". Save and close file.
Now enter following command in terminal to stop apport service:





10: Firewall for Ubuntu:
Linux don't need Anti-virus but Firewall is important for any kind of Operating System. UFW is installed by default in Ubuntu but it is command line and disable by default. You can install best firewall GUFW enable and manage it graphically.
Enter following command in terminal to install firewall:



After installation open Dash and Search "GUFW" to configure it.


11: Install Hardware Temperature Monitor:
The Psensor Indicator is providing a quick access to sensor values and settings. When a sensor temperature is too much hot, a desktop notification bubble appears and the Application Indicator icon is changed to a red. Your pc must have sensors to use complete features.
ubuntu temperature
Enter following command in terminal:





12: Move Minimize, Maximize, Close Buttons to Right:
If you are used to use these buttons on right side then this tweak is useful for you. You can move Minimize, Maximize, and Close buttons to the right side.
Enter following command to move buttons to right:





13: Open as Administrator Entry in Right Click Menu
This is really cool tweak for those who want to open file and folder with Administrator privileges, So now it is really easy to do.
Install from here


14: Enable Hardware Drivers:
Ubuntu works perfect with latest hardware, It is better to use drivers offered by Ubuntu. You can choose best drivers for your hardware from additional driver and can enable/disable from there easily.
Open Dash and Search for "Software & Updates" Here you can find "Additional Drivers" in the last Tab.


15: Install Adobe Flash Plugin:
By default firefox doesn't install flash player, So now you can install flash player.
ubuntu flash
Open Terminal and enter following commands:





16: Install qBittorrent:
The qBittorrent project aims to provide a Free Software alternative to µtorrent. An advanced and multi-platform BitTorrent client with a nice Qt4 user interface as well as a Web UI for remote control and an integrated search engine. qBittorrent aims to meet the needs of most users while using as little CPU and memory as possible.
Enter following command to install qBittorrent:





17: Install Plugins for Rhythmbox (Like Equalizer):
Rhythmbox is default Audio player in Ubuntu 13.04, You can install plugins for rhytmbox. Plugins are: Audio-read, Album-art-search, Countdown-playlist, plugin-cover-art-browser, Equalizer, Jump-to-Playing, Jump-to-Window, lyrics, micro-blogger, open-containing-foler, radio-browser, Random-album-player, Remember-the-rhythm, repeat-one-song, rhythm-web, send-first, small-window, stop-after, suspend, tab-guitar, tray-icon, web-menu, stream-ripper
Enter following commands to install plugins.





After installation open Rhythmbox and Go to "Edit" -> "Plugins" and enable plugins.


18: Install Restricted Extras:
There are some Restricted extras in Ubuntu which can't be install while installation of Ubuntu by default but you can install these Restricted extras by yourself. Restricted mp3 playback and decoding, support for various formats, fonts, java, flash plugin, lame, dvd playback.





19: Install Codecs and Enable DVD Playback:
If you are multimedia user and use Ubuntu for multimedia then these codecs are very useful for you. You can install them by single command.





Following command for Enable DVD Playback:





20: Install Compression/Decompression tools:
You can compress and decompress 7z, zip, gzip, rar, xz, tar, bz2, xar, tar.gz, tar.bz, and many others.
Enter following command in terminal to install:






21: To Reset Unity:
>> to reset the Unity:








22: Misc/Softwares for Ubuntu 13.04 Raring Ringtail:
Google Chrome
Skype
WineHQ (Windows Program Loader)
Install and Configure Samba Sharing between Windows and Ubuntu
Latest Nvidia Drivers (Only for those who own Nvidia Card)
Media Players: VLCXnoiseUMPlayer
File Managers SunFlower Twin-Panel
Checkout Conky Collection
Checkout Themes Collection
Checkout Icons Collection
Checkout Panel Indicator Collection

That's it.

Monday, September 9, 2013

The thumbnail too slow with ffmpeg

I have a project with video Encode in this month. I have a trouble with respone of ffmpeg thumbnail too long. But I have fixed it today. Now. I will show the problem.

The command I used :
ffmpeg -itsoffset -40 -i BG.mp4 -vframes 1 output.jpg
See in this command. It's will take a snapshoot at frame 40 from the start frame. And by this way, you have to wait for ffmpeg seek to the frame's Index 40. That's find. But thinking about offset 100,000 or more?. I see it's take long time.
You can this command for "little exactly" but much faster.
ffmpeg -ss 00:00:50 -i BG.mp4 -vframes 1 output.jpg
the ss parameter is time seek of video. That's make thumbnail much faster than seek by frame. You can calculate the -ss parameter by:
ssTimeInSec = FrameOffset / FramePerSecond
I write a PHP code to translate TimeInSec to time in -ss parameter.

 function translateSecToString($sec){  
  $sec = intval($sec);  
  $h = intval($sec / 3600);  
  $m = intval(($sec - ($h * 3600))/60);  
  $s = $sec - ($h * 3600) - ($m * 60);  
  if($h < 10){$h = '0'.$h;}  
  if($m < 10){$m = '0'.$m;}  
  if($s < 10){$s = '0'.$s;}  
  return $h.':'.$m.':'.$s;  
 }  

Hope it can help :D

Tuesday, September 3, 2013

install mediainfo and imagemagic - Centos

2. sudo rpm -ivh libzen0-0.4.26-1.x86_64.CentOS_6.rpm
sudo rpm -ivh libmediainfo0-0.7.56-1.x86_64.CentOS_6.rpm
sudo rpm -ivh mediainfo-0.7.56-1.x86_64.CentOS_6.rpm
3. MediaInfo [-Options...] FileName1 [Filename2...]
mediainfo "01 Rival State – Sleep Talker.wav"
Format : PCM
Channel(s) : 2 channels
Sampling rate : 44.1 KHz
Bit depth : 24 bits
1. tar -xvzf jpegsrc.v8b.tar.gz
cd jpeg-8b/
./configure
make
sudo make install
2. tar -xvzf libpng-1.5.10.tar.gz
cd libpng-1.5.10
./configure
make
sudo make install
3. tar -xvzf tiff-4.0.1.tar.gz
cd tiff-4.0.1
./configure
make
sudo make install
4. tar -xvzf ImageMagick-6.7.6-7.tar.gz
cd ImageMagick-6.7.6-7
./configure
make
sudo make install
5. fix jpeg library version problem (library is 62, caller expects 80)
5.1. cd /usr/lib64
ls -la | grep jpeg
found jpeg 62
5.2 cd /usr/local/lib
ls -la | grep jpeg
found jpeg 80
5.3 cd /usr/lib64
sudo rm -rf libjpeg.so.*
sudo ln -s /usr/local/lib/libjpeg.so.8.0.2 libjpeg.so.62
5.4 remove
rpm -qa | grep libjpeg
sudo rpm -e –nodeps libjpeg-6b-46.el6.x86_64 libjpeg-devel-6b-46.el6.x86_64
6. which convert
convert [options ...] file [ [options ...] file …] [options ...] file