April 20, 2014

Transferring Files using Netcat

Netcat is a great cross platform tool, it can be used for just about all things related to or involving TCP or UDP. Its most practical use is transferring files using Netcat from one machine to another via a network. Where non *nix people usually don’t have SSH installed or set-up, it is much faster to transfer files using Netcat than setup SSH. Netcat is just a single executable, and works across all platforms (Windows,Mac OSX, Linux).

On the Netcat receiving end

nc -l 1234 > out.file

This will start Netcat listening on port 1234.

On the Netcat sending end

nc -w 3 [destination] 1234 < out.file

This will connect to the receiver and begin transferring files using Netcat.

If you’d like to transfer files quicker (*nix only I am afraid), you can compress the file during sending process

On the Netcat receiving end

nc -l -p 1234 | uncompress -c | tar xvfp -

On the Netcat sending end

tar cfp – /some/dir | compress -c | nc -w 3 [destination] 1234

Install Nginx with PHP-FPM on CentOS 6

What is Nginx?

Nginx (pronounced “engine x”) is a free, open-source, high-performance HTTP server. Nginx is known for its stability, rich feature set, simple configuration, and low resource consumption.

What is PHP-FPM?

PHP-FPM (FastCGI Process Manager) is an alternative PHP FastCGI implementation with some additional features useful for sites of any size, especially busier sites.

Install the EPEL x86_64 YUM Repository

# rpm -Uvh http://download.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm

Install Nginx

# yum install nginx

Install PHP and PHP-FPM

# yum install php php-mysql php-fpm php-common

[Read more...]

Install yum priorities on CentOS

The Yum Priorities plugin can be used to enforce ordered protection of repositories, by associating priorities to repositories.

The priorities plugin is a useful tool if properly configured, and used with an understanding of the functionality and a recognition of the limitations and potential issues. It can be used in conjunction with the ‘exclude’ and/or ‘includepkg’ options, as well as the ‘enabled=0′ option to disable a repo by default. This can let you choose which packages a less important repo will supersede those of a more important one.

Install Yum Priorities

# yum install yum-priorities

[Read more...]

CentOS 6 NTP Server

It is important for systems administrators to make sure that mission-critical servers are always using the correct system time.

The ntpd (Network Time Protocol daemon) program is an operating system daemon which sets and maintains the system time of day in synchronism with Internet standard time servers. Make sure that the time zone configuration of your computer is correct. ntpd itself does not do anything about the time zones, it just uses UTC internally.
[Read more...]