Saturday, December 22, 2012

How to set environment variable in Ubuntu

If you just need to set an environment variable for the current session you can always use export ENV_VAR=VALUE command. But most of the cases you will need to persist that variable.

Ubuntu no longer recommends setting environment variables in ~/.profile file. Instead you have to set it in ~/.pam_environment. You need to re-login for this to take effect. The environment variables are read from ~/.pam_environment file and is set when a user logs in. Read Ubuntu documentation on Environment Variables here.

The file ~./pam_environment might not be already available depending upon your configuration. In that case you need to create a new file. Make sure you create it in the home directory.

touch ~/.pam_environment

This command will create a new empty .pam_environment file in your home directory. Note that this is a hidden file and won't be visible in the file browser unless you have selected to show hidden files.

Next thing you will do is to open the file and just write your environment variables as a key-value pair, like this NAME=VALUE, one per line. NAME should not have any spaces.

vi ~/.pam_environment

A sample .pam_environment file

#the hash(#) sign at the beginning of the line makes it a comment line.
PATH=$PATH:~/bin
DATABASE_URL=postgres://heroku:heroku@localhost/herokuappdb


Advanced configuration

There are two possible options for each of the environment variables - DEFAULT and OVERRIDE. The DEFAULT option, if provided, sets the default value of an environment variable, else "" is assumed. And this DEFAULT value can be overridden by using the OVERRIDE. Again if OVERRIDE is not given "" value is assumed.

PATH    DEFAULT=$PATH    OVERRIDE=$PATH:~/bin

You can read more and view some examples on your system by typing the following command on your terminal.

cat /etc/security/pam_env.conf


Some Ubuntu books you should check out:

Friday, December 7, 2012

Youtube Redesign 2012 - More focused on subscriptions

I don't know how many of you got the new design of Youtube. But I have been getting a new homepage on Youtube on and off for about a month and now it seems to be stable. Sometimes it was only available on Chrome, but now I have tested in both Firefox and Chrome.

Now it looks so much better. Youtube is making use of most of the unused space, better font, more visible links and features, easily accessible analytics and video manager and most importantly more focus on subscriptions.

Now the recommended videos is called What to watch, which I think is easy to understand even for a toddler. On the homepage you get popular videos and categories like Popular on Youtube, Music, Sport, Gaming, Films, TV Shows and Spot Light. From the order of the categories, it looks like Google is trying to prioritize Music than others. The Spot Light category shows you popular videos in your country.

The hidden menu on top, which opens up on clicking your name and the Google+ button is also tweaked a little. Space utilisation is better although there is a little unused space.

All in all Google is trying to propagate its new simple minimalistic design language across Youtube. This time you won't need any time at all to get adjusted to the new design, like the previous redesign.

Checkout the screen shots, if you haven't already got the new design.

New Youtube Homepage

Now with more videos and easily accessible links on the left hand side.

Redesigned Hompage after signing in

Here we get the recommended videos and social updates. And again all other options are easily accessible at the left hand side menu. We also have popular channels and recommended channels on the right hand side.

Analytics and video manager

This is handy for a Youtuber. Both Youtube analytics and video manager can be now reached with just one click.

Redesigned video screen

Have a look at the new like button and meta informations. The comment section seems to be now more focused on the comment text rather than on likes.

Overall I would give a 8/10 to the new Youtube design. How much will you give?

Related Posts Plugin for WordPress, Blogger...