≡ Menu

How to Use Friend Modifier in C++ with Example Code

You would consider someone as your friend, if you trust him/her and thereafter you would grant your friend some higher level of privilege.

Some might say a friend of your friend is also your friend. But, as we will see that is not that case in C++.

In C++, you should exactly state who you trust. This way, you would have more control on your friends, as well as they could have more restrictions on you as a friend.
(more…)

How to Setup Nginx Reverse Proxy to Apache/PHP on Linux

Nginx can be used as a front-end to an Apache/PHP website. For this, we need to setup Nginx as a reverse proxy.

For example, let us say we have an enterprise application that is running on Apache and PHP on app.thegeekstuff.com, and we also have Nginx running on example.com.

In this example scenario, when someone goes to example.com, we can setup Nginx as a reverse proxy so that it will serve the enterprise apache/php application that is running on app.thegeekstuff.com.

But, for the end-user, they’ll only see example.com, they won’t even know anything about app.thegeekstuff.com. End-user will think the whole apache/php application is getting served directly from example.com.
(more…)

How to Connect to MySQL Database from Python With Example

From a Python program, you can connect to MySQL database to access the tables and manipulate your data.

For this, you should use one of the Python MySQL Libraries. While there are few of these libraries available, the most popular and stable is mysql-connector-python library.

The mysql-connector-python library uses APIs that are complaint with the Python Database API Specification v2.0 (PEP 249). Also, this library by itself is written in python program and does not have any other external dependencies, which makes it easier to maintain.

This tutorial explains how to install mysql-connector-python library. We’ve also provided a sample python program that shows how to use the API to connect to a MySQL database and retrieve data from tables.
(more…)

Jenkins is an open source automation server, which will help you to build, deploy and automate your enterprise application.

In Jenkins, after the install, it will launch a setup wizard and walk you through the initial security setup.

But, if you like to create user accounts and restrict their privileges, you need to setup appropriate Jenkins security authorization.

This tutorial covers the following two aspects of Jenkins Security:
(more…)

11 Essential MySQL Update Command Examples

mysql-logoOne of the most common MySQL operation is to change an existing value of a record in a table.

In this article, we’ll explain how to use MySQL update command along with some helpful examples.

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

Chef Cookbook Directory Structure Explained with Examples

Chef LogoWhen you create a new Chef cookbook, it will automatically create certain directories and files. You’ll then be adding your own custom files on top these default files and directories.

For every chef cookbook you create, you’ll see 8 directories and 3 files under the top-level for that particular cookbook.

In this tutorial, we’ll explain the purpose of all the chef cookbook directories and files.
(more…)

Q: I have multiple yum repositories on my system. For example, centos, epel, docker, mongo, etc. When I execute yum update command, installed packages from all the repositories are updated. How can I exclude a specific repository during yum update?

A: During yum update, to exclude packages that belongs to a specific repository, use any one of the two methods explained in this tutorial.
(more…)

By default MySQL database will be created under /var/lib/mysql directory.

This might be Ok if you are running a small database that doesn’t take much space. But on production, for a larger database, you might not have enough space under root partition.

In that case, you may want to move your MySQL database from root partition to a different partition.

To change the MySQL directory, on a high level, you have to perform the following three steps:
(more…)