Wednesday, April 9, 2014

Journey to a plateau

After a several discussions, me and my friends were decided to have a journey to the upcountry. If you search about plateaus of Sri Lanka, the very first name you will get is Horton Plains. It is a popular plateau among tourists and a paradise for naturalists.
It was a clear morning, without the mist, rain and strong wind, and we arrived to the entrance of the national park around 7.30 AM.

  

 Horton Plains is popular for a few things, "world's end", "Baker's falls", large plain and bio diversity. When the British period, they were renamed this plateau to Horton Plains which was originally named as "Maha Eliya Thenna". According to some ancient books, this area was forbidden and no one ever lived close to here, and the reason remains a mystery. Furthermore, if you search the time before the written history, there are some mythical stories about this place, which reminds me, that every myth has a hidden real story.  
However, our first destination was the "world's end". I cannot find a good reason for that name with the clear weather, but if there are mist, then someone can be mistakenly identified it as the world's end if they have no idea about the globe. 
I was very lucky to capture the bottom of this sheer precipice, with my amateur photography skills.


Baker's falls is one of the famous waterfall in Sri Lanka which is located in Horton Plains. It is not huge compared to other popular waterfalls, but eye catch-able .



While I was gratifying my eyes from the beauty of the plateau, I have got to know some major threats for this environment. Mainly the behavior of tourists and alien species such as Ulex europaeus and Brackens. Fortunately, there are some programs for reduce these threats, but I am not sure how much effective they are.

If you like to see more photographs, please visit my flickr set.

https://www.flickr.com/photos/122401983@N05/sets/72157643496113774/

 

Sunday, March 30, 2014

Can we trust skype ?

Recently, I have read about surveillance via social networks and how unauthorized persons and organizations, spying on the people. They have used proprietary softwares for such activity. Skype is the most popular Voice-over-IP program, and it is really helpful to make virtual conversations. It is used by not only people, but the governments as well. It's been more than 10 years since they announced the first release of skype and now, almost all the people are addicted to use skype for internet calls, even they provide less service than they used to be.
Skype comes with freemium license, which is basically free but advanced features are available for money. However, it is true, that we cannot guarantee our privacy if we use proprietary program like Skype. We can't be sure who is listening in. Why ? because the code isn't open and we don't know what exactly happening inside, where it connects and what encryption it provides.
As an open source enthusiast, I explored  about alternatives for skype which can be trusted. And I was lucky to find a super tool for VoIP, which is absolutely open source and distributed under LGPL license. It is jitsi. It is available for all the platforms and in case you may use the source to build it into your platform.

Download jitsi


Finally, I need to mention that, jitsi isn't popular like skype. Therefore, you cannot completely stop using skype. So, I hope to see more users on jitsi (including my friends and clients) near future.

Sunday, February 9, 2014

Private MediaWiki

MediaWiki is a free software open source wiki package written in PHP, originally for use on Wikipedia. The default settings in MediaWiki, allows any user to view/edit its content. MediaWiki can be used in your business, to keep important documents and share with only the trusted parties. After a small configuration, you can make MediaWiki for private use.

In the MediaWiki, home directory, you may find a very important config file called "LocalSettings.php".

MediaWiki has user groups where you can decide which permission should be given. These permissions can be configured by changing the values of $wgGroupPermissions array. Please consider the following code. 

$wgGroupPermissions['*'] defines the none users, (viewers with no account)


After all, you can do further customization, like hiding particular widget from anonymous users. 


In the above code, please note "if($wgUser->isLoggedIn())" part. This is a simple validation, where it checks whether the viewer is logged in or not. Once it got true, then the sidebar will be appeared. This a good way of removing sidebar from none logged in viewers.

Tuesday, November 26, 2013

SQL*PLUS

This is a quick and dirty installation of sql*plus in debian based systems.


1. Download sql plus

oracle-instantclient12.1-basic-12.1.0.1.0-1.i386.rpm
oracle-instantclient12.1-sqlplus-12.1.0.1.0-1.i386.rpm
oracle-instantclient12.1-devel-12.1.0.1.0-1.i386.rpm

