Tuesday, January 8, 2013

Create a ShortCut to Ubuntu Desktop or Unity Dock

1) Install gnome-panel

sudo apt-get install gnome-panel

2) Open the Terminal and run below command to get a create launcher


   gnome-desktop-item-edit --create-new ~/.local/share/applications/

3) Provide the name, In command browse and select the "application" ex : eclipse (/home/gubs/eclipse/eclipse) executable. Click the icon and load the icon.

4) Browse folder ~/.local/share/applications

5) Drag and drop the created app into desktop or Unity Dock.

Monday, August 20, 2012

Split String function in MySQL


DROP FUNCTION IF EXISTS SPLIT_STR;
CREATE FUNCTION SPLIT_STR(
  x VARCHAR(255),
  delim VARCHAR(12),
  pos INT
)
RETURNS VARCHAR(255)
RETURN REPLACE(SUBSTRING(SUBSTRING_INDEX(x, delim, pos),
       LENGTH(SUBSTRING_INDEX(x, delim, pos -1)) + 1),
       delim, '');

SELECT SPLIT_STR(string, delimiter, position);

Example :
SELECT SPLIT_STR('a|bb|ccc|dd', '|', 3) as third;

Wednesday, July 25, 2012

How to re-direct the data or logs directory in MySQL, Terracotta Cache, Job and Task Tracker logs


1) File : /etc/my.cnf
datadir=/mysql/data

2) In terracotta cache
file : tc-config.xml
, and tag

3) Hadoop logs (job tracker and task tracker)
file : /etc/hadoop/conf/mapred-site.xml
In property tag : mapred.local.dir

mapred.local.dir
/hadoop/tmplocal
Note : Restart task tracker and job tracker once you modified configuration.

Tuesday, July 17, 2012

Block and unblock wifi (wireless fidelity) in linux

rfkill list - This command will show whether hardware or software blocked the wifi in your system.

rfkill unblock wifi - This command will enable software wifi in your laptop.

Reboot your machine once you unblocked.

Sunday, July 15, 2012

Install vpnc in Ubuntu.

In Synatpic Manager install 'vpnc', NetworkManager-vpnc.

In Vpn connection load pcf file. Update the username and reboot the machine.

You can see the username for the vpn and connect into it.

Saturday, July 14, 2012

Too many open files error in linux

If the error is too many open files increase the ulimit in linux for that user whichever user you start the process.

Default open files allowed : 1024

To see current open files execute below command :
lsof | wc -l

Edit in below files and logout and login.
vi /etc/security/limits.d/99-hadoop.nofiles.conf
vi /etc/security/limits.d/hbase.nofiles.conf

To check ulimit
ulimit -Hn (Hard limit)
ulimit -Sn (Soft limit)

Logout and Login
None of the changes you have made above will have any effect until you logout and back in. You do not need to reboot your system or reinstall any software.

http://www.cyberciti.biz/faq/linux-increase-the-maximum-number-of-open-files/

To see the list of listening port in linux :
lsof | grep LISTEN

To see the list of listening tcp in linux
lsof | grep TCP

Thursday, June 28, 2012

Continuous Build Integration - Hudson Rocks


As every body knows in agile methodology now we need continuous build integration. I used hudson and its amazing. http://hudson-ci.org/ Download and install.

Start the hudson in root. Though its a bad practice so many rights issue raising.  Update the file : /etc/sysconfig/hudson for hudson user start up and to add environment variables. Adding environment variables in Hudson -> Manage Hudson -> Configure System sucks.

Having said tool is really great to work .

Below from the hudson configuration file :

export ANT_HOME="/opt/apache-ant-1.8.3"
export PATH=${PATH}:${ANT_HOME}/bin
export ANT_OPTS="-Dhttp.proxyHost=proxy -Dhttp.proxyPort=8080"

hudson-url/manage -> configure system
hudson build / configure (configuration)
// Below script tag for SyntaxHighLighter