How to Mount NTFS and exFAT Partition in RHEL CentOS

Mounting NTFS 

Mounting NTFS partition in CentOS/RHEL will need a simple trick. Here is the step.

$] sudo yum install epel-release

$] sudo yum install ntfs-3g

Suppose if the name of the device is /dev/sda3 and /dev/sda4, then here is the command to mount it from the terminal

$] sudo mkdir /mnt/WinE

$] sudo mkdir /mnt/WinD

$] sudo mount -t ntfs-3g /dev/sda3 /mnt/WinE 

$] sudo mount -t ntfs-3g /dev/sda4 /mnt/WinD

If your windows OS is running with any updates or under hibernation, the above command will not work, Here is the solution for that. You can open the drives under read only mode.

NTFS
nfts
if you get the error like shown above, here is the command 

$] sudo mount -t ntfs-3g /dev/sda3 /mnt/WinE -ro o

$] sudo mount -t ntfs-3g /dev/sda4 /mnt/WinD -ro o

NB: Sometimes you need not type “-t ntfs-3g”, if the libraries are there, without this attribute also, the disk will be mounted.

 

Mounting exFAT file system

exFAT is another filesystem supported by the Unix families like (Mac OS). CentOS has a way to 
customise for mounting the exfat filesystem.

$] sudo yum install scons gcc fuse-devel rpmbuild
$] wget http://download1.rpmfusion.org/free/el/updates/6/SRPMS/exfat-utils-1.0.1-1.el6.src.rpm 
$] wget http://download1.rpmfusion.org/free/el/updates/6/SRPMS/fuse-exfat-1.0.1-1.el6.src.rpm 

$] rpm -ivh fuse-exfat-1.0.1-1.el6.src.rpm exfat-utils-1.0.1-1.el6.src.rpm 

$] cd ./rpmbuild/SPECS 
$] rpmbuild -ba fuse-exfat.spec 
$] rpmbuild -ba exfat-utils.spec 

$] cd ../RPMS/x86_64/ 
$] rpm -ivh fuse-exfat-1.0.1-1.el6.x86_64.rpm exfat-utils-1.0.1-1.el6.x86_64.rpm 

The following is optional.
$] ln -s /usr/sbin/mount.exfat /sbin/mount.exfat

Again you can click the icon in the explorer to mount the exFAT partition, in the terminal

$] sudo mount -t exfat /dev/sdb2 /mnt/WinC

vokoscreen – A screen recorder for Linux

There are many screen recorders available for Windows and Mac. But over these years, getting a screen recorder for Linux is always a challenge.  There have been some screen recorders like recordmydesktop, gtk-recordmydesktop, qt-recordmydeskop. They are not user friendly and not suitable for productive recordings.

So, there should be some alternatives to control the video, audio, web camera, etc. Two such tools are available.

Here is the step to do that

$] sudo add-apt-repository ppa:vokoscreen-dev/vokoscreen-daily

$] sudo apt-get update

$] sudo apt-get install vokoscreen

But in the latest version of Ubuntu (16.04), it can given directly as

$] sudo apt install vokoscreen

Once installed, its very easy to use as shown in the following figures

vokoscreeen
vokoscreeen Video configuration
vokoscreeen
vokoscreeen Audio control
vokoscreeen
vokoscreeen Webcamera control
vokoscreeen
vokoscreeen

 

Access ext2 ext3 and ext4 filesystems in windows

Dual boot with Windows and Linux leads to the access of files in other Operating Systems. Viewing a windows partition on a Linux OS is not a big task. One can simply mount the OS and can see the files of windows within Linux.

But accessing Linux EXT2, EXT3 and EXT4 files within Windows can be done only through an external software.

EXt2FSD is a software that does this job. you can download the software from this link 

Once installed, its as easy as possible to “assign a drive letter ” to the partition.  Figure below shows that.

Ext2FSD
Ext2FSD
Ext2FSD
Ext2FSD

