Tag 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

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.

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

Tiny Core Linux Remote Desktop Kiosk

Overview

THIS TUTORIAL ONLY SUPPORTS TINYCORE 4
FOR TINYCORE 5 THERE IS A SOLUTION IN THE COMMENTS BELOW BY Alejo


Tiny Core Linux is one of the smallest Linux distributions out there.
We will show you how to customize Tiny Core Linux Remote Desktop Kiosk so it will automatically launch a Remote Desktop client and set a Static IP address.
Continue reading

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

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

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

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 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

VMWare Workstation start on boot CentOS

Centos EPEL – Howto add EPEL repository to your Centos 6.x

Centos EPEL

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

.

Applicable to

  • Centos 6.x

 

Requirements

In order to install CentOS EPEL Repository you need:

  • root access
  • wget:
    yum install wget

 

Installation

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

wget http://mirrors.nl.eu.kernel.org/fedora-epel/6/i386/epel-release-6-8.noarch.rpm
rpm -Uvh epel-release-6-8.noarch.rpm
rm epel-release-6-8.noarch.rpm -f

or in short:

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

 

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

Development Specialist, Artist and Activist
Personal Website

SSH connection without password between two linux machines

Overview

How to establish SSH connection without password between two linux/unix machines

SSH connection without password between two linux machines

Instructions

  1. Generate the files: [id_rsa], [id_rsa.pub] in the First Machine by typing at command (do not use a password – just hit Enter*) :
    ssh-keygen


    * You don’t want to enter any passwords, because you want to call ssh from a within a shell script.
    ** The randomart is an easier way for humans to validate keys.
  2. Copy (and rename) id_rsa.pub to authorized_keys on Server (run from the same computer you run ssh-keygen);
    scp -r -P 22 /root/.ssh/id_rsa.pub destination:/root/.ssh/authorized_keys
     

    Where destination is server B.

Now you can connect as root without a password between the servers.

Development Specialist, Artist and Activist
Personal Website