A web development/programming blog providing info, tips, and tricks on programming languages, scripting, Linux, MySQL and more
Linux
How to reset the bash IFS variable
Jul 9th
Here’s a quick tip for everyone. I was working on a one-liner today at work that involved parsing through a file with some data in it. The data had spaces in it which can cause problems with the default $IFS variable (Internal File Separator). nixCraft has an excellent tutorial on working with the $IFS variable.
Read the rest of this entry »
What I learned from my first OWASP meeting (or why I will never use PHP Nuke)
Jul 6th
I just got home from attending my first meeting of the Phoenix chapter of OWASP. WOW!!! That’s all I have to say. The guest speaker was Mike Brooks, currently the top answerer and asker of security questions on Stack Overflow, who will be giving the same talk at the upcoming DEF CON 18. Mike gave an amazing presentation on chaining vulnerabilities in order to bypass layered security systems and ways of obtaining wormable remote code execution on a modern LAMP platform.
Read the rest of this entry »
What do three “less than” (<<<) symbols mean in PHP?
Jul 2nd
I am a true believer in that the best ways to learn how to do anything is by studying work of those who have done the same thing previously. When programming, that means looking at others’ code and learning from what they do. However, don’t assume that everything someone else does is correct! What this means is that not only should you learn what to do from other peoples’ code, but you should also learn what not to do.
Read the rest of this entry »
How to append values to an array in bash
Feb 4th
Last week I was working on a bash script for a project at work. The script parsed through a log file with server load and disk usage statistics at regular intervals. The script was calculating the average CPU idle time, disk utilization, and disk usage for servers. After calculating the averages for each of these three metrics, I then proceeded to loop through all the lines in the file and create an array of all the times when the CPU idle time was below average, or the disk utilization or usage was above average.
Read the rest of this entry »
Top 20+ MySQL Best Practices
Dec 4th
I came across an excellent article a couple days ago in my NetTuts+ RSS Feed titled “Top 20+ MySQL Best Practices”. In the article, author Burak Guzel gives some excellent MySQL tips. Due to my argumentative nature (not really) I made a few comments on the post that you can see at the bottom about 1 or 2 of the tips. The tips were by no means wrong, I just wanted to add some clarification and caveats to them. A couple of the tips, I have been using every single day in my job and they have proven invaluable. The article is excellent and I highly recommend reading it.
Read the rest of this entry »
Avoid WordPress StatPress plugin like the plague!
Dec 2nd
** Update: I have released my first set of updates to the StatPress plugin. Check out the post for code to improve your blogs performance of StatPress
The WordPress plugin StatPress is an absolutely horrid plugin to use. Yes, I said it…horrid! After seeing many people praising this plugin on their sites, this is a bold statement.
Read the rest of this entry »
Temporary Tables are Bad!
Dec 1st
This article was written by a co-worker of mine and I wanted to share with everyone else.
Temporary Tables. What are they? Why are they bad? You might think you don’t explicitly use any, but in actuality you may be using them all the time.
Temporary tables come in two flavors. The kind you know you’re making, and the kind you don’t. You know you’re making a temporary table when you use the CREATE TEMPORARY TABLE syntax. On the other hand, there are lots of other cases in which MySQL will create a temporary table for you, in the background, to help out the query execution to get you your results.
Read the rest of this entry »
Could the new Google Chrome OS spell the end of the Desktop PC as we know it?
Nov 22nd
Maybe, but doubtful I think. But there are people that are saying this. This past week, Google released the source code for their new Chrome OS (called Chromium while still in development). The OS is still in development, expected to be released next year, but is Google’s “attempt to re-think what operating systems should be.” (source: The Official Google Blog)
Read the rest of this entry »
How to Post to Twitter from a Linux Shell
Jun 18th
I had a little downtime today at work and decided to write a shell script that I could use to tweet from the shell of my Linux server. The reason is that Twitter is one of many social networking sites that is blocked at my workplace. However, I do have access to my server and found a great one-liner on commandlinefu.com to update twitter via curl. I decided to expand on this a bit and wrote a shell script that offers a bit more than merely posting a tweet. Check out my shell script to post to Twitter here.

