queries

How to Speed Up DNS requests by keeping a cache of responses to your dns requests on your hard disk

Let say you are on an expensive satellite link that can barely provide enough bandwidth for your company’s Internet Access and you will want to do whatever you can to get as much as possible out of this link. Moreover, occassionally you loose power from the utility company, long enough for your UPS to run [...]

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

MySQL Server Has Gone Away Or Lost connection to server during query Fix

A much dreaded MySQL error message during queries is “MySQL server has gone away”. An alternative message is “Lost connection to server during query”. This is a strange problem which afflicts a wide variety of PHP software including but not limited to WordPress. There are several causes for it. Let’s look at the common and [...]

How to Ignore duplicate entries in MySQL

Sometimes every occurance of a value which may be duplicated multiple times in a result set is not needed. For example, if making a pulldown menu list of options, each option should be seen only once. The DISTINCT keyword in a select statement eliminates duplication in the result set.

How to Publish Configuration Manager Site Information to Active Directory Domain Services

Before Configuration Manager can publish site data to Active Directory Domain Services, the Active Directory schema must be extended to create the necessary classes and attributes, the System Management container must be created, and the primary site server’s computer account must be granted full control of the System Management container and all of its child objects. Each site publishes its own site-specific information to the System Management container within its domain partition in the Active Directory schema.

50 quick linux command tips part 3

1. How to know which ports are listening from your IP address? # nmap -sT -O your-ip-address 2. How to grep an exact match? # grep -w textfile.txt 3. How to reverse grep matches? # grep -v textfile.txt # 4. How to know which service name is what port? Assuming port 443 # cat testfile.txt [...]

How to do ssh log parsing and monitoring

Server SSH log files provides us information from simple system to critical system security message. Here are quick ways of doing it via CLI terminal. These examples could serve also as starting point to parse more search key strings not only from any ssh log files, but also to other daemon service log file such [...]

How to Sync date and time via NTP server

Syncronizing your current date and time is as important as making database backups. Without proper accurate stamped date and time, any backup file with any stamped date on it would be meaningless. Without correct time and date, those scripts that depend on date and time schedule would be executed inaccurately and would give you result [...]

How to Install and Use RDesktop in Linux

We can never remove the fact that some companies still use any other desktop operating systems from their network. Several reasons for these are due to commercial and propriety softwares and customized applications that currently being managed and needed by certain specific company departments, whether those clients are located remotely or just a single department [...]

How to Install VMWare Server on Fedora 8

Desktop virtualization has been continuously capturing users and web services. More and more companies are creating virtual machines and appliances that can be of productive service to many web users around the globe. From recent post, here’s a quick howto install VMWare Server on Fedora 8. VMWare Server Pre-Requirements VMWare Server package needs to compile its [...]

How to connect to MS SQL Server database in PHP

Below is the code for connecting to a MSSQL Server database.   <?php $myServer = “localhost”; $myUser = “your_name”; $myPass = “your_password”; $myDB = “examples”;  //connection to the database $dbhandle = mssql_connect($myServer, $myUser, $myPass)   or die(“Couldn’t connect to SQL Server on $myServer”);  //select a database to work with $selected = mssql_select_db($myDB, $dbhandle)   or [...]

How to Determine Domain’s Expiration Date From Linux Terminal

Determining domain expiration is also part of an IT web-enabled infrastructure. There are a lot of window softwares that queries the internet for the domain’s expiration date. Here’s an easy way on how to display your domain’s expiration date using linux terminal command in a single shot. Check Domain Expiration Date # whois yourdomain.com The [...]

How to Extract Lines That Started With Matching String Using Grep

From recent post of displaying the first occurrence of line that starts with a specified matching string, now instead of the first occurrence, here’s a way of stripping out all matching lines that start with the given matching string. Reproducable Approach Say for example, we have a text file with the below contents and we [...]

How to Extremely Powerful Linux Password Sniffer

Password Sniffer on Linux? Yep, we all need to be informed of passwords being sniffed out! I would not entail those details and cover specific issues of identifying your network securities as that would be large enough to be covered here and case to case basis. However, those two words are being mentioned here and [...]

How to setup Transparent Proxy with Squid

One of the many tasks we could be facing from time to time in our work is setting up and building a production proxy server. Proxy implementation could be done in several ways to achieve the same goal. One best bet we could have with this kind of setup is by using Squid linux software [...]