Showing posts with label CentOS. Show all posts
Showing posts with label CentOS. Show all posts

Thursday, December 18, 2014

Generating SSH Public Key for GIT

Version controlling is one of the most important software life cycle processes. We have to maintain our code base on remote repository with version control functionality. For remote repository and version control, we have GIT and SVN. In GIT, I am going to give you the steps to get and add SSH authenticate key.

Please follow the below commands to get SSH key from Linux machine.

cd ~/.ssh

ssh-keygen

cat ~/.ssh/id_rsa.pub

Once you done the below commands, you can copy the content of CAT command and paste into notepad. After you pasted in notepad, if you find any space on end of the content, please remove the space and copy the content and paste on SSH Key in Git hub account.

Friday, September 12, 2014

Libmemcached cinttypes problem on complie using gc++ complier for memcached library

---------------------------------------------------------------------------------------------------------
Problem
---------------------------------------------------------------------------------------------------------
The compilation failed on a configure without any options:
----
  CXX libhashkit/libhashkit_libhashkit_la-behavior.lo
  CXX libhashkit/libhashkit_libhashkit_la-crc32.lo
  CXX libhashkit/libhashkit_libhashkit_la-digest.lo
  CXX libhashkit/libhashkit_libhashkit_la-encrypt.lo
  CXX libhashkit/libhashkit_libhashkit_la-fnv_32.lo
  CXX libhashkit/libhashkit_libhashkit_la-fnv_64.lo
  CXX libhashkit/libhashkit_libhashkit_la-function.lo
  CXX libhashkit/libhashkit_libhashkit_la-has.lo
  CXX libhashkit/libhashkit_libhashkit_la-hashkit.lo
  CXX libhashkit/libhashkit_libhashkit_la-jenkins.lo
  CXX libhashkit/libhashkit_libhashkit_la-ketama.lo
  CXX libhashkit/libhashkit_libhashkit_la-md5.lo
  CXX libhashkit/libhashkit_libhashkit_la-murmur.lo
  CXX libhashkit/libhashkit_libhashkit_la-one_at_a_time.lo
  CXX libhashkit/libhashkit_libhashkit_la-rijndael.lo
  CXX libhashkit/libhashkit_libhashkit_la-str_algorithm.lo
  CXX libhashkit/libhashkit_libhashkit_la-strerror.lo
  CXX libhashkit/libhashkit_libhashkit_la-string.lo
  CXX libhashkit/libhashkit_libhashkit_la-nohsieh.lo
  CXXLD libhashkit/libhashkit.la
  CXX libmemcached/csl/libmemcached_libmemcached_la-context.lo
In file included from ./libmemcached/common.h:72,
                 from ./libmemcached/csl/common.h:40,
                 from libmemcached/csl/context.cc:38:
./libmemcached-1.0/memcached.h:46:27: error: tr1/cinttypes: No such file or directory
make[1]: *** [libmemcached/csl/libmemcached_libmemcached_la-context.lo] Error 1
make[1]: Leaving directory `/root/libmemcached/libmemcached-1.0.8'
make: *** [all] Error 2
---------------------------------------------------------------------------------------------------------
Solution
--------------------------------------------------------------------------------------------------------- 
This issue occurs because of complier version problem. So we should the gc++ complier. Use below command to install gc++ improved version.

If you login with root previliage, you can use below command.

yum install gcc44 gcc44-c++ libstdc++44-devel

If your not root user, please user below command

sudo yum install gcc44 gcc44-c++ libstdc++44-devel

Once you have installed, compile the libmemcached using below command.

CC=gcc44 CXX=g++44 ./configure

Now your should be able to compile without issue.

How to add cron job in CentOS(UNIX/LINUX)

CRON Job is one of the most powerful system in UNIX system. Cron job will be execute by unix system by certain time interval on regular basis. It will allow to schedule your script to run on background without affecting your current task on UNIX machine. Here i will give you real time example for CentOS.

Cron jobs can be schedule on two different ways, System cron job and user defined cron jobs. System jobs will be defined by root privilege user. This will allow your unix system to perform there system related job on certain interval basis. User defined cron jobs can be defined by any of the user with their user privilege.

Location of crontab in CentOS - /etc/crontab

The below command will allow you to edit the cron file to add your job.

crontab -e

Here the syntax for adding your cron job into cron file.

1 2 3 4 5 /path/to/your-filename arg1 arg2

What is 1, 2, 3, 4, 5?

1 - Minute (0-59)
2 - Hours (0-23)
3 - Days of month(1-31)
4 - Month (1-12)
5 - Week days (0 -7)

You can pass your arguments with arg1, arg2 and argN

To list your cron jobs - crontab -l

To Remove all cron job - crontab -r