Programming Analogies : Auto Service and Repair

Finding analogies for programming is very important for training programmers, for communicating to other programmers, to communication to customers and end-users, and to help a programmer’s understanding of their own code and goals for their code.

One thing to remember about analogies: They always brake down. An analogy is a “comparison” – and all comparisons will fall apart eventually, unless the things being compared are identical. In other words, at some point the comparison falls apart because the two subjects are different. This is okay, because we are just using this “comparison” mechanism for learning and understanding, we are not using this comparison to make the plans for the next space shuttle.

Example: A car needs new wiper blades, brake pads, and tires. And just the same, a web application or other application needs some basic maintenance.

davismotorservice.com

Example: A car needs oil, fuel, brake fluid, automatic transmission fluid, wiper fluid and many more things to run properly. An application needs sufficient memory, disk space and system resources to run properly. Over time, the application and other softwares on the system use up these limited resources, and they must be replenished. This could mean deleting log files, and stopping unnecessary programs to free up more resources (ie. fixing problems to improve your gas mileage). This could also mean upgrading one’s server (ie. replacing an engine or large component, or getting a new car).

PHP exec() and mysqldump – Error Code 3 and other errors

PHP exec() command is heavily used, but sometimes when using mysqldump and other commands the results can be confusing and difficult to debug.

Namely, when tables are crashed, exec()’s $retVal might end up as either 2 or 3, and the table may or may not show as Crashed when doing a “SHOW TABLE STATUS”. Try to do a mysqldump, and look at the very end of the file to check for an error. Alternatively, just attempt to REPAIR TABLE on the table after the last table it successfully backed up.

It is best to always treat any value in $retVal as an error.

How do I disable Webalizer from Webmin?

How do I disable Webalizer?

Webalizer is a program which analyzes and generates statistics and reports about your webserver’s logs. It can be massively useful or it can be massively problematic. Very large log files can cause problems, and webalizer itself can cause problems even when not configured to process any log files.

Because of this it’s often necessary to disable it from running, as it can cause your server to hang.

1) Uninstall – Webalizer is a package which you can view in Webmin. Login to Webmin and click System > Software Packages and search for “webalizer”. You can uninstall webalizer completely from here.

2) Disable Cron – If you just want to disable it from running without uninstalling it, remove the cron entry under /etc/cron.daily – it may be called “00webalizer”.

Security: .htaccess and Apache

Apache is massively popular right now and probably the leading web server software. As such it is a security target, and much development and updates happen regarding Apache security. .htaccess is a security method long used by Apache, although it can do much more than just security. The .htaccess file provides a lot of functionality, anything from redirects, to URL re-writing, to changing PHP settings or Apache settings, folder display settings, and password and IP security.

.htaccess is hugely popular and a great way of going about several important tasks on a website. Documentation is readily available on the internet, most features are very easy, and the features it provides are incredibly useful.

Glossary: Fragmentation

Fragmentation, in our context, is when an application splits into many different versions or branches.

As an example, Google’s Android is constantly accused if being heavily fragmented, which detracts from the user experience. Android, and many different versions of it, are installed on literally hundreds of different devices. The large number of variations does present problems for development, carrier software releases, Android developers, and to a small extent end-users. Continue reading…

Android: Freedoms, Truths, and Myths

Since the introduction of the Android OS by Google, there has been tons of hoopla about what Android is, what Android does, and what sets it apart. These aspects of Android have been manipulated and misconstrued by the media, and subsequently by the public, resulting in a poor understanding of what Android is. Continue reading…

Glossary: Queue

A queue, in our context, is a way of lining up requests, and having a program that processes those. Basically, it’s a way of saying “do this later”. It might still be done immediately, but for a variety of reasons it may not happen immediately. The purpose of the queue may not to be “do it later”, but that will happen regardless. The purpose of a queue can be anything from fixing a performance problem, to preventing performance spikes, to delaying a request a minimum amount of time or a number of other reasons. Continue reading…

PHP/MySQL Performance Series: Part 4 – Schedule that Cron

Crons can solve a lot of problems, but they can also create a lot of problems so be careful.

Usually you’ll make a cron to fix a specific problem, or to create a queue. There aren’t a whole lot of “standard” crons that we can discuss. Continue reading…

PHP/MySQL Performance Series: Part 2 – Creating a Queue

The Queue.

It’s a wonderful thing. Queues are a great way to deal with performance issues. Generally, from an end-user perspective they make the system appear to work very quickly.

This is #2 in our series because if you are searching for information on performance fixes, chance’s are you need a quick fix of some type. Queues are a great quick fix, they are also suitable for long-term implementation, and can solve a variety of problems, however they are only useful in certain situations so don’t get overzealous. Continue reading…

PHP/MySQL Performance Series: Part 1 – Add Index, Optimize Tables

When trying to optimize the performance of your MySQL database, the first thing you try is often the most futile:

Table Optimization.

We put this first because it’s often the first “fix” people arrive at when trying to fix performance problems, but we think it’s almost never the solution, so we want to get that out of the way first. It might be worthwhile to skip this article, make an educated guess based on your problem and your own knowledge of the situation. Continue reading…

Recent Posts

Archives