Its just a simple process to access the linux files within windows. This is really helpful for the machines with UEFI partition. When Linux Boot loader is deleted, this will help to retrieve the files.

Any other info, please comment below.

 

Big Blue Button – a Virtual Classroom Software

This article appears in “Open Source For You” Magazine in June 2015 Edition. Its a simple and easy tryout. If you are a startup and cannot afford for software cost, here you go, its completely free. 
There are some links to images which you cannot see, if you want to see those images, please purchase it online http://electronicsforu.com/electronicsforu/subscription/subsc2scheme.asp
BigBlueButton
BigBlueButton
 

Introduction

BigBlueButton is a Voice Over IP (VOIP) based web conferencing software. This tool is helpful for remote learning, virtual classrooms, distance education, online learning, etc. Some of the features of BigBlueButton includes
  • Record and Playback the entire session
  • Whiteboard for lectures (Similar to a black board in a classroom)
  • Desktop Sharing
  • Integrated VOIP for listening and speaking
  • Presentation (Any pdf or presentation file can be uploaded for teaching)
  • Webcam can be shared between the users
  • Private and group chat (In case the teacher can chat with a student or the students and teachers can chat within a group)
This tool is completely open source and API is provided for deploying in local server. Also there is a developer version available for continuous development of the software.
BigBlueButton divides into three windows within a browser, the left side window shows the list of users joined during the session, the web camera control, audio, video control, etc. The middle window shows the whiteboard wherein the teacher can write, scribble, type, draw, etc to broadcast it to all the listeners and the right side window is a chat window in which all the users chat as a group or individually they can chat with the teacher or other users.

Installation of BigBlueButton in Ubuntu

BigBlueButton currently released the 0.9.0 version that can installed mainly on a Ubuntu 14.04 OS that is released with Long Term Support (LTS). Here are the recommendations before installing in a server.
Operating System Ubuntu 14.04 – 64 bit
RAM Minimum of 4GB, but 8GB preferred
CPU A decent Quad Core CPU
Ports to be unlocked 80, 1925,9123 (TCP Ports), 16384-32768 (UDP)
Space requirements 500GB for recording and storage
Bandwidth 100Mbps
Server Can be a Bare metal rather than a Virtual machine
Table 1: prerequisites for BigBlueButton server
Installation of BigBlueButton in a server is a long process that consumes around 500MB of software to be downloaded and takes around 2 to 3 hours to complete.
Before installing the software, the following things have to be checked
  • Locale should be UTF-8
  • Check it using the command
—————————-CODE—————————–
$ cat /etc/default/locale

LANG=en_US.UTF-8

LANGUAGE="en_IN:en"

if not, then install the packages,

$ sudo apt-get install language-pack-en

$ sudo update-locale LANG=en_US.UTF-8

Check the version of Ubuntu

$ cat /etc/lsb_release

DISTRIB_ID=Ubuntu

DISTRIB_RELEASE=14.04

DISTRIB_CODENAME=trusty

DISTRIB_DESCRIPTION="Ubuntu 14.04.2 LTS"
—————————-CODE—————————–
Once the checks are over, here is the installation of BigBlueButton
Server Update
Check trusty multiverse is there in the sources.list, if not add the following
—————————-CODE—————————–
$ grep “multiverse” /etc/apt/sources.list
—————————-CODE—————————–
The output should have
—————————-CODE—————————–
deb http://in.archive.ubuntu.com/ubuntu/ trusty multiverse

if the above line is not there, you can add the following command

$ echo "deb http://us.archive.ubuntu.com/ubuntu/ trusty multiverse" | sudo tee -a /etc/apt/sources.list
—————————-CODE—————————–
Now update the server before proceeding to the next step, here is the command
—————————-CODE—————————–
$ sudo apt-get update

$ sudo apt-get dist-upgrade
—————————-CODE—————————–
Once the upgrading is over, restart the OS and now to install the LibreOffice. Ubuntu comes with LibreOffice 4.2.7 and BigBlueButton uses LibreOffice 4.3 for document conversion, so the PPA for LibreOffice 4.3 version have to be added.
—————————-CODE—————————–
$ sudo apt-get install software-properties-common

