Let's Share Knowledge And Make A Difference

  • Monitor your network and systems like a hawk

    There are some perfact open souce solution for monitoing your Network devices and server system's health. Nagios, Cacti, WhatsUpGold and Smokeping are the leading monitoring tools among them...

    Read More
  • Email service and Security

    Now a days life without email service is unthinkable and E-mail service is quite expensive. As always linux gives us the answer with a strong mail service named postfix...

    Read More
  • Data Center Solution

    A data centre is a facility where companies can keep and operate most of the ICT infrastructure that supports their business. IT host the most critical systems that are vital to the continuity of daily operations...

    Read More

Monday, April 28, 2014

Log-in problem and Nautilus problem in Ubuntu 12.04

Log-in problem and Nautilus problem in Ubuntu 12.04

After a long search in web didn't find the right solution. Here is the solutions to fix those problems.

Error1: Desktop is not comming after login in Ubuntu 12.04.
Solution:
mahidul@mahidul-pc:~$ sudo apt-get update
mahidul@mahidul-pc:~$ sudo apt-get -y install --reinstall ubuntu-desktop

Error2: Nautilus does not working in ubuntu 12.04. And error log shows as below- (Press Ctrl+Alt+F1)

mahidul@mahidul-pc:~$ tail -f /var/log/syslog
mahidul-pc kernel: [  809.241978] nautilus[3199]: segfault at ab ip 00007f8016d4ef08 sp 00007fff9e2155d0 error 4 in libpython2.7.so.1.0[7f8016bc8000+281000]

mahidul@mahidul-pc:~$ nautilus
Segmentation fault (core dumped)

Solution:

mahidul@mahidul-pc:~$ sudo mv /usr/share/nautilus-python/extensions/ /tmp
[sudo] password for mahidul: give_your_sudo_password_here

mahidul@mahidul-pc:~$ nautilus

Tuesday, April 8, 2014

How to install and configure Torrent client in redhat/centos 6.x

How to install and configure Torrent client in redhat 6

Topic Index:
   1. Concept
   2. Installation
   3. Set global speed restriction
   4. Start a download from Transmission-gui
   5. Start a download from command line
   6. Start a download from web interface
   7. Create new Torrent
   8. Download torrent file using cronjob
   9. Troubleshooting

01. Concept:          
As we all know torrent is a peer-to-peer file sharing protocal whish is used for the transaction of big amount data. For this kinds of sharing we can use may kinds of torrent clients like bittorrent, utorrent, transmission etc. Torrent is simple in windows internment but little bit complected from linux command line. Here I have explained details regarding transmission torrent client which gives you all the features you want. Some of the major feature is like below-
1. Command line usability
2. Uses as desktop client
3. Remote access to the client
4. Web interface for accessing through Internet

02. Installation:
First install dependencies:
[root@gw1 ~]# yum -y install openssl* make gcc gcc-c++ autoconf automake openssl-devel curl-devel libevent-devel wget libevent-1.4.so.2

If still libevent is missing then menually download and install it like this way:
[root@gw1 ~]# wget ftp://mirror.switch.ch/pool/4/mirror/scientificlinux/6rolling/x86_64/os/Packages/libevent-1.4.13-4.el6.x86_64.rpm
or
[root@gw1 ~]# wget ftp://rpmfind.net/linux/centos/6.4/os/x86_64/Packages/libevent-1.4.13-4.el6.x86_64.rpm
[root@gw1 ~]# rpm -ivh libevent-1.4.13-4.el6.x86_64.rpm

Now we are going to download a torrent client named transmission:
[root@gw1 ~]# wget ftp://ftp.univie.ac.at/systems/linux/fedora/epel/6/x86_64/transmission-daemon-2.13-1.el6.x86_64.rpm
[root@gw1 ~]# wget http://dl.dropboxusercontent.com/u/72284235/transmission.tar.gz
[root@gw1 ~]# tar -zxvf transmission.tar.gz

Lets unzip it and install the nessesary packages:
[root@gw1 ~]# rpm -ivh transmission-daemon-2.13-1.el6.x86_64.rpm

