Saturday, December 3, 2016

What is Git :

Git is a version control system (VCS) that is used for software development and other version control tasks

Installing Git :

on ubuntu :
apt-get install git
on centOS :
yum install git

Creating the Repository :

First of all, create a folder for the project. Then we need to initiate the git local repository.
mkdir testRepo
cd testRepo
git init
git init will create one local git repository and adds few files like .git and .gitignore.
After initializing the git it's time to add some files to our project in my case testRepo
echo "This is git ReadMe file." > Readme
Now let's try to commit this Readme file to the local git repository. To do that, first of all, we need to add it using the following command
git add Readme or git add --all
Then you can see the status of the git at any time using git status command
git status.
To commit the latest changes to git local repository. Use following command,
git commit -m " Initial Release "
Now all the changes you made after creating the Git project are saved in the git local repository.

Pushing Code to the online repository using git push:

You can also make these changes available online by pushing these changes in any of your GitHub accounts. like GitHub or bitbucket.
So to push these changes to your cloud accounts or remote accounts. Use git push command like below

Before pushing any code, first of all, specify your online GitHub link.
git remote add origin
Now you specified your remote git account link. Now you need to push testRepo code to GitHub repo using git push command
git push -u origin master
This git push will push the local repository into the online repository. Now you can use these code from anywhere and you can give access to these repository to your friends and colleagues.

That's it. These are the very basic things about git.

Read More

Monday, November 14, 2016

Let's install zeromq from the source code. Go ahead and install the git and cmake. Then clone the zeromq github repo and install.

  • apt-get install git
  • apt-get install cmake
  • git clone
  • cd libzmq
  • mkdir cmake-build && cd cmake-build
  • cmake .. && make -j 4
  • make test && make install && sudo ldconfig

Read More

Wednesday, November 2, 2016

RPM creation from SPEC file and tar file :

To create any RPM we need the source code of the project. In my case I am trying to create the RPM for the RTPEngine, So I am using RTPEngine source code tar file.
To build the RPMs you need following packages, Go go ahead and install those packages.


Installing the rpm-build :

Once you installed packages, you are ready to install the RPM. the rpm-build package creates one folder called rpmbuild in /root/ directory.

rpm-build will automatically create the following directory structures that will be used during the RPM build.

# ls -l /root/rpmbuild/
drwxr-xr-x. 2 root root 4096 Oct  5 12:21 BUILD/
drwxr-xr-x. 2 root root 4096 Oct  5 12:21 BUILDROOT/
drwxr-xr-x. 2 root root 4096 Oct  5 12:21 RPMS/
drwxr-xr-x. 2 root root 4096 Oct  5 12:21 SOURCES/
drwxr-xr-x. 2 root root 4096 Oct  5 12:21 SPECS/
drwxr-xr-x. 2 root root 4096 Oct  5 12:21 SRPMS/

Download the RTPEngine tar file :

You can clone the rtpengine GitHub repo and create the tar file or simply follow the following URL it will download the RTPEngine 4.5 version tar file.

once you downloaded the tar file, Move it into the /root/rpmbuild/SOURCES/ folder.

Creating The SPEC file:

You can use SPEC file for the RTPEngine in the Tar file or you can write your own SPEC file. Here is my SPEC file. 

Building the RPM from the SPEC-File :

rpmbuild -ba  rtpengine.spec

You can also build RPM for the Tarball here is the command to use 

rpmbuild -ta ./rpmbuild/SOURCES/rtpengine-4.5.0.tar.gz

Once the RPM's are created, Those RPM's will be saved in the /root/rpmbuild/RPMS/  folder. This folder contains architecture folder, So search for appropriate architecture.

Installing the RTPEngine RPM's :

Once you built the RPM's you can install those RPM's using RPM command like below

to install the rtpengine daemon use the following command.

rpm -ivh rtpengine-mr4.5.1.1-0.el7.centos.x86_64.rpm

RTPEngine kernel module depends on the DKMS module so first install the DKMS module then install the kernel forwarding module like below.

rpm -ivh rtpengine-dkms-mr4.5.1.1-0.el7.centos.noarch.rpm

rpm -ivh rtpengine-kernel-mr4.5.1.1-0.el7.centos.x86_64.rpm

Note : 

You can also install those RPM's using yum localinstall command. As it will resolve all the dependencies automatically. 

yum localinstall rtpengine-mr4.5.1.1-0.el7.centos.x86_64.rpm
yum localinstall  rtpengine-dkms-mr4.5.1.1-0.el7.centos.noarch.rpm
yum localinstall rtpengine-kernel-mr4.5.1.1-0.el7.centos.x86_64.rpm

That's it. You successfully build the RTPEngine RPM's from SPEC file.

Read More

Monday, October 31, 2016

To view the commit history of the current project:
$ git log
sample output :

commit fb0d90ec75601304348168bb988ebdbf10c260

Author: Author name<>

Date: Thu Oct 13 17:30:46 2016 +0300

You will get the output like above, There is one unique identifier here that is hash, In above case it is 

so you can use this hash to go back to that version in any public repository.

So if you want to go to a specific git version use following command.

$ git checkout <checksum_hash>
$ git checkout fb0d90ec75601304eed98168bb988ebdbf10c260
Sample output :

Note: checking out 'fb0d90ec75601304eed98168bb988ebdbf10c260'.

You are in 'detached HEAD' state. You can look around, make experimental
changes and commit them, and you can discard any commits you make in this
state without impacting any branches by performing another checkout.

If you want to create a new branch to retain commits you create, you may
do so (now or later) by using -b with the checkout command again. Example:

  git checkout -b new_branch_name

HEAD is now at fb0d90e... Fix CANCELLing of transactions not forwarded.

now git status will give you are using detached version. Something like below.

$ git checkout <checksum_hash>
$ git status
HEAD detached at fb0d90e

Read More

Wednesday, October 12, 2016

How to redirecting cron job output to log file :

*/5 * * * *    /home/venkatesh/ >> /var/log/precampaign.log 2>&1

Note :
2>&1 indicates that the standard error (2>) is redirected to the same file descriptor that is pointed by standard output (&1).
Read More

Thursday, September 22, 2016

Read More

Tuesday, August 30, 2016

VSFTPD Installation on Ubuntu 14.04/16.04 :

Install the FTP server using the following command.
apt-get -y install vsftpd

Configuring VSFTPD Server :

Open the vsftpd Configuration File.

vim /etc/vsftpd.conf


# Make sure PORT transfer connections originate from port 20 (ftp-data).

# if you get 500 Internal error for ftp server add following line.

# if you get login incorrect error edit the pam_Service_name to ftp from vsftpd

make the above changes and save the file

Now Create the FTP user :

useradd -d '/var/www/html' -s /sbin/nologin ftpuser

change the password for the user.
passwd ftpuser

Now give all permissions on the home directory

chown -R ftpuser '/var/www/html/'
chmod 775 '/var/www/html/

Add to ftpusers group

groupadd ftpusers
usermod -G ftpusers ftpuser

Open the firewall port 21 for FTP
ufw allow 21

Now restart the vsftpd server
sudo service vsftpd restart

Then try to connect to the FTP server using any FTP client such as FileZilla with the ftpuser credentials.

Read More

About Our Blog

This Blog targets readers who want to understand C programming and Linux Essentials. All programming related posts and few jobs are published in this Blog.
Powered by Blogger.
back to top