Bài đăng

Đang hiển thị bài đăng từ Tháng 1, 2015

Insert/Add String to Beginning of a File

Inserting a String to Beginning of File Suppose you had a text file with the contents and you wanted to insert a string to the beginning: 1st line 2nd line 3rd line Run the command: sed -i '1s/^/<add text > \n/' file.txt Now the file will look like this: Top of the file! 1st line 2nd line 3rd line

Pydio

Hình ảnh
What is Pydio? Pydio is open source software that turns instantly any server (on premise, NAS, cloud IaaS or PaaS) into a file sharing platform for your company. It is an alternative to SaaS Boxes and Drives, with more control, safety and privacy, and favorable TCOs. Link: https://pyd.io/download/ As easy to use as great consumer software, Pydio is designed to provide enterprise grade security and control. Unbelievably easy to install for System Administrators, Pydio connects instantly to your existing employee directories.  Simple, Sleek, Beautiful.  Access your docs from anywhere, from any browser.  Most common formats previews (audio, video, PDF, Office Documents)  Native mobile applications for iOS  and Android  - WebDAV server embedded  Lucene indexation for quick search  The ultimate sharing machine  Share files or folders as weblinks with outside world  Secure links with a pass...

Reading File Line by Line in Linux Shell Script

Read File Line by Line: while read line do echo $line done < /tmp/file.txt Note: “ line ” is a variable which contains a  single  line read from file. Example:- Some times we required to read file content line by line inside shell a script. For this example this script will read /etc/passwd file line by line and print usernames with there corresponding home directory. #!/bin/bash while read line do USERNAME=`echo $line | cut -d":" -f1` HOMEDIR=`echo $line | cut -d":" -f6` echo "$USERNAME => $HOMEDIR" done < /etc/passwd

Set Up Hadoop Multi-Node Cluster on CentOS 6

Hình ảnh
The Apache Hadoop software library is a framework that allows for the distributed processing of large data sets across clusters of computers using simple programming models. Our earlier  article  about hadoop was describing to how to  setup single node cluster . This article will help you for step by step installing and configuring Hadoop Multi-Node Cluster on CentOS/RHEL 6. Setup Details: Hadoop Master: 192.168.1.15 ( hadoop-master ) Hadoop Slave : 192.168.1.16 ( hadoop-slave-1 ) Hadoop Slave : 192.168.1.17 ( hadoop-slave-2 ) Step 1. Install Java Before installing hadoop make sure you have java installed on all your systems. If you do not have java installed use following article to install Java. Steps to install JAVA on CentOS 5/6 or RHEL 5/6 Step 2. Create User Account Create a system user account on both master and slave systems to use for hadoop installation # useradd hadoop # passwd hadoop Changing password for user hadoop. New password: Retype ...

How to Setup DomainKeys (DKIM) with Postfix on CentOS, RHEL

Hình ảnh
DKIM (DomainKeys Identified Mail)  is a method of signing electronic emails using public private key. DKIM is used by receiving mail server for identifying email, that they are sent by authorized mail servers. It also minimize the possibility of getting emails SPAM. This tutorial will provide you a quick and easy way to set up DomainKeys with your  POSTFIX running on CentOS and RHEL systems. How DKIM Works ? When we configured DKIM on sending servers. First we generated a public/private key pair for signing outgoing messages. Public key is configured as TXT record on domains name server, and the private key is configured in outbound email server. When an email is sent by an authorized user of the email server, the server uses the stored private key to  generate  a digital signature of the message, which is inserted in the message as a header, and the email is sent as normal. Step 1: Install DKIM-milter First make sure you have  enabled EPEL  re...

Apache MPM Worker and PHP-FPM on CentOS

Introduction A LAMP server is one of the most used configurations of the GNU/Linux operating system. And being Wordpress the most used CMS to power Internet sites, it is not surprise that Apache + PHP + MySQL is mostly used to power Wordpress installations. Apache can work in different modes, being prefork the most used one, but worker is more efficient. Read more about  differences between prefork and worker MPM I have shown in the past  how to install Apache MPM Worker and PHP-FPM on Ubuntu , because Ubuntu and Debian is what I use the most. But a friend asked me how to do it for CentOS, so, here we go. Installing Apache MPM Worker with PHP-FPM and MySQL on CentOS This have been tested on CentOS 6, and more specifically on a 64 bits installation on a Digital Ocean VPS. First we need to add one repository. rpm --import http://dag.wieers.com/rpm/packages/RPM-GPG-KEY.dag.txt cd /tmp/ wget http://pkgs.repoforge.org/rpmforge-release/rpmforge-release-0.5.3-1.el6.rf.x...

Understanding Apache 2 MPM (worker vs prefork)

From time to time I want to learn more about stability and high availability web servers. I usually get a sandbox site where I start to play with configurations. This time all started because I also like testing service providers, and this week I have been moving my site between  Site44  and  NearlyFreeSpeech  to test its features for static sites. Finally in order to test how Apache may work when serving static files (I usually use Nginx for that matter) I installed Apache 2.2 on an Ubuntu 12.10 server (Linode). After doing that I headed to  blitz.io  and tested my Apache 2.2 serving static files. To my surprise it served without a sweat for one minute a page with user concurrency of 250 users per second. The next day I tried to install a Wordpress site on the same server, as soon as I tried to install php, apt told me that it was going to uninstall  apache2-mpm-worker  and install apache2-mpm-prefork  instead. I instructed apt to d...