To use transmission client from desktop envirnment follow below step:
[root@gw1 ~]# rpm -ivh transmission/*

To use transmission client only from command line interface (CLI) follow below steps:
[root@gw1 ~]# rpm -ivh transmission/transmission-common-2.13-1.el6.x86_64.rpm
[root@gw1 ~]# rpm -ivh transmission/transmission-cli-2.13-1.el6.x86_64.rpm

[root@gw1 ~]# service transmission-daemon restart
[root@gw1 ~]# chkconfig transmission-daemon on

03. Set global speed restriction:
The daemon has to be stopped before making changes to the config file. Otherwise, the config file will be overwritten on daemon restart later. Unless performing a reload instead of restart.

[root@gw1 ~]# /etc/init.d/transmission-daemon stop

[root@gw1 ~]# vim /etc/init.d/transmission-daemon
DAEMON_ARGS="-g $TRANSMISSION_HOME/.config/transmission"
#DAEMON_ARGS="-T --blocklist -g $TRANSMISSION_HOME/.config/transmission"

[root@gw1 ~]# vim /var/lib/transmission/.config/transmission/settings.json
{
    "alt-speed-down": 50,
    "alt-speed-enabled": false,
    "alt-speed-time-begin": 540,
    "alt-speed-time-day": 127,
    "alt-speed-time-enabled": false,
    "alt-speed-time-end": 1020,
    "alt-speed-up": 50,
    "bind-address-ipv4": "0.0.0.0",
    "bind-address-ipv6": "::",
    "blocklist-enabled": true,
    "blocklist-url": "http://www.example.com/blocklist",
    "cache-size-mb": 2,
    "dht-enabled": true,
    "download-dir": "/storage/Downloads",
    "encryption": 1,
    "idle-seeding-limit": 30,
    "idle-seeding-limit-enabled": false,
    "incomplete-dir": "/storage/Downloads",            
    "incomplete-dir-enabled": false,
    "lazy-bitfield-enabled": true,
    "lpd-enabled": false,
    "message-level": 2,
    "open-file-limit": 32,
    "peer-limit-global": 240,
    "peer-limit-per-torrent": 60,
    "peer-port": 51413,
    "peer-port-random-high": 65535,
    "peer-port-random-low": 49152,
    "peer-port-random-on-start": false,
    "peer-socket-tos": 0,
    "pex-enabled": true,
    "port-forwarding-enabled": true,
    "preallocation": 1,
    "ratio-limit": 2,
    "ratio-limit-enabled": false,
    "rename-partial-files": true,
    "rpc-authentication-required": true,
    "rpc-bind-address": "0.0.0.0",
    "rpc-enabled": true,
    "rpc-password": "your_password_here",
    "rpc-port": 9091,
    "rpc-username": "admin",
    "rpc-whitelist": "127.0.0.1",
    "rpc-whitelist-enabled": false,
    "script-torrent-done-enabled": false,
    "script-torrent-done-filename": "",
    "speed-limit-down": 100,
    "speed-limit-down-enabled": false,
    "speed-limit-up": 5,
    "speed-limit-up-enabled": true,
    "start-added-torrents": true,
    "trash-original-torrent-files": false,
    "umask": 18,
    "upload-slots-per-torrent": 14
}

[root@gw1 ~]# mkdir -p /storage/Downloads
[root@gw1 ~]# chown transmission.transmission /storage/Downloads
[root@gw1 ~]# chown transmission.transmission -R /storage/Downloads
[root@gw1 ~]# /etc/init.d/transmission-daemon start
                           
04. Start a download from Transmission-gui:
Edit-> Preferences -> Transmission Preferences -> Speed Limits/Alternative Speed Limits
Under Speed Limits/Alternative Speed Limits you can set what the max speed your data needs to be uploaded.

