Saturday, October 19, 2013

Flickering Mouse Pointer Problem (Ubuntu 13.10)

Ubuntu 13.10 has just released. Yet, as lately happen to Ubuntu, bugs keep on appearing. There is a very noticeable and annoying bug that happened to Ubuntu 13.10, at least on my Asus Laptop. The mouse pointer will flicker indefinitely and will sometimes missing. It's very troublesome especially when we try to browse a website and go to the specific links or buttons.

Thankfully, there is a workaround for this. The good thing, it is very simple and does not need any advanced Linux expertise. Below are the steps:

  1. Open the System Preferences.
  2. Open the Display setting that is located at the Hardware section.
  3. Choose the unknown monitor and DISABLE it.
  4. Click on the Apply button and choose to keep the configuration when asked.
That's all. Hopefully it's helpful and feel free to add if there are other methods to solve this annoying problem.


Wednesday, July 10, 2013

Priorities (The Mayonnaise Jar)

Just read this, again, from the Internet. Nice story to share.

When things in your life seem almost too much to handle,
When 24 hours in a day is not enough,
Remember the mayonnaise jar and 2 cups of coffee.

A professor stood before his philosophy class
And had some items in front of him.
When the class began, wordlessly,
He picked up a very large and empty mayonnaise jar
and proceeded to fill it with golf balls.

He then asked the students, if the jar was full.
They agreed that it was.

The professor then picked up a box of pebbles and poured
them into the jar. He shook the jar lightly.
The pebbles rolled into the open Areas between the golf balls.

He then asked the students again if the jar was full. They agreed it was.

The professor next picked up a box of sand and poured it into the jar.
Of course, the sand filled up everything else.
He asked once more if the jar was full. The students responded with a unanimous 'yes.'

The professor then produced two cups of coffee from under the table and poured the entire contents into the jar, effectively
filling the empty space between the sand. The students laughed.

'Now,' said the professor, as the laughter subsided,
'I want you to recognize that this jar represents your life.
The golf balls are the important things - family,
children, health, Friends, and Favorite passions.
Things that if everything else was lost and only they remained, Your life would still be full.

The pebbles are the other things that matter like your job, house, and car.

The sand is everything else --The small stuff.

'If you put the sand into the jar first,' He continued,
'there is no room for the pebbles or the golf balls.
The same goes for life.

If you spend all your time and energy on the small stuff,
You will never have room for the things that are important to you.


Pay attention to the things that are critical to your happiness.
Play with your children.
Take time to get medical checkups.
Take your partner out to dinner.

There will always be time to clean the house and fix the disposal.

'Take care of the golf balls first --
The things that really matter.
Set your priorities. The rest is just sand.'

One of the students raised her hand and inquired what the coffee represented.

The professor smiled.
'I'm glad you asked'.

It just goes to show you that no matter how full your life may seem,
there's always room for a couple of cups of coffee with a friend.'

Thursday, July 4, 2013

Greatest Common Divisor (Eucledian)

Greatest Common Divisor (GCD for short) is the largest positive integer that divides two numbers. In other words, the greatest common divisor of a and b is, as its name suggests, the largest positive integer d such that d | a and d | b. In this post, we will see how we can calculate GCD efficiently using an algorithm that is known as Eucledian Algorithm.

The key thing in this algorithm is division with remainder, which is simply the method of "long division" that you learned in elementary school. Thus if a and b are positive integers and if you attempt to divide a by b, you will get a quotient q and a reminder r.

Below is the theorem used for this algorithm:
Let a and b be positive integers with a >= b. The following algorithm computes gcd(a,b) in a finite number of steps.
(1) Let r0 = a and r1 = b
(2) Set i = 1
(3) Divide ri-1 by ri to get a quotient qi and remainder ri+1, ri-1 = ri.qi + ri+1 with 0 <= ri+1 <= ri
(4) If the remainder ri+1 = 0, then ri=gcd(a,b) and the algorithm terminates.
(5) Otherwise, ri+1 > 0, so set i = i + 1 and go to Step 3.
Below is the sample source code on how it is implemented using the C programming language

int gcd ( int number1 , int number2 )
    if ( number2 == 0 )
        return number1 ;
        return gcd ( number2 , number1 % number2 ) ;

Hope it helps anyone who needs it. Happy Programming :)

Thursday, June 14, 2012

Shell Profile Reload

For those of you, who are familiar with shell in Linux or Unix environment, the file .bash_profile (or .profile in Mac OS X) must already be familiar. This file is used to store initialisation commands to be used for the entire shell session. Example of things you can put into this file is putting alias for commands and registering environment variables.

As the .bash_profile and .profile are just regular files, we can change it at any time. However, it will be quite a hassle if every time we change the file we need to close and open a new shell window. There is a command that we can use to re-run the profile file on the fly. Following is the full command you can use to do that.

Under Linux
source ~/.bash_profile

Under Mac OS X
source ~/.profile
Hope this helps you. Have fun.

Sunday, May 20, 2012

Public Key Infrastructure Fundamental (Part 2)

This post is a continuation (par 2) of my post that can be found here. In this post, I am going to discuss about Public Key and Private Key.

Public Key

Public key can be defined as a value provided by some designated authority as an encryption key that, combined with a private key derived from the public key, can be used to effectively encrypt messages and digital signatures. Private key will be discussed below.

Private Key

Private key can be defined as an encryption/decryption key known only to the party or parties that exchange secret messages.

Public-key Encryption
Source: Globus
As you can see from the above image, the public-key and private-key are both used in the encryption process in the PKI. One think you need to remember, we use the receiver's public-key as the key to encrypt the message. On the other side, the receiver, will decrypt the message using the private-key that he has.

To simplify things:
  • Think of a public key as being the lock. It’s not actually a key, it’s a padlock you can make lots of copies of and distribute wherever you want.
  • Think of a private key as being the actual key. This is what you use to open the padlock that is stored on the other machine. Just like a regular key you keep it secret, safe, and out of the wrong hands.

Public-key Encryption
Source: Wikimedia

In an asymmetric key encryption scheme, anyone can encrypt messages using the public key, but only the holder of the paired private key can decrypt. Security depends on the secrecy of that private key.