Articles

  SSH/Transfer Files - Securely

Another important function of SSH is allowing secure file transfer using SCP and SFTP....

 Argument list too long error for rm, cp, mv commands

The reason this occurs is because bash actually expands the asterisk to every matching file,...

 Basic memcache security

Since most clients are not aware of the security risk that memcache represents, there is one...

 Can I change root's email address or forward it to an external address?

Simply create /root/.forward and place your email address in this file. It will be forwarded to...

 Changing the SSH Port for Your Linux Server

To Change the SSH Port for Your Linux Server Connect to your server via SSH (more info)....

 Check 301 http response with curl

You can dump the headers of the response with the -D option: curl -s -D - http://www.example.com...

 Check Which Folders Use The Highest Disk Space In Linux

Command du -h <dir> 2>/dev/null | grep '[0-9\.]\+G' Replace <dir> with your...

 DNS Resolution with resolv.conf

How do I edit the “/etc/resolv.conf” file?Use text editor such as vi or gedit from Linux...

 Exim Remove All messages From the Mail Queue

To remove all the message from exim queue  # exim -bp | exiqgrep -i | xargs exim -Mrm  To...

 Find & Grep

find . -name '*.py' -print0 | xargs -0 grep 'something' > output.txt

 Force www in .htaccess

Many customers at some point request to either force www or non-www version of their site to...

 Formats for /etc/mailhelo and /etc/mailips

You may use any command-line text editor such as vi (or vim), nano (or pico), to edit the files....

 How To Harden The Security Of /tmp Directory?

Users must take the following measures for hardening the /tmp directoryA. Creating /tmp as a...

 How To Install CSF Firewall

Installation is quite straightforward: cd /usr/src/ rm -fv csf.tgz wget...

 How To Install MariaDB on CentOS 6

MariaDB is a drop-in replacement for MySQL. It is easy to install, offers many speed and...

 How To Install Varnish 4 on CentOS 7

Varnish is a proxy and cache, or HTTP accelerator, designed to improve performance for busy,...

 How To: Automate Server Scripts With Cron

Servers can automatically perform tasks that you would otherwise have to perform yourself, such...

 How To: Back Up MySQL Databases From The Command Line

While automated backups are important, sometimes you just want to take a quick and dirty snapshot...

 How do I display all URLs in a redirect chain?

SImply use wget with grep.  Example: $ wget http://picasaweb.google.com 2>&1 | grep...

 How do I set path for open_basedir with php.ini?

To edit the open_basedir paths, open php.ini and add your directories using this format:...

 How do I switch my DNS resolvers away from Google?

Recently many users have had issues with Google's DNS resolution, which have really highlighted...

 How to Check CentOS Version

The easiest way to check your CentOS version is via the command line. Login to your CentOS...

 How to Delete Files Older than 30 days in Linux

This is the best practice to remove old unused files from your server. For example, if we are...

 How to Delete matching files in all subdirectories

Remove all *.swp files underneath the current directory, use the find command in one of the...

 How to Display (List) All Jobs in Cron / Crontab

View Root’s Cron Jobs crontab -l  View a User’s Cron Jobs crontab -u username -l Example with...

 How to Install ImunifyAV on Cpanel Server

you can use the following command, which works on Cpanel, Plesk, and DirectAdmin server wget...

 How to List Which Apache 2 Modules are Enabled on Fedora 21

The Apache web server is one of the most popular and powerful web servers in the world due to its...

 How to Modify the "max_connections" Value in MySQL

To make these changes permanent you need to add the following line to your main MySQL...

 How to Restart OpenVPN

The exact method you use will depend on your OS, and whether you start as a service or not.Centos...

 How to automate SSH login?

Don't use a password. Generate a passphraseless SSH key and push it to your VM. If you already...

 How to backup MySQL database on a remote server?

When you have access only to MySQL database existing on a remote server and not SSH or FTP - this...

 How to check listening ports with netstat

Check ports To list the TCP ports that are being listened on, and the name of each listener’s...

 How to check os version in Linux command line

Check os version in Linux The procedure to find os name and version on Linux: Open the...

 How to clear swap memory in Linux

To clear the swap memory on your system, you simply need to cycle off the swap. This moves all...

 How to disable entity tags (ETags)

DISABLING ETAGS To disable sending entity tags in the HTTP headers, add the following two lines...

 How to enable Nginx as reverse proxy in Plesk 12

Tested Environment:  Centos 7Plesk Version: 12 Overview:  Apache with Nginx Nginx, a...

 How to find sending spam emails and enable mail header in php.ini

- In Linux servers if there are a lot of emails in the queue "over 100" emails. you can check if...

 How to find the public IP address from command line

Here is how to find the public IP address from command line. You first need to install curl as...

 How to redirect HTTP traffic to HTTPS using an .htaccess

The below code when added to an .htaccess file will automatically redirect any traffic destined...

 How to restore cpanel backup with new username?

Everybody knows, how to restore the cpanel backup using scripts command but most of us doesn’t...

 How to test keep-alive is working on client end

You can use Curl like this: curl -Iv http://www.aptivate.org 2>&1 | grep -i 'connection...

 How to update snap-store linux

$ killall snap-store$ snap refresh

 How to use du to see files greater than a threshold size

To only show folders over 1GB in size: du -h --threshold=1G You may also want to order by size,...

 IP canonicalization via htaccess

You generally don't want to mix Redirect (mod_alias) with RewriteRule (mod_rewrite) because they...

 Install memcache

Step 1: Login into your WHM panel and using easyapache enable Memcache Step 2: SSH into...

 Kill all processes running by a partition

In some occasions you ould need to kill all the process running by a partition in order to umount...

 PHP.INI settings Disable exec, shell_exec, system, popen and Other Functions To Improve Security

Open a terminal application or login to your server over the ssh session using ssh command. Open...

 PHP.INI settings Disable exec, shell_exec, system, popen and Other Functions To Improve Security

PHP has a lot of functions that can be used to crack your server if not used properly. You can...

 PHP: Is it safe to add /usr/bin to open_basedir?

No, it isn't safe to add /usr/bin to open_basedir. Once an attacker can execute arbitrary PHP...

 Page Speed: Enable gzip compression

What is gzip compression? When a user hits your website a call is made to your server to...

 Secure Apache from Clickjacking with X-FRAME-OPTIONS

Clickjacking is a well-known web application vulnerability. To defend against the Clickjacking...

 Server Benchmark Scripts To Test VPS Performance

Yet Another Benchmark Script (YABS) Created by MasonR, what the script does are: Fetching...

 Setting up a permanent 301 redirect via .htaccess

A permanent 301 redirect in your .htaccess file lets search engines and others know that a old...

 Temporary redirect to maintenance page

RewriteEngine On RewriteBase / RewriteCond %{REQUEST_URI} !^/maintenance\.html$ RewriteRule...

 Ubuntu: “Failure to download extra data files” after installing ttf-mscorefonts-installer

Solution 1: Connect to the internet and run this command below, to fix the error sudo apt-get...

 Unzip Multiple Files in Linux

Let us suppose that a folder, a “zip_files” folder in our case, contains multiple zipped files...

 Using MYSQLTUNER

MySQLTuner is a script written in Perl that allows you to review a MySQL installation quickly and...