Chris Nizzardini, Salt Lake City Utah, Web Developer Specializing in LAMP+Ajax Since 2006

My Blog

Here is my awesome blog. You can find information on programming, linux, documentation, tips for code and database optimization, my thoughts and rants, and whatever else I feel like sharing. Feel free to contribute to the blog by posting comments and asking questions.

Posts Tagged ‘Linux’

MySQL Slow Query Log – Analyzing, Parsing, and Optimizing Slow Queries

Posted by chris on March 31st, 2011 Comments (3)

This is a follow up post to my blog on enabling and disabling the MySQL slow query log without restarting MySQL.  In this post I’ll explain some methods for analyzing and parsing information out of the MySQL slow query log and then optimizing the slow queries. The slow query log is an absolute mess.  Go ahead just open it and you will see what I mean…

Read the rest of this entry »

In SQL (, , , )

Creating a Spider with Python Mechanize to Monitor Your Website

Posted by chris on September 15th, 2010 Comments (2)

Program a Python Web Spider Bot with MechanizeEvery since the SeoMoz conference in Seattle I’ve been wanting to write a spider to do some of the interesting things the speakers mentioned. Well I haven’t gotten an opportunity to write any SEO apps yet, but I did get a chance to take my first crack at Python using the Mechanize spider. Mechanize is fast and light-weight parsing large HTML documents in fractions of a second. There were PHP options I could have used. One was phpdig. I could have also written a spider from scratch. But after 4 years of developing in PHP I wanted to try something new. Enter python + mechanize for monitoring websites.

The opportunity came after some unfortunate circumstances lead to downtime at work related to a data center migration. Needing a way to go beyond simple service monitoring for things like HTTP/Apache and MySQL I built upon mechanize to test for specific HTML tags within the document body.

Read the rest of this entry »

In Programming (, , , )

adventures in linux printing, set default printer and firefox command line print

Posted by chris on July 23rd, 2009 Comments (2)

We are in the process of redesigning our packing slips that get sent out to customers with each order. The previous developer went with a solution, html2ps, that has shotty support for CSS and design principals in general. The designer and I decided we needed something else. After trying numerous solutions, a co-worker suggested I give FireFox command line print a try.

Read the rest of this entry »

In Linux, Programming (, , , , , , )

Using perror to Help Debug Mysql Errors

Posted by chris on November 4th, 2008 Comments(0)

Print a description for a system error code or an error code from a MyISAM/ISAM/BDB table handler. Example, type “perror 150″ in the linux shell.

1
2
# perror 150
MySQL error code 150: Foreign key constraint is incorrectly formed
In Linux, SQL (, , )