$ sudo add-apt-repository ppa:libreoffice/libreoffice-4-3
—————————-CODE————————–

Installation of Key of BigBlueButton

The local machine need to access the BigBlueButton server, so the key have to be installed. Here is the command for installing the key.
—————————CODE—————————–
$ wget http://ubuntu.bigbluebutton.org/bigbluebutton.asc -O- | sudo apt-key add -

$ echo "deb http://ubuntu.bigbluebutton.org/trusty-090/ bigbluebutton-trusty main" | sudo tee /etc/apt/sources.list.d/bigbluebutton.list

$ sudo apt-get update
—————————-CODE————————–
Install ffmpeg
ffmpeg is a software that needs to be installed since it creates the playback components like audio, video, presentation, desktop sharing, etc.  This tool needs other dependencies also, so a group of tools have to be installed. Also there are some customisation in the OS. So the entire code is pasted in a shell script and the script runs the command one by one.
Simply copy paste the following code in to a ffmpeg_install.sh file
----------------------------CODE-----------------------------

sudo apt-get install build-essential git-core checkinstall yasm texi2html libvorbis-dev libx11-dev libvpx-dev libxfixes-dev zlib1g-dev pkg-config netcat libncurses5-dev

FFMPEG_VERSION=2.3.3

cd /usr/local/src

if [ ! -d "/usr/local/src/ffmpeg-${FFMPEG_VERSION}" ]; then

sudo wget "http://ffmpeg.org/releases/ffmpeg-${FFMPEG_VERSION}.tar.bz2"

sudo tar -xjf "ffmpeg-${FFMPEG_VERSION}.tar.bz2"

fi

cd "ffmpeg-${FFMPEG_VERSION}"

sudo ./configure --enable-version3 --enable-postproc --enable-libvorbis --enable-libvpx

sudo make

