ubuntu : custom battery notification settings

October 25th, 2014 § 0 comments § permalink

By default in Ubuntu the battery discharge notification was set based on remaining time. The remaining time was never accurate nor even near of prediction which caused sudden shutdown or hibernate while working. The only work around the internet was suggesting was to set the notification for percentage of battery remaining instead of time remaining.

Setting notification for percentage remaining.
Since these settings are in Dconf, we may need dconf-editor to makes this easier. I have explained how to install dconf-editor in Ubuntu : Add applications to system tray blog post.

After installing open the dconf editor and navigate to following path in tree sidebar.

org -> gnome -> settings-demon -> plugins -> power

, or you can try to find “battery” and reach the same.

Then update the following settings,

critical-battery-action : The default action to take when battery is empty. Set the critical-battery-action to hibernate if available.

percentage-action : At what percentage of battery OS should take the default which is set just before. I set it to 5.

percentage-critical : At what percentage of battery you need to get the critical notification. I set it to 10.

percentage-low : At what percentage of battery you need to get the first notification for battery low. I set it to 20.

And finally,

use-time-for-policy : Uncheck the checkbox.

Thats it. you are done. You can either restart the system or logout and login back for the changes to take effect.

Unit next time.

Mongodb : Install on Ubuntu

December 12th, 2013 § 0 comments § permalink

As part of getting started to NoSQL DB’s I thought of trying out MongoDB.

Installation

Installation was quite easy. Here is how I installed mongoDB on your ubuntu.

sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 7F0CEB10
echo 'deb http://downloads-distro.mongodb.org/repo/ubuntu-upstart dist 10gen' | sudo tee /etc/apt/sources.list.d/mongodb.list
sudo apt-get update
sudo apt-get install mongodb-10gen

Thats it, installation is over.

Start mongoDB

The mongoDB is setup with upstart, so you can start the service with the following command

sudo service mongodb start

Explore CLI

You can enter into mongoDB CLI to explore more, just type mongo in your terminal

mongoDB CLI

mongoDB CLI

Everything is fine. But when I do unclean shutdown sometimes, mongoDB service won’t start automatically. So after each unclean shutdown I need to do remove the lock file and start service manually.

sudo rm /var/lib/mongodb/mongod.lock
sudo service mongodb start

Happy exploring mongoDB.

Get ubuntu codename

April 7th, 2013 § 0 comments § permalink

Here is simple command which can give you the codeaname of your ubuntu distribution

lsb_release -c


here is result after running on my machine.

Ubuntu codename

Ubuntu codename

 

Install phpunit on ubuntu

February 21st, 2012 § 0 comments § permalink

A few months before I wrote an article on how to install phpunit on windows. Now when I tried to install phpunit on ubuntu I faced an error phpunit/PHPUnit requires PEAR Installer (version >= 1.9.4), installed version is 1.9.2 .

Here is the steps which I used to get rid of this error.

  1. Install php-pear
     sudo apt-get install php-pear
  2. Update its own channel
     sudo pear channel-update pear.php.net
  3. Upgrade pear
    sudo pear upgrade-all
  4.  Now install PHPunit
    sudo pear install –alldeps pear.phpunit.de/PHPUnit 
Now we can check whether installation is success by typing phpunit in terminal.

Yes. It worked.

Happy Testing.

Install redis server on ubuntu

July 12th, 2011 § 0 comments § permalink

Here is the step by step procedure for installing redis server.
If you have git installed on your ubuntu then clone it from github else download from here

git clone https://github.com/antirez/redis.git

Now change the directory into cloned/downloaded redis directory

cd redis

use make command

make

Use make install to install the redis server

sudo make install

Thatz all you have installed redis server.now you can run it.

redis-server

Try the redis client by using the command

redis-cli