Wednesday, December 12, 2012

Unity Desktop first impressions

I recently tested Unity Desktop and thought I would write about it. The latest step by Ubuntu is said to have made things complicated and some also think it has copied parts of Mac Os. But linux users will prefer the classic and simplistic gnome feel.

But I think Unity is worth a look. It is powered by one of the best teams in Linux, Canonical.

Unity Doc on the left side

Unity Doc

So far the experience is good. I haven't got to explore the nooks and corners of Unity desktops but they look best in wide screen monitors ie. 17". There is enough space for the doc on the left and it doesn't consume much screen size if the monitor is big. The doc is customizable with options even to disable it.

One of the bugs I noticed was with the program descriptions. It is that when a mouse pointer is placed over a program, the description pops up but it often breaks. Incidentally this feature doesn't work well with MATE desktop too. My next article will look into the process behind it, a possible fix maybe.

Ubuntu Button and Dash

There is a Dash home button also known as Ubuntu button at the top of the doc which brings a Dash for searching any files, apps within the system. This looks very good with fast and accurate searching.

Ubuntu Software Center

If you ask me about the most elegant feature in Ubuntu Linux I would say it is the Software Manager. The program is better now with accurate search and install. Now I would like to mention that the Software Manager with LMDE 13 is broken. It searches and displays but install fails. There isn't an update available yet for that in the rolling release.

Better, stable Notification area and its applets

In 10.04 and later, I've noticed that Notification area breaks and applets go out of order after reboots. I have not seen that issue in 12.04 so far.

notification area and applets on top right
Ubuntu help

Another thing I found is Ubuntu help (the Ubuntu Desktop Guide) which comes with the OS. Topics are well organized and of great help.

Long Term Support (LTS)

Being an LTS release its great to have Ubuntu 12.04. It will give software updates for very long time so we won't have to worry about an update. The latest softwares and binaries will be available in repositories. The update settings will automatically inform us which can be managed via Synaptic Package Manager.

Precise Pangolin is the other name

Lastly let me say about the funny default wallpaper. Every Ubuntu release will have an animal associated with it. This time its a Pangolin. And they have named it the Precise Pangolin meaning the OS is precise and elegant.

Tuesday, October 2, 2012

lm-sensors reads cpu temperature (available in Debian repository)

Lm-sensors available in debian repository helps to find cpu temperature along with other readings.

Package download and information.

Usage is simple. Install it using apt so it starts like this.

$ sudo apt-get install lm-sensors     # install package

$ sudo sensors-detect    # this will probe your cpu for drivers that can be used for getting the readings. Follow the instructions which is quite informative.

The command will suggest available drivers which has to be loaded via modprobe command. Additionally add the lines suggested by sensors-detect to /etc/modules file so it loads on each reboot.

$ sudo sensors    # gives you readings.

Sample output :

fayad@mintboxd /var/log $ sudo sensors
[sudo] password for fayad:
Adapter: Virtual device
temp1:        +45.0°C  (crit = +88.0°C)
temp2:        +45.0°C  (crit = +88.0°C)

Adapter: ISA adapter
Core 0:       +47.0°C  (high = +80.0°C, crit = +90.0°C)
fayad@mintboxd /var/log $

changing display brightness with proprietory Nvidia drivers in Linux Mint Debian Edition 13

Recent move to Linux Mint Debian Edition 13 got myself working on adjusting the screen brightness. The normal commands didn't work under my Sony VPCCW25FA so had to look at nvidia-settings to change brightness and contrast.

A single command will change the settings.

$ nvidia-settings --assign RedBrightness=-0.20 --assign GreenBrightness=-0.20 --assign BlueBrightness=-0.20

To load these settings after each reboot the config file (.nvidia-settings-rc) residing in home directory should be added with these settings. Find lines that specify brightness settings. Add a startup program with this line.

$  nvidia-settings --config=~/.nvidia-settings-rc --load-config-only

Wednesday, March 28, 2012

Excellent freeBSD / Linux classification

Every linux 'worker' at some point of time will search about the greatness of Unix operating system. freeBSD being the free and closest relative of Unix, a Linux enthusiast has to know the red devil. They relate to each other because Linux was developed from a Unix system. Yet Linux is unique. Here is a good doc that says a bit about it.

save your crash and reboots

Inspired by a very old Washington Post article, here is the truth why computers crash often. That's because the software is not subject to independent peer review. ie published, reviewed and commented by a community! Simply the beauty of open source.

connecting with databases using Perl DBI module

DBI is perl's database independent interface that makes it possible to do database operations. Words of wisdom from CPAN follows.

"The DBI is a database access module for the Perl programming language. It defines a set of methods, variables, and conventions that provide a consistent database interface, independent of the actual database being used.

It is important to remember that the DBI is just an interface. The DBI is a layer of "glue" between an application and one or more database driver modules. It is the driver modules which do most of the real work. The DBI provides a standard interface and framework for the drivers to operate within."

use strict;
use warnings;
use DBI;
my $db = DBI -> connect('dbi:mysql:csv_db;host=localhost','root','');
my $query = $db -> prepare(qq{select * from tbl_name});
$query -> execute();
while (my @row = $query -> fetchrow()) {
foreach my $column (@row) {
print "$column\n";

More about DBI and its functions from CPAN

form data in Perl using CGI module (GET and POST methods)

Environment variable can be used to get GET data from forms. Using CGI module, we can get the POST data as well. A simple html form is created and this perl script is called in 'action'.

use strict;
use warnings;
use CGI qw(:standard);

    my $value = $ENV{'QUERY_STRING'};
    print "Content-type: text/html\n\n";
    my ($var1, $var2) = split(/=/,$value);  #remove the '=' symbol from the url and split the data
    print $var2;
elsif ($ENV{'REQUEST_METHOD'} eq "POST")

    my $cgi = new CGI;
    print $cgi -> header();
    print $cgi -> start_html("printing post data");
    print "Value is: \n" . $cgi -> param('value');
    print $cgi -> end_html();