sudo checkinstall --pkgname=ffmpeg --pkgversion="5:${FFMPEG_VERSION}" --backup=no --deldoc=yes --default
—————————-CODE—————————–
and run the file using
$ sh ffmpeg_install.sh
(This process will take almost more than an hour to install ffmpeg and it adds some modules into the kernel to support the audio, video, etc.
Install BigBlueButton
Finally install the BigBlueButton software using the following command   
$ sudo apt-get install bigbluebutton
The above command will install the entire library of softwares with all the necessary dependencies, and this will download as many as 400MB of software from the Server. Figure 1 shows the installation of BigBlueButton
Installation of Demo Software
If you want to see the demo of how BigBlueButton is used, you can install the software using the command
$ sudo apt-get install bbb-demo

If you want to remove, then use the following commands

$ sudo apt-get purge bbb-demo
Other Settings
To enable the WebRTC (Audio) for the Server, the following command can be used
$ sudo bbb-conf --enablewebrtc
To make a clean restart of BigBlueButton Server, you can use the following commands
$ sudo bbb-conf --clean

$ sudo bbb-conf --check
–clean will clear all the log files of bigbluebutton and –check will search through and find any errors. See the Figure 2 for the –check command. The IP address allocated to my server is 172.16.50.247 (its a local IP). To check the status of my server, you can see the Figure 3.
Once the demo server is opened, just distribute the IP addresses and the users can connected to the IP and they can join the session. During the first time, the browser checks for devices like Microphone, Speaker and Web camera. The users are having the option of joining the session only as a listener or both listener and a speaker. In case, the user need not allow the browser to access the device.
Integrating with MOODLE (A Case Study)
MOODLE is a open Source Learning Management System (LMS) that comes with various plugins for additional functionalities. BigBlueButton also has two plugins RecordingsBN and BigBlueButtonBN
BigBlueButtonBN
This is to integrate MOODLE and BigBlueButton so that a teacher can create an activity within MOODLE and the students can join themselves in the session. The teacher have the entire control of the session. The students can join the session, only after the teacher joins the session. Also the session can be recorded by the teacher and may be used for later use.
This plugin accepts two inputs URL and a Secret Key (This setting will be set by the administrator of MOODLE). The teachers and the students need not have any control over this setting. The secret can be obtained using
$ sudo bbb-conf –secret
  Secret: 1c5d8b004826c6edcbe19fxxxxxxxxxx
Both the above parameters have to be set as shown in the figure 4
Figure 4 – MOODLE Integration
Figure 5 – Full demonstration of BigBlueButton
Figure 5 shows the demonstration of a lecture on a white board wherein a teacher is typing an information and there are two other users in the session listening. The users are viewing the video of the teacher and they can send messages to the teacher through the window provided in the right side column.
Conclusion
Using these open source tools MOODLE and BigBlueButton, huge amount of money can be saved in learning and colleges/universities across the country come forward to motivate students and faculty members to learn/use open source tools for their learning.
Useful (Reference) Links:
To download MOODLE : http://moodle.org
Edit: Now recently Big Blue Button added a new functionality called “Poll”, in which a speaker can ask for a question and answered by the listeners anonymously and the poll can be shared instantly to the viewers.
See the screen shot here
Big Blue Button
Big Blue Button
Big Blue Button
Big Blue Button

Moodle and Big Blue Button

MOODLE is one of the best Learning Management system and BigBlueButton is the best Virtual classroom software. How they are related to each other. If you want to have a virtual classroom session with your students, here is the step for that

  1. A teacher can create a login with http://www.moodlecloud.com and you can use MOODLE right from there. the free version of moodlecloud.com offers 200 mb of storage space with 50 users. the advantage is its comes with Big Blue Button also wherein BBB shares their cloud space for the Virtual classroom session.

2. If you want to know more about BBB (Big Blue Button) , please refer the following slide

 

Using Index of in Google Search

If you want to download a movie directly using Google without bothering the torrent. As torrent is blocked in most of the countries, here is a tip to download anything from google directly.

Open http://www.google.com and input the following text (without quotes)

+”index of” “MovieName”  Year

Example +”index of” “Kung Fu Panda” 2016

Here is the output

Indexof
Index of

 

Here is the second link from the above image is clicked.

Download Movie
Download Movie

From one of the four links, the movie can be downloaded easily.

Enabling Telnet and SSH in Mac OS X

Enable Telnet

This post shows how to enable Telnet and SSH in Mac OS X.

To Enable Telnet, issue the following command (Open the Terminal and issue)

$] sudo launchctl load -w /System/Library/LaunchDaemons/telnet.plist

This will enable Telnet, and to check its working, try this

$] telnet localhost

To disable Telnet, issue the following command

$] sudo launchctl unload -w /System/Library/LaunchDaemons/telnet.plist

Enable SSH

To enable SSH, in the Mac OS X,

Open System Preferences -> Sharing -> Remote Login (Put the Tick Mark)

 

Once enabled, these machines can be connected remotely using their IP Addresses. Both these things works only when the port 22 and 23 are unblocked by the firewall

To check Telnet is working or not

$] telnet localhost

supply the username and password (you are connected..)

Virtual Host in Bitnami Lampstack

IF you have a website that runs with an IP address and you decide to move it to a domain, then here is the clear step.  Also this post will be helpful to you if you are running a same website by two different IP Address (One in campus and another outside the campus)

Prerequisites:

Your IP Address (Example): 172.16.1.10/site (Internal IP)

Your IP Address (Example): 28.45.34.101/site (External IP)

You want to move it to: example.com (instead of example.com/site)

Step 1:

Open the file /opt/lampstack-5.5.31-0/apache/conf/bitnami/bitnami.conf

In the above file, Change these lines  (The bold lines are the changed ones)

<VirtualHost _default_:80>
DocumentRoot “/opt/lampstack-5.5.31-0/apache2/htdocs/site”
<Directory “/opt/lampstack-5.5.31-0/apache2/htdocs”>
Options Indexes FollowSymLinks
AllowOverride All
<IfVersion < 2.3 >
Order allow,deny
Allow from all
</IfVersion>
<IfVersion >= 2.3 >
Require all granted
</IfVersion>
</Directory>