2. Install 'alien'

#apt-get install alien

3. Install rpms

#alien -i oracle-instantclient12.1-basic-12.1.0.1.0-1.i386.rpm
#alien -i oracle-instantclient12.1-sqlplus-12.1.0.1.0-1.i386.rpm
#alien -i oracle-instantclient12.1-devel-12.1.0.1.0-1.i386.rpm

4. Install Linux kernel AIO library

# apt-get install libaio1

5. oracle.conf

# touch /etc/ld.so.conf.d/oracle.conf
# echo "/usr/lib/oracle/12.1/client/lib/" >> /etc/ld.so.conf.d/oracle.conf

6. configure dynamic linker run-time bindings

# ldconfig

7. Edit ~/.bash_profile and export oracle client path.

export ORACLE_HOME=/usr/lib/oracle/12.1/client64




7. Create the following file.

 # touch $ORACLE_HOME/network/admin/tnsnames.ora

8. connect to a db

# sqlplus user/password@192.168.1.8:1521/orcl

Saturday, November 16, 2013

django mysql exception

After facing some compatibility issues of my system, I upgraded my debian squeeze to wheezy. I used Python2.6 and the latest distro upgrade gave 2.7 version, which cause me to fix so many dependencies of my django project. This is one issue I faced.

    new_class.add_to_class('_meta', Options(meta, **kwargs))
  File "/home/jgeek/playground/project-wl/local/lib/python2.7/site-packages/django/db/models/base.py", line 264, in add_to_class
    value.contribute_to_class(cls, name)
  File "/home/jgeek/playground/project-wl/local/lib/python2.7/site-packages/django/db/models/options.py", line 124, in contribute_to_class
    self.db_table = truncate_name(self.db_table, connection.ops.max_name_length())
  File "/home/jgeek/playground/project-wl/local/lib/python2.7/site-packages/django/db/__init__.py", line 34, in __getattr__
    return getattr(connections[DEFAULT_DB_ALIAS], item)
  File "/home/jgeek/playground/project-wl/local/lib/python2.7/site-packages/django/db/utils.py", line 198, in __getitem__
    backend = load_backend(db['ENGINE'])
  File "/home/jgeek/playground/project-wl/local/lib/python2.7/site-packages/django/db/utils.py", line 113, in load_backend
    return import_module('%s.base' % backend_name)
  File "/home/jgeek/playground/project-wl/local/lib/python2.7/site-packages/django/utils/importlib.py", line 40, in import_module
    __import__(name)
  File "/home/jgeek/playground/project-wl/local/lib/python2.7/site-packages/django/db/backends/mysql/base.py", line 17, in <module>
    raise ImproperlyConfigured("Error loading MySQLdb module: %s" % e)
django.core.exceptions.ImproperlyConfigured: Error loading MySQLdb module: No module named MySQLdb


Solution:

install "python-mysqldb" "libmysqlclient-dev" from distro repositories.
install "django"
install "mysql-python" from pip.
          $ pip install mysql-python

run "python manage.py syncdb" again.

Tuesday, November 12, 2013

Compare Files


Here are  two KDE project utilities to compare files, awesome.


kdiff3


kompare
                         

Saturday, August 10, 2013

how to patch your code ?

Some of you(programmers) might not have tried patching tools before. There are many tools exist for Unix and windows to do patching. I started an opensource project a few weeks back and had no idea of what tool should I use to patch my code when needed. After a few read, I have found some tricks to do a good patching.  

If you are using a Unix system, this method might be really helpful to patch. Assume your source directory name is "test" and one of your code contributors got the same source directory.Now, you make a replicate directory of "test" called "testm" and do some changes to the source inside it. After a unit test, you want to send the modified source as a patch to your contributor. 

Open up a terminal and change the location to the parent directory of "test" and "testm".

  •  diff -Naur test testm > testpatch1.patch

Send the "testpatch1.patch" to the contributor and they should apply this patch to their source. 

  •  patch -Np1 --ignore-whitespace -d test < testpatch1.patch

Note: In this "diffing" and "patching" approach, you can include not only changes but also newly added files to the patch.