March 2017
M T W T F S S
 12345
6789101112
13141516171819
20212223242526
2728293031  

Categories

March 2017
M T W T F S S
 12345
6789101112
13141516171819
20212223242526
2728293031  

How to use inotify-tools to trigger scripts on filesystem events

my last example of Bash if statements we created a backup script which would run “rsync” as per the time set in a cron.

But wouldn’t it be nice if we could run our “rsync” script only if there was a change to the files in our directory instead of running a cron every hour […]

Red Hat Enterprise Linux 6.8

“Red Hat Enterprise Linux 6.8 is always committed to fulfilling the company’s commitment to providing a solid foundation for driving the development and application of modern enterprise applications,” said Jim Totton, vice president and general manager of Red Hat. ” Critical mission deployment requirements Red Hat Enterprise Linux 6.8 continues to be a strong, solid […]

Linux performance tools

On Centos/RH yum install sysstat

vmstat -w 2 mpstat -P ALL 2 iostat -dxm 10

nmon: wget http://pkgs.repoforge.org/nmon/nmon-14g-1.el6.rf.x86_64.rpm rpm -ivh nmon-14g-1.el6.rf.x86_64.rpm

nicstat

wget http://nchc.dl.sourceforge.net/project/nicstat/nicstat-1.92.tar.gz untar yum install glibc.i686 ln -s .nicstat.RedHat_5_i386 .nicstat.RedHat_6_i386

Configuring File Replication in RHEL / CentOS / SL 6/7 with lsyncd and csync2

CentOS / SL 6/7 with lsyncd and csync2

Configuring File Replication in RHEL / CentOS / SL 6/7 with lsyncd and csync2

If you want some directory of yours actively backed after every change, they are a lot of sync options to choose from. Software like csync, rsync, csync2, lsyncd and many others will all […]

Apache Error: “semget: No space left on device”

semget: No space left on device

To see how many semaphores are being used, SSH to your server as root and run the following:

ipcs -s

In order to get Apache started again, we must clear the semaphores. Run this for-loop to flush them:

for whatever in `ipcs -s | awk ‘{print $2}’`; do ipcrm […]

OpenSSH: Client Information leak from use of roaming connection feature (CVE-2016-0777)

Overview

A flaw in OpenSSH, discovered and reported by Qualys on Jan. 14, 2016, could potentially allow an information leak (CVE-2016-0777) or buffer overflow (CVE-2016-0778) via the OpenSSH client. Specifically, an undocumented feature called roaming, introduced in OpenSSH version 5.4, can be exploited to expose a client’s private SSH key.

Impact

The roaming feature, which […]

Error: Cannot retrieve metalink for repository: epel. Please verify its path and try again

root@core /]# yum list Loaded plugins: fastestmirror Determining fastest mirrors Error: Cannot retrieve metalink for repository: epel. Please verify its path and try again

  [epel] … sslverify=false

sed -i “s/mirrorlist=https/mirrorlist=http/” /etc/yum.repos.d/epel.repo

Monit process

# mysql check process mysqld with pidfile /var/lib/mysql/ns388683.pid group database start program = “/etc/init.d/mysql start” stop program = “/etc/init.d/mysql stop” if failed host 127.0.0.1 port 3306 then restart if 5 restarts within 5 cycles then timeout # nginx check process nginx with pidfile /opt/nginx/logs/nginx.pid start program = “/etc/init.d/nginx start” stop program = “/etc/init.d/nginx stop” […]

MonitSMS

Create a new file named MonitSMS.sh in your /root directory (or wherever you prefer – i use root because I manage many different type of OS) and paste the following code:

#!/bin/sh /usr/bin/curl \ -X POST http://textbelt.com/text \ -d number=1111111111 \ -d “message=[$MONIT_HOST] $MONIT_SERVICE – $MONIT_DESCRIPTION”

Change 1111111111 to your cell/mobile phone number. Give it […]

useradd Not copying any file from skel directory into it.

Useradd in Linux – Not copying any file from skel directory into it useradd: warning: the home directory already exists. Not copying any file from skel directory into it.

If the directory didn’t exist , the Linux useradd process creates the directory and copies the skel files : .kshrc , .bashrc , .bash_profile and .bash_logout […]