to

<VirtualHost _default_:80>
DocumentRoot “/opt/lampstack-5.5.31-0/apache2/htdocs/site
ServerName example.com
<Directory “/opt/lampstack-5.5.31-0/apache2/htdocs”>
Options Indexes FollowSymLinks
AllowOverride All
<IfVersion < 2.3 >
Order allow,deny
Allow from all
</IfVersion>
<IfVersion >= 2.3 >
Require all granted
</IfVersion>
</Directory>

Step 2: (Optional)

Open the file using sudo, /etc/hosts and include your IP with the domain name

GNU nano 2.2.6 File: /etc/hosts

127.0.0.1 localhost
127.0.1.1 administrator
172.16.1.10 example.com

28.45.34.101 example.com
# The following lines are desirable for IPv6 capable hosts
::1 ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters

Once done, restart apache server or the bitnami server by issuing this command

$/opt/lampstack-5.5.31-0] ./ctlscript restart 

And now check example.com in the browser, you have done…..

If you manage apache server manually (Other than using bitnami lampstack), then you can edit the httpd-vhosts.conf file with the above steps.

 

Realtek audio Hanging in Bootcamp–solved

If you own a MacBook Air or MacBook Pro, then some of you may experience this problem when you install windows 7 or 8.x or 10.

Realtek Audio will hang and the installation will never complete

A small workaround. Whenever it hangs, open the task manager (ctl + alt + delete) and click “more tasks” and End the task “Realtek setup 32bit”. Once the task ended, the installation will continue as usual and bootcamp installs successfully.

Merge VOB files in Linux

Assuming that you have purchased a DVD of a movie and trying to copy it to the hard disk. It is annoying to see individual vob files like VTS_01_1.vob, etc.  If there are multiple vob files, you can merge in to a single file using the cat command in linux/Unix/Mac OS

It is easy to handle and in no time, the conversion can happen.

Here is the command

$] cat VTS_01_1.vob VTS_01_2.vob > FullMovie.vob

the above command concatenate two vob files and merge it into a file called FullMovie.vob

This method had advantages whenever you like to see the movie with subtitles. Assuming that the subtitle is downloaded and you cannot see the full movie with sub title running for all the individual VOB files. So in that context, this method is very helpful.

Refer the images shows the conversion.

Merge Vob files
merge VOB files
merge VOB files
merge VOB files

Ubuntu Drivers for Macbook and Macmini

\nstalling Linux along with windows within Macbook or Macmini is quite time consuming and cumbersome. If you get all the three OS installed, Windows has a support from Apple BootCamp but Linux it has to be customized our own way. Here is a small help that can help you to install the Linux drivers for Mac Machines (The system under test is Mac Mini Late 2012) model.

OS Tested: Yosemite, Windows 8.1, Linux Mint 17.2

For installing all the the three OS as mentioned above, please refer the following link

http://www.nsnam.com/2014/12/installing-windows-linux-and-yosemite.html

Once installed, all the three OS, Open Linux Mint and check for Internet  (Drivers were absent or not installed, so it is necessary to install the drivers)

Now a days getting a ethernet based network is so tough and one cannot rely on it.

So, the preferred method can be USB tethering or 3G or 2G networks. USB tethering does well as you are already connected with a wifi network in your phone and that can be inserted in the usb port of mac mini. Ubuntu or linux mint detects the internet through the USB tethering mode.

Linux Mint detects that and thats it the network is in place. Open the terminal and give the command

$ sudo apt-get update

Once done, press command key and search for driver or device (You will get a option like Device Drivers) and open it with super user (The system asks for the password of super user). Refer the picture given below.

Mint in Mac

It shows the broadcom driver and have to be installed. Select the driver and apply changes and its done. Will take sometime to download the driver and Thats it!!!. The installation is done.

NS-2.35 (ns2) installation in various Linux distros