05. Start a download from command line:
[root@gw1 ~]#  /usr/bin/transmission-cli magnet:?xt=urn:btih:4d2220f8855996486033ff7b83f5e5d0ba863640&dn=New+Avengers+010+%282013%29+%28Digital%29+%28Zone-Empire%29&tr=udp%3A%2F%2Ftracker.openbittorrent.com%3A80&tr=udp%3A%2F%2Ftracker.publicbt.com%3A80&tr=udp%3A%2F%2Ftracker.istole.it%3A6969&tr=udp%3A%2F%2Ftracker.ccc.de%3A80&tr=udp%3A%2F%2Fopen.demonii.com%3A1337

To stop the transmission deamon use the below command:
[root@gw1 ~]# killall transmission-cli

To Resume the download:
[root@gw1 ~]# /usr/bin/transmission-cli /root/.config/transmission/torrents/StarCraft_2_HOTS.4be19f8ca99be826.torrent

Stop the download:
[root@gw1 ~]# killall transmission-cli

Download location:
[root@gw1 ~]# ls /storage/Downloads

06. Start a download from web interface:
Go to the transmission web interface.
http://localhost:9091
Username: admin
Password: web_password_here




07. Create new Torrent: 
Create a new torrent on the transmission server using transmission-create
[root@gw1 ~]# transmission-create -t -o .torrent
[root@gw1 ~]# transmission-create -t http://xxx.yyy.com:6969/announce -o your_file_or_folder_name.torrent your_file_or_folder

Verify the torrent file using transmission-show
[root@gw1 ~]# transmission-show .torrent

08. Download torrent file using cronjob:            

[root@gw Downloads]# crontab -e
# Minute   Hour   Day of Month       Month          Day of Week              Command
# (0-59)  (0-23)     (1-31)    (1-12 or Jan-Dec)  (0-6 or Sun-Sat)    command with full path

20      22      23      *       *       /usr/bin/killall transmission-cli
21      22      23      *       *       /usr/bin/transmission-cli magnet:?xt=urn:btih:4d2220f8855996486033ff7b83f5e5d0ba863640&dn=New+Avengers+010+%282013%29+%28Digital%29+%28Zone-Empire%29&tr=udp%3A%2F%2Ftracker.openbittorrent.com%3A80&tr=udp%3A%2F%2Ftracker.publicbt.com%3A80&tr=udp%3A%2F%2Ftracker.istole.it%3A6969&tr=udp%3A%2F%2Ftracker.ccc.de%3A80&tr=udp%3A%2F%2Fopen.demonii.com%3A1337

09. Troubleshooting: 
Error#01:
After restarting the transmission-daemon "settings.json" config back to previous state. Or sometimes only authentication reset to false.

Solution:
[root@gw1 ~]# vim /etc/init.d/transmission-daemon
DAEMON_ARGS="-g $TRANSMISSION_HOME/.config/transmission"
#DAEMON_ARGS="-T --blocklist -g $TRANSMISSION_HOME/.config/transmission"

Then stop the transmission-daemon, change your settings and start the transmission-daemon again. Problem solved.

How to install and configure JIRA in redhat/centos 6.x


How to install and configure JIRA

Concept:
JIRA is a proprietary issue tracking product, used for bug tracking, issue tracking and project management which is developed by Atlassian. We can install JIRA three different ways like using .bin, .war or .tar.gz files. Here I will show you how to install jira using .bin file. It's very easy and simple. Follow the below steps and total installation will be complete within a few minutes.

Install mysql:
[root@db1 ~]# yum -y install mysqld

Or, download the following rpm packages and install from it.
[root@db1 ~]# yum remove mysql-libs perl-DBD-MySQL
[root@db1 ~]# yum install libaio perl-DBI
[root@db1 ~]# rpm -ivh /Packages/mysql-5.5.27-packages/mysql-libs-5.5.27-11.el6.art.x86_64.rpm
[root@db1 ~]# rpm -ivh /Packages/mysql-5.5.27-packages/mysql-5.5.27-11.el6.art.x86_64.rpm
[root@db1 ~]# rpm -ivh /Packages/mysql-5.5.27-packages/mysqlclient16-5.1.59-1.el6.art.x86_64.rpm
[root@db1 ~]# rpm -ivh /Packages/mysql-5.5.27-packages/perl-DBD-MySQL-4.022-1.el6.rfx.x86_64.rpm
[root@db1 ~]# rpm -ivh /Packages/mysql-5.5.27-packages/mysql-server-5.5.27-11.el6.art.x86_64.rpm
[root@db1 ~]# yum install crontabs 
[root@db1 ~]# service mysqld restart
[root@db1 ~]# chkconfig mysqld on

