Category: Tech

Send Mail from Liferay Portlet/Hook

Sending Mail from a Liferay Portlet or Hook is a pretty simple ordeal, although it becomes a bit tedious if not done correctly as I found out, after I had wasted more than a day trying to send it. To send an email from liferay, firstly, we will have to setup the SMTP Server from

Show the current git branch in linux terminal

Branches are a speciality of GIT where one can make changes without disturbing the full or the master repo. However, it is difficult to remember which branch we are present in through linux terminal. With the following code, we can easily get to know the branch in linux terminal. Firstly, open file .bashrc present in

Auto Mount Drives in Linux

To automatically mount a drive in Linux, one has to edit the /etc/fstab file and store the credentials that are required for the drive to mount. “fstab” is the “file systems table” file, where all available disks and disk partitions are listed and is used by the “mount” command to determine which options to use

Adding hosts to windows and linux

Using hostnames is an easier way to remember about one’s server rather than using it’s ip, like localhost for 127.0.0.1, etc. To add the hostname in windows, we have to edit the “hosts” file present in the etc folder in both windows and linux. In windows, it is present in : C:\Windows\System32\drivers\etc\ and in Linux

Connecting through SSH without password

To connect through SSH to a web-server without entering a password, one has to perform the following steps: 1. Run the command ssh-keygen $ ssh-keygen Save the key in the default location or any location you desire and provide the passphrase, which has to be atleast 4 letters long. The default location for the key is:

Display hashmap/map content in a JSF Page

Map<K,V> is an object that maps keys to values, and Hashmap is the class that implements the interface Map. In order to display the contents of a “Map” or a “Hashmap” in a java server faces page, we have to use a list of either an entitySet or keySet of the “Map” and iterate through

Configure Cron Job in cPanel for Drupal Site

Drupal contains a file cron.php, which is responsible for handling maintenance tasks as cleaning up the log files, checking for updates, indexing for the search module, etc. The cron.php file is automatically installed during/with the drupal installation and simply loading the following URL will run the cron file for maintenance, etc. http://www.example.com/cron.php For example, to

Firefox Tweak: Change font size on facebook

The day before I open facebook.com, just the usual checking of messages, notifications, requests, etc. The fonts of the site was smaller than it usually was. Some people liked the decrease in the font size. However, for me it was small and did not like it that much. So while talking to Sushil Shilpakar, he

Some Useful Matlab Commands

MATLAB or matrix laboratory is a numerical computing environment and fourth-generation programming language[1], accourding to wikipedia.org. MATLAB allows matrix manipulations, plotting of functions and data, implemetation of algorithms, creation of user interface and interfacing with programs written in other languages[1]. MATLAB is primarily intended for numerical computing. I worked in MATLAB for about a year