There are so many flavors of linux and so many distros. Installing a particular software in each one of these linux needs knowledge on the package management and other basic settings related to the software source.
NS2 also has similar issues when it is installed on different platforms or distributions.
This post will let you know how to install ns-2.35 in various distributions.

Most of the posts of the following are linked with http://www.nsnam.com

Recommendations:

  • Use always the Long Term Support (LTS) operating systems, if you are using Ubuntu or Linux Mint. Ex. Ubuntu 12.04, 14.04. These LTS has a support of upto 5 years. Ubuntu 12.04 has support of upto 2017 and 14.04 has the support of upto 2019.
  • If you are a beginner, better to use Ubuntu or Linux Mint , which is a user friendly Linux OS.
  • Linux Mint is doing well these days, so everyone can prefer Linux Mint as the OS, as it comes with all the audio, video codecs, support for all development and it uses the synaptic package manager of Ubuntu, so whatever support you get in Ubuntu, you can get it in Linux Mint also.
  • If you have worked with Red Hat Linux or Red Hat Enterprise Linux, then you may try Fedora as one option.
mint ns2
Linux Mint NS2 

To install in Ubuntu 11.04 and later (Also Linux Mint 14, 15, 16, 17 any of the versions.), you can refer the following link
http://www.nsnam.com/2011/11/ns2-ns-235-installation-in-ubuntu-1110.html

ubuntu ns2
Ubuntu ns2

To install in Fedora 18, follow this link
http://www.nsnam.com/2013/03/installing-ns-235-network-simulator-2.html

To install in Fedora 19,
http://www.nsnam.com/2013/09/installing-network-simulator-2-ns-2-35-in-fedora-19.html`

fedora ns2
Fedora ns2

To install in Fedora 20,
http://www.nsnam.com/2014/01/installing-ns-235-in-fedora-20-64-bit.html

For any other queries related to ns2, you can refer the http://www.nsnam.com

Pradeep Kumar TS

How to take Screenshot in OS X (Mac)

There are different methods for taking a screenshot in windows and Linux OS. But macintosh machines with  OS X has an inbuilt mechanism where in one can take a screenshot.
Depending on the keyboard used, the keystrokes may vary.

Screenshot of entire screen
If you are using Apple Keyboard the combination is Command+Shift+3 keys together pressed and released. Once the keys are released, the screenshot will be stored in the desktop itself.
If you are using Conventional Keyboard for Macs (Ex: For Mac mini, etc), the key combination is

Window  Key+Shift+3 
(See the screenshot below)

Screenshot in Mac (OS X)
Screenshot in Mac (OS X)


Screenshot of a particular Area
To take the screenshot of a particular area, then you can use Command+shift+4 keys pressed and released. Once released, you will get a + symbol with x and y location. Simply drag the area you want to take a screenshot and release it. Thats it!!!. See the screenshot taken using this method.

screenshot in mac using Command+shift+4
Screenshot in mac before taking a Command+shift+4

Also, there are other methods like storing the image to a clipboard and later can be used inside the document processing applications.  Also there is a provision for storing the screenshot files in an user specified location rather than on the Desktop.

If you want to record your screen, Mac OS X has the method using Quick Time player. There may not be any need for desktop recording application, the quick time player will do that. But if you need a complete customization pack, then you may think of any such app.

Pradeep Kumar TS

How to open Ports in CentOS

CentOS is the most preferred alternative OS for RHEL. Those who cannot afford to purchase the support license of RHEL, they can use CentOS that comes with almost similar to RHEL.

This post tells you about the usage of CentOS when web servers are installed and accessed from remote machines.

CentOS is a Server based OS and most of the ports are closed by default and you need to open it for access from outside (remote).
For ex. if wordpress is installed in CentOS with a hostname http://127.0.0.1/wordpress  which is very well accessed within the server. When the same is tried from outside like (http://192.168.54.3/wordpress), then it will not get accessed.
The problem is the closure of ports in CentOS. So you need to open it and save it to iptables, here are the commands that will help you to do that.