Create a database for jira and give proper permission:
[root@db1 ~]# mysqladmin -u root password your_root_password
[root@db1 ~]# mysql -u root -p
mysql> CREATE DATABASE jiradb CHARACTER SET utf8 COLLATE utf8_bin;
mysql> GRANT SELECT,INSERT,UPDATE,DELETE,CREATE,DROP,ALTER,INDEX on jiradb.* TO 'jira'@'localhost' IDENTIFIED BY 'jira_db_password';
mysql> flush privileges;
mysql> SHOW GRANTS FOR 'jira'@'localhost';
mysql> exit;

Install Jira:
Download atlassian-jira-6.2.2-x64.bin (32/64 bit) from https://www.atlassian.com/software/jira/download. And install as below-
[root@db1 JIRA_Packages]# ./atlassian-jira-6.2.2-x64.bin
Unpacking JRE ...
Starting Installer ...
Apr 08, 2014 10:09:06 AM java.util.prefs.FileSystemPreferences$1 run
INFO: Created user preferences directory.
Apr 08, 2014 10:09:06 AM java.util.prefs.FileSystemPreferences$2 run
INFO: Created system preferences directory in java.home.

This will install JIRA 6.2.2 on your computer.
OK [o, Enter], Cancel [c]

Choose the appropriate installation or upgrade option.
Please choose one of the following:
Express Install (use default settings) [1], Custom Install (recommended for advanced users) [2, Enter], Upgrade an existing JIRA installation [3]
2

Where should JIRA 6.2.2 be installed?
[/opt/atlassian/jira]

Default location for JIRA data
[/var/atlassian/application-data/jira]

Configure which ports JIRA will use.
JIRA requires two TCP ports that are not being used by any other
applications on this machine. The HTTP port is where you will access JIRA
through your browser. The Control port is used to Startup and Shutdown JIRA.
Use default ports (HTTP: 8080, Control: 8005) - Recommended [1, Enter], Set custom value for HTTP and Control ports [2]
2
HTTP Port Number
[8080]
9080
Control Port Number
[8005]
9005

JIRA can be run in the background.
You may choose to run JIRA as a service, which means it will start
automatically whenever the computer restarts.
Install JIRA as Service?
Yes [y, Enter], No [n]
y

Extracting files ...
Please wait a few moments while JIRA starts up.
Launching JIRA ...
Installation of JIRA 6.2.2 is complete
Your installation of JIRA 6.2.2 is now ready and can be accessed via your
browser.
JIRA 6.2.2 can be accessed at http://localhost:9080
Finishing installation ...


Note: Here, we have used 9080 and 9005 port cause other applications also use the default 8080 port.

Install mysql driver for Jira:
Download mysql driver for JIRA from http://dev.mysql.com/downloads/connector/j and Select Connector/J 5.1.30: Platfrom Independent.
[root@db1 ~]# wget http://cdn.mysql.com/Downloads/Connector-J/mysql-connector-java-5.1.30.tar.gz
[root@db1 ~]# tar -zxvf mysql-connector-java-5.1.30.tar.gz
[root@db1 ~]# cp -pfrv mysql-connector-java-5.1.30/mysql-connector-java-5.1.30-bin.jar /opt/atlassian/jira/lib
[root@db1 ~]# service mysqld restart
[root@db1 ~]# service jira stop
[root@db1 ~]# service jira start

Configure and setup your license through jira web interface:
Now, open your our web browser and follow the below settings:
http://192.168.1.198:9080

Server Language: English (United States)
Connection: My Own Database (recommended for production environments)
Database Type: localhost
Port: 3306
Database: jiradb
Username: jira
Password: jira_db_password

Rest of procedure is piece of cake. Complete it and your jira server is ready to use. Hope this article will help you.