How To Write Infinite Loop in BashNovember 18th, 2007 This is how you create an infinite loop in bash to run a piece of code perpetually at pre-defined intervals.
#!/bin/bash
while [ 1 ]
do
# Your code goes here
# Modify sleep time (in seconds) as needed below
sleep 2
done
For example I used this code to write a bash script to monitor long running mysql queries.
How To Find Bash Script Directory Within ScriptSeptember 14th, 2008 One of the common challenges bash script writers face when writing a script which references files in the same directory (or its sub-directories) as the script file. As the script can be called from anywhere, you cannot use the current directory to refer to the files.
Relational Database Management System to use for Enterprise Software DevelopmentAugust 9th, 2005 As an architect I have often been asked this question by my clients, friends and at work. I would like to answer it briefly once and for all.
How To Use AWK To Simplify Scripting: Multi-Database Backup ExampleApril 20th, 2008 AWK is an extremely versatile and powerful language for processing files and text data. Often you can use awk to perform complex tasks on Unix / Linux / Mac OS command line which would otherwise take a full-fledged programming effort.
How To Enable/ Disable Auto Reconnect in MySQLJuly 20th, 2007 What is auto reconnect in MySQL?
The MySQL client library can perform an automatic reconnect to the server if it finds that the connection is down when you attempt to send a statement to the server to be executed. In this case, the library tries once to reconnect to the server and send the statement again.
Object Oriented Code Generator for PHP-MySQL Web ApplicationsFebruary 17th, 2006 MyDBO is an object-oriented code generator for PHP-MySQL Web application developers. It is designed to automate CRUD operations when creating Web applications.
How to Update or Change Password for a Single User in MySQL and Reload PrivilegesJanuary 17th, 2009 MySQL stores usernames and passwords in the user table inside the MySQL database. You can directly update a password using the following method to update or change passwords:
1) Login to the MySQL server, type the following command at the shell prompt:
$ mysql -u root -p
2) Use the mysql database (type commands at the mysql> prompt):
mysql> use mysql;
3) Change password for a user:
mysql> update user set password=PASSWORD("newpass") where User='YOUR-USER-NAME';
4) Reload privileges:
mysql> flush privileges;
mysql> quit
[P.S.
MySQL Tip: How To Check, Repair & Optimize All Tables in All DatabasesApril 20th, 2008 Here is a simple command to auto repair, check and optimize all the tables in all databases running on a MySQL server:
mysqlcheck -u root -p --auto-repair --check --optimize --all-databases
mysqlcheck is available in MySQL 3.23.38 and later. mysqlcheck uses the SQL statements CHECK TABLE, REPAIR TABLE, ANALYZE TABLE, and OPTIMIZE TABLE in a convenient way for the user.
How To Migrate Mantis Defect Tracking System From Windows To Linux / Fedora Core 6May 12th, 2007 Mantis is popular php based defect tracking application which works on top of RDBMS like MySQL and PostgreSQL. Recently I ported our Windows based Mantis installation to Linux.
How to Backup & Restore MySQL DatabaseMay 13th, 2005 Note: My WordPress database name is wordpress. I will use it in the example below.
How to Recover MySQL Root PasswordJanuary 17th, 2009 Do you want to recover the MySQL root password. its by no means, easy.
How To Backup PmWiki in Subversion (Code)October 8th, 2007 PmWiki is a popular wiki software which uses the file system to store wiki pages. We use for our intranet and to document our processes and systems.
Sun Restricts MySQL Query Analyzer Tool To Gold Subscribers OnlyNovember 25th, 2008 The MySQL Query Analyzer tool monitors query performance and quickly pinpoints and corrects problems in SQL code. It promises to "turbo-boost" the speed and uptime of MySQL database applications.
How To Test Master-Master / Master-Slave / Standard / Circular Replication on MySQLSeptember 1st, 2007 Working with replication systems is not easy. Learning and testing different kind of MySQL replications and fine-tuning it to your specific needs is a time-consuming endeavor.
How do I Enable Remote Access To MySQL Database?April 27th, 2009 Suppose you want to change and enable the remote access to MySQL DB on your linux server (Debian). By default, you don't get such privileges so you will have to work your way through this.