Category Archives: BASH

VMWare Workstation start on boot CentOS

EPEL CentOS 7 – Add Fedora EPEL repository

EPEL CentOS 7

EPEL CentOS 7 – In the next tutorial I will show you how to add the fedora EPEL repository to your CentOS 7 installation

.

Applicable to

  • Centos 7.x, but also to CentOS 6.x (and probably earlier)

 

Requirements

In order to install CentOS EPEL Repository you need:

  • root access
  • wget:
yum install wget -y

 

Installation

check here for latest version of epel-release-x-x.noarch.rpm

wget http://mirror.nonstop.co.il/epel/7/x86_64/e/epel-release-7-5.noarch.rpm
rpm -Uvh epel-release-7-5.noarch.rpm
rm epel-release-7-5.noarch.rpm -f

or in short:

rpm -Uvh http://mirror.nonstop.co.il/epel/7/x86_64/e/epel-release-7-5.noarch.rpm

Verify

use:

yum repolist

to check that the repo installed correctly.

centos-epel-repolist

That’s it! You’ve added CentOS EPEL repository to your centos installation.

 

How to use?

yum --enablerepo=epel install [package]

for example:

yum --enablerepo=epel install zabbix

Note: The epel configuration file is located under /etc/yum.repos.d/epel.repo.

 

That’s it

Development Specialist, Artist and Activist
Personal Website
VMWare Workstation start on boot CentOS

CentOS 7 VirtualBox Guest Additions Installation

CentOS 7 VirtualBox Guest Additions Installation Tutorial

In the following tutorial, I’ll demonstrate how to install Guest Additions on your VirtualBox hosted CentOS 7 Minimal machine.

Although this tutorial is intended for CentOS 7 minimal, it’s will probably also work on other CentOS releases.

Update your VirtualBox

VirtualBox 4.3.12 or later is required for support in CentOS 7.x, So if you’re using older version of VirtualBox – it’s time for you to upgrade.

Update and Reboot system

After successful installation of your new and shining CentOS box, CentOS-7-installation-VirtualBox

Important Before anything!, I’d advice you to update your CentOS & reboot:

yum update
reboot

After, also try to update your kernel and reboot:

yum update kernel
reboot

You will need to be the root user for the following routine or “su -”

Prerequisities

In order to compile the guest additions you have to install make, gcc, kernel-devel in order to Install VirtualBox Guest Additions installation script.

yum install gcc make kernel-devel

OR, I’ll recommend installing the entire “Developer tools” group which will help you to avoid a lot of trouble later:

yum groupinstall "Development tools"
yum install kernel-devel

Install VirtualBox Guest Additions

Mount your guest additions:

VirtuallBox-MountGuestAdditions

Type at command::

cd /mnt
mkdir cdrom && mount /dev/cdrom /mnt/cdrom
cd cdrom && ./VBoxLinuxAdditions.run

centos-7-guest-additions

If everything “OK” – You have Guest Additions properly installed on your Centos (Minimal) machine. now Reboot:

reboot

 

That’s it!

 

Development Specialist, Artist and Activist
Personal Website
bash

tr vs sed – String manipulation commands in Linux/Unix

Overview

tr and sed are very powerful stream and character manipulation commands, Each has its own advantage with string manipulation.
tr vs sed - String manipulation commands in Linux/Unix
 

tr vs sed usage and examples

Replace “hi” with “bye”

echo "hi hi" | sed 's/hi/bye/g'
output: bye bye

echo "hi hi" | tr 'hi' 'bye'
output: by by

While sed can replace strings tr can only replace characters,
so with complete string replacement sed is the way to go.
 
Replace “good” with “bad”
echo "good good" | sed 's/good/bad/g'
output: bad bad

echo "good good" | tr 'good' 'bad'
output: bddd bddd

tr is more like a mapping command, it’s like a set of rules:
The char “g=b”, the char “o=a”,”o=d” the last one will be the active one “o=d”.
 
Change ‘ ‘ to a new line:
echo "line1 line2" | tr ' ' '\n'
output:
line1
line1

echo "line1 line2" |sed -e 's/\s\s*/\n/g'
output:
line1
line1

 
As you can see tr is a lot easier for this job.
 
 
Enjoy.
centos-logo

VMware Tools CentOS 6.x easy installation guide.

VMware Tools CentOS 6.x easy installation guide.

Prerequisities

if you have installed new setup of centos or you haven’t installed yet, you need make, gcc, kernel-devel..

Continue reading

Development Specialist, Artist and Activist
Personal Website
bash

Linux fg bg commands usage and examples

Overview

Linux fg bg commands usage and examples using CTRL-Z and jobs command.
Move a process between background and foreground modes with paused and running states.

Usage and examples

Pause a process

When running a process you can use CTRL-Z to pause the process and free the current shell instance:
Linux fg bg commands ctrl-z-stop

Linux jobs command

To view the stopped jobs use the jobs command:

jobs

You should receive something like this (Job number, Status, Command):
[1]+  Stopped                 ls --color=auto -l --color=auto -lla -R /

Run a process in the background

You can start a process in the background from the start using an ‘&’ mark at the end of the command:

cp /source /destination &

linux fg bg commands

To move a job to the foreground execution (for example job 1):

fg 1

To move a job to the background execution (for example job 1):
bg 1

Kill paused jobs

To kill a paused job you can use the kill command followed by the job number (for example job 1):

kill %1

Enjoy

bash

Load Balancing SSH Connections using Pen on CentOS Linux

Overview

Load Balancing SSH Connections using Pen, a load balancer for “simple” tcp based protocols such as http or smtp.
It allows several servers to appear as one to the outside and automatically detects servers that are down and distributes clients among the available servers. This gives high availability and scalable performance.

Continue reading

bash

Load balancing Remote Desktop Services using Pen

Overview

Load balancing Remote Desktop Services using Pen, a load balancer for “simple” tcp based protocols such as http or smtp.
It allows several servers to appear as one to the outside and automatically detects servers that are down and distributes clients among the available servers. This gives high availability and scalable performance.

Continue reading

bash

Backup Multiple MySQL Databases using a BASH script

Overview

In this tutorial I will give an example to a BASH scripts that will help you backup multiple MySQL databases at once.

Backup Multiple MySQL Databases using a BASH script

Continue reading

bash

Batch Sort Folders by Size With Linux DU

Overview

Use Linux DU to batch check and sort folder sizes in Linux.
You can also use Linux DU command on a Windows share or a NAS CIFS/NFS share.

Linux DU

Continue reading

VMWare_Zimbra

VMware Zimbra Active Directory User Mailbox Sync

Overview

Zimbra Active Directory User Mailbox Sync script uses Zimbra utility to Add or Remove mailboxes according to the AD User List.
You can sync all AD users at once or Create a Security Group And add members in order to assign a mailbox.

VMWare Zimbra Active Directory Sync

Continue reading