≡ Menu

15 mysqlbinlog Command Examples for MySQL Binary Log Files

In MySQL or MariaDB, anytime you make a change to the database, that particular event is logged.

For example, when you create a new table, or update data on an existing table, those events are stored in the binary logs.

Binary log is very helpful in MySQL replication, where the main server will send the data from the binary logs to the remote servers.

You’ll also be dealing with binary log files when you are performing any kind of recovery operations in MySQL.

mysqlbinlog command is used to view the content of the binary log in a readable user friendly format. You’ll also use the mysqlbinlog command to read the content and pipe it to other mysql utilities.
(more…)

One of the important feature in Chromebook is that you don’t need to manually update the Chrome OS.

Chrome OS updates the OS in the background on an ongoing basis. This way, you’ll always be running the latest version of the Chrome OS.

But, there may few situations where you may want to view the current version of the Chrome OS, and if it is old, forcefully update Chrome OS to the latest version.
(more…)

7 Nginx Rewrite Rule Examples with Reg-Ex and Flags

Nginx RewriteAbility to change (rewrite) incoming URL into a different URL based on your criteria is an essential feature for any webserver.

Nginx rewrite is very powerful and flexible.

In this tutorial, we’ll explain the following examples on nginx rewrite:

  1. Nginx Rewrite Example Using $1, $2, ..
  2. Creating Controller File Using Nginx Rewrite
  3. Rewrite Break Flag in Location Context
  4. Adding Question Mark to Nginx Rewrite Replacement String
  5. If Context and Rewrite Directive
  6. Nginx Rewrite Flags Examples
  7. Capture Nginx Rewrite Hits in Error Log File

(more…)

389 Directory Server389 Directory Server is an open source enterprise LDAP Server.

This can handle very huge volume of data. One of the huge benefit of 389 LDAP server is that it is lighting fast and process upto handle several thousands of operations per second.

This has several advanced features including asynchronous multi-master replication for horizontal scaling, which in-turn provides provides 100% fault tolerance and extremely high throughput.

Also, keep in mind that this supports TLS, SASL for authentication and transport. 389 Directory server is fully LDAPv3 compliant.

This tutorial explains how you can install and configure 389 directory server on your Linux environment.
(more…)

AWS EC2 UserData CLIIn Amazon AWS, all the activities that you perform to manipulate your EC2 instances from AWS Console web interface can also be performed from command line using aws cli utilities.

The command is aws. You can use the ec2 option in the aws command to manipulate your ec2 instances.

This tutorial specifically covers about UserData in EC2. We’ve shown the CLI examples for the following:

  1. Launch a New EC2 Instance without UserData from CLI
  2. Create a new EC2 Server Instance with UserData from CLI
  3. View the UserData of an existing EC2 Instance from CLI

(more…)

SELinux chconIn SELinux, one of the frequent task that you may do is to change the security context of an object. For this, you’ll use chcon command.

chcon stands for Change Context.

This command is used to change the SELinux security context of a file.

This tutorial explains the following chcon command examples:

  1. Change the Full SELinux Context
  2. Change Context Using Another File as a Reference
  3. Change Only the User in SELinux Context
  4. Change Only the Role in SELinux Context
  5. Change Only the Type in SELinux Context
  6. Change Only the Range (Level) in SELinux Context
  7. Combine User, Role, Type, Level in chcon
  8. Default Behavior of Chcon on Symbolic Link
  9. Force Change SELinux Context of Symbolic Link
  10. Change SELinux Context Recursively
  11. Display Verbose Details of chcon Operation
  12. Chcon Default Behavior on Symbolic links for Recursive
  13. Force chcon to Traverse Specified Symbolic links for Recursive
  14. Force chcon to Traverse ALL Symbolic links for Recursive
  15. Chcon Behavior on / root directory for Systemwide Change

(more…)

In C++, the most common type of inheritance is public.

The public type of inheritance is used in order to broaden the parent class with some functionalities or some data members.

This type of public inheritance is sometimes called the ” is “, as the parent class and the child class are of the same type and that could be seen with conversions, where the child class has more to it, than parent one.

The private inheritance is of different type, it is of ” has ” type.

This means that private inheritance is suitable for situations in which we need to prevent main program to accidentally access some of the methods inherited from the parent class.

The protected inheritance is less restrictive than private and it is useful when we need some of the implementations from grand parent class.
(more…)

12 Essential Python For Loop Command Examples

Python For LoopFor loop is an essential aspect of any programming language.

In python, for loop is very flexible and powerful.

In this tutorial, we’ve explained the following Python for loop examples.

  1. Python For Loop for Numbers
  2. Python For Loop for Strings
  3. Python For Loop Using Default Range Function
  4. Python For Loop With Custom Start and End Numbers
  5. Python For Loop With Incremental Numbers
  6. Python For Loop Range with Negative Values
  7. Continue Statement Inside Python For Loop
  8. Break Statement Inside Python For Loop
  9. Can a For Loop itself have an Else without If?
  10. Else and Break Combination Behavior Inside Python For
  11. Nested For Loops in Python
  12. Handling List-of-Lists in Python For Loop

(more…)