CentOS
CentOS

Port number : 80 is used here

$prompt] ifconfig (find out which interface uses the assigned ip, eth1, eth0, etc)
$prompt] iptables –line -vnL
(See which line the input has to be accepted and in my case it is 6) and give the following command
$prompt] iptables -I INPUT 6 -i eth1 -p tcp –dport 80 -m state –state NEW,ESTABLISHED -j ACCEPT
$prompt] service iptables save (Save and restart the IP Tables)
$prompt] service iptables restart

Thats all!!!! I solved this problem, when I installed MOODLE in my Blade server with Cent OS installed.

Pradeep Kumar TS

Simple Screen Recorder for Linux

Recording the screen in Linux OS is always a tedious task, as either the video/audio malfunctions or support may not be there. There is a tools called simple screen recorder for Linux.
Its a very simple tool that is recorded and processed in no time. For example, if you record an 1 hour video, the processing may take another 20 to 50 minutes. But this software does the “On the fly recording and processing”
This software has a straight forward interface and its incomparable to other softwares in the market.
  • Its faster than VLC
  • It never takes more amount of RAM like VLC do.
  • Its multithreaded, if you have more than one core, then the processing happens at all the cores.
  • it can do live streaming also, but it is under experimental setting.
  • it supports many different codecs.
Here is the simple screenshot.
Simple Screen Recorder
Simple Screen Recorder
A 42 minute video is recorded using this software and it takes just 42minute only. no extra time for processing. Please see the youtube video attached below.
See the above video taken using SSR and its about SSR. To download this software follow this URL
For any doubts, just ping me throught the comment form

Pradeep Kumar TS

time command in Linux

The time command is linux is very much useful if you want to know the time information while running a program or a process.
The time command usage is as follows

prompt $] time <commandname>
Example
prompt $] time ls
The output will be
real 0m0.002s
user 0m0.004s
sys 0m0.000s

If you want to see the detailed system parameters occupied during a program or process, then the command will be
prompt$] TIMEFORMAT=”” time -v <commandname>
See the screenshot given below

The output of the above command is
Desktop  Documents  Downloads  examples.desktop  Music Pictures  Public  Templates  Videos
Command being timed: “ls”
User time (seconds): 0.00
System time (seconds): 0.00
Percent of CPU this job got: 400%
Elapsed (wall clock) time (h:mm:ss or m:ss): 0:00.00
Average shared text size (kbytes): 0
Average unshared data size (kbytes): 0
Average stack size (kbytes): 0
Average total size (kbytes): 0
Maximum resident set size (kbytes): 3600
Average resident set size (kbytes): 0
Major (requiring I/O) page faults: 0
Minor (reclaiming a frame) page faults: 286
Voluntary context switches: 1
Involuntary context switches: 0
Swaps: 0
File system inputs: 0
File system outputs: 0
Socket messages sent: 0
Socket messages received: 0
Signals delivered: 0
Page size (bytes): 4096
Exit status: 0

Similarly, if a C or C++ program is compiled and linked to a file called helloc (the creation of helloc is given below)
prompt $] gcc -o helloc hello.c 
or
prompt $] g++ -o helloc tspradeep.cc 
if you want to execute this command 
 
prompt $] TIMEFORMAT=”” time -v ./helloc
 
The time command will show you the memory page faults, context swtiching, swap memory used and other system parameters, etc.
 
If you have any added input for this command, let you write in the comment section.

Pradeep Kumar TS

Display the Product name and System Vendor name in Linux

This post will help you to find out the

  • Product Name
  • System Vendor Name
This will help you to find the suitable device drivers if any.
The following is the command to find the System Vendor (in my case it is Hewlett Packard)
prompt $] cat /sys/class/dmi/id/sys_vendor
Here is the command to find the product name
prompt $] cat /sys/class/dmi/id/product_name
Printing the System Vendor and Product Name
cat is the command to concatenate the files and print it to the standard output

Pradeep Kumar TS