Enable or Disable Check Constraints on SQL Server

I found a very handy SQL script on this post, that allows you to enable or disable all constraints on a database. The only problem I had was that my database uses schemas to organize the tables, so the script failed to work.

I made a modification on the script to solve the problem, so [...]

Count the total number of records on a MySQL database or per table

To count the total number of records on a MySQL database, we could run the following command:

SELECT SUM(TABLE_ROWS) FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA = ‘{tablename}’;

If we need to know the number of records per each table, we can run:

SELECT TABLE_NAME, TABLE_ROWS FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA = ‘{tablename}’;

Source: Stack Overflow

Duplicate a MySQL database on a single line

On this article, it is shown a very convenient way to duplicate a complete MySQL database using a single line of code:

$ mysqladmin create {dest_db_name} -u {username} –password={password} && \ mysqldump -u {username} –password={password} {source_db_name} | \ mysql -u {username} –password={password} {dest_db_name}

Where:

{dest_db_name}: Name of the destination database. {source_db_name}: Name of the database [...]

Nginx and Munin

To be allowed to show Nginx graphs on the Munin report, it is required to enable nginx status and to listen on:

http://127.0.0.1/nginx_status

To do this, we just need to add the following code on /etc/nginx/sites-enabled/default or into any other site file (like create a new one /etc/nginx/sites-available/status and then make symbolic link to site-enabled [...]

Install VMWare ESXi using a USB flash drive

Today, I decided to try the VMWare ESXi, the free bare metal virtualization product of VMWare, on an old Pentium 4 3.2GHz PC (with 2.5GB of RAM), and run on top of it, some Ubuntu servers.

I was not able to use the latest version (4.x) of the ESXi as it only works on [...]

No DEFAULT or UI configuration directive found

When I tried to run the VMWare ESXi installer from a USB stick (after creating the installer on a USB from the ISO), I got the following error:

SYSLINUX 3.85 2010-02-20 CBIOS Copyright (c) 1994-2010 H. Peter Anvin et al No DEFAULT or UI configuration directive found! boot:

The solution was pretty simple thanks to [...]