≡ Menu

hard diskIf you are a sysadmin, managing your Linux server’s hard disk partition is a critical task.

In this tutorial, we’ll focus on how to use sfdisk command-line utility to manage your hard disk partitions.

While sfdisk is similar to fdisk, there are few partition manipulation activities that are very easy to perform in sfdisk. For example, you can create new partitions in an non-interactive method using sfdisk.

The following sfdisk activities are covered in this tutorial:
(more…)

Sometimes when you do a git push, you might get the following permission error message.

This error typically happens when multiple users are working on a particular git repository.

The following git push error indicates that it doesn’t have enough permission for adding a new object to the ./objects directory under your repository.

Apart from the obvious permission issue, there is also another underlying problem that needs to be addressed, which is explained in this tutorial.
(more…)

PuTTY PlinkPlink stands for PuTTY Link.

Plink is a companion command-line utility for PuTTY.

On a very high-level:

  • Use PuTTY for interactive SSH session from your Windows to Linux Servers
  • Use Plink for non-interactive SSH session to execute remote linux commands for automation purpose from your Windows

(more…)

3 Methods to Connect to MySQL from PHP using Example Code

To get most out of your MySQL database, it is important to understand how to connect from your custom PHP program to MySQL database.

This tutorial explains the following three methods along with appropriate example PHP program, which will explain how to connect from your PHP to MySQL database.

  • Connect using mysqli extension (Recommended)
  • Connect using PDO (Recommended)
  • Connect using traditional legacy mysql_ functions (Deprecated)

For this, you should install php-mysql package.
(more…)

Nginx LocationIf you are running Nginx webserver, it is important for you to understand how the location directive works.

Nginx uses location directive to decide what configuration it should apply based on prefix or the pattern in the incoming URL.

For example, from what directory it should serve the image files when an URL ends with *.gif or *.png or any other image filename extension.

In this tutorial, we’ll explain the following with proper examples:

  1. Default Location Directive Setup
  2. Change the Default Nginx Root Location (i.e DocumentRoot)
  3. Define Custom 404 Page Not Found Using Location
  4. Define Multiple Custom 50x Server Errors using Location
  5. Serve Your Website Images from a Custom Location
  6. Exact Match Using = (Equalto Sign) Location Modifier
  7. Case-Sensitive Regular Expression Match Using ~ (Tilde Sign)
  8. Case-InSensitive Regular Expression Match Using ~* (Tilde-Asterisk Sign)
  9. ^~ Best Non RegEx Match (Carat-Tilde Sign)
  10. Nginx Location Related Error Messages
  11. Summary of Location Modifiers
  12. Define Custom Named Location Using @ (At Sign)
  13. Nginx Location Matching Processing Sequence and Logic

(more…)

Jenkins is an open source DevOps tool that will help you to deploy and automate your enterprise application.

In Jenkins, by default you can create users, but not groups.

So, if you want groups in Jenkins, you have the following few options:

  • Use OpenLDAP with Jenkins
  • Use Active Directory with Jenkins
  • Use Unix user/group database. This will use PAM library to integrate with Jenkins.
  • Use “Role-based authorization strategy” plugin for Jenkins

(more…)

PostgreSQL LogoPostgreSQL is an enterprise level open source database.

This is one of the most reliable, robust, feature-rich, and powerful relational database system.

Most importantly, PostgreSQL is well known for its ability to handle heavy load, and deliver high performance. This supports pretty much all the features that you would ever need from a RDBMS system.

If you are new to PostgreSQL, this tutorial will give you an excellent jump-start.
(more…)

How to SSH to AWS EC2 Instance from PuTTY using PEM Key Pair

In AWS, when you launch any EC2 Linux instance, you should select a key pair for that particular instance.

AWS key pair will be in the standard private key format with .pem file extension

But if you are using PuTTY on your Windows laptop to login to AWS instance, you have a problem.

PuTTY doesn’t support PEM format. PuTTY understands only it’s own PPK format.

PPK stands for Putty Private Key.
(more…)