November, 2008

How to Configure 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. Automatic reconnection can be convenient [...]

How To Quickly Analyze All Tables in MySQL Database

ANALYZE TABLE analyzes and stores the key distribution for a table. The MySQL query optimizer is the magic inside MySQL that decides which keys, if any, to use to in the query. ANALYZE helps query optimizer to make accurate decisions by detailed analysis of the data, unlike query optimizer which makes quick analysis. The command [...]

How To Check, Repair & Optimize All Tables in All Databases

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 [...]

How to Identify the version of the SG driver

Earlier versions of the sg device driver either have no version number (e.g. the original driver) or a version number starting with “2″. The drivers that support this new interface have a major version number of “3″. The sg version numbers are of the form “x.y.z” and the single number given by the SG_GET_VERSION_NUM ioctl() [...]

What the sg driver does?

The sg driver permits user applications to send SCSI commands to devices that understand them. SCSI commands are 6, 10, 12 or 16 bytes long [1]. The SCSI disk driver (sd), once device initialization is complete, only sends SCSI READ and WRITE commands. There a several other interesting things one might want to do, for [...]

How to View Your MySQL Database’s Table Structure

The describe command gives you a list of all the data fields used in your database table. In the example, you can see that the table named test in the salesdata database keeps track of four fields: name, description, num, and date_modified.

How to List the Data Tables In Your MySQL Database

The show tables command gives you a list of all the tables in your MySQL database, but you have to use the use command first to tell MySQL to which database it should apply the show tables command.

How to Run MySQL Scripts To Create Data Tables

Another common feature of prepackaged applications written in MySQL is that they may require you to not only create the database, but also to create the tables of data inside them as part of the setup procedure. Fortunately, many of these applications come with scripts you can use to create the data tables automatically. Usually [...]

How to Restrict Access to specific Web sites with Squid Proxy

You can limit users’ ability to browse the Internet with access control lists (ACLs). Each ACL line defines a particular type of activity, such as an access time or source network, they are then linked to an http_access statement that tells Squid whether or not to deny or allow traffic that matches the ACL. Squid [...]

How to Restrict Web Access By Time in Squid

Users configure their web browsers to use the Squid proxy server instead of going to the web directly. The Squid server then checks its web cache for the web information requested by the user. It will return any matching information that finds in its cache, and if not, it will go to the web to [...]

How to configure Transparent Proxy With Bridging

If you are trying to setup a transparent proxy on a Linux machine that has been configured as a bridge, you will need to add one additional iptables command to what we had in section 5. Specifically, you need to explicitly allow connections to the machine on port 3128 (or any other port squid is [...]

How to define a Secure Virtual Host – Apache

Setting up virtual hosts is fairly straightforward. I will go through the basics of setting up a secure virtual host. In these examples, I use the .crt and .key file extensions. That is my personal way of avoiding confusion with the various files. With Apache, you can use any extension you choose – or no extension at all. All [...]

How SSL Works

The SSL protocol includes two sub-protocols: the SSL record protocol and the SSL handshake protocol. The SSL record protocol defines the format used to transmit data. The SSL handshake protocol involves using the SSL record protocol to exchange a series of messages between an SSL-enabled server and an SSL-enabled client when they first establish an [...]

How to do a System Audit for your Linux box

Unfortunately, there is no such things as a standard Linux installation. The wide variety of servers available, coupled with each particular distribution’s installation options, make providing a ready made list impossible. The best that can be done is show you how to list all running services, and point you in the right general direction. Now [...]