Help keep the internet free

mysql_logo

A big part of the Internet is built on LAMP (Linux, Apache, MySQL and PHP/Perl/Python). Now Oracle is trying to buy Sun, which owns MySQL.

It’s not in the Internet users interest that one key piece of the net would be owned by an entity that has more to gain by severely limiting and in the long run even killing it as an open source product than by keeping it alive. If Oracle were allowed to acquire MySQL, we would be looking at less competition among databases, which will mean higher license and support prices. In the end it’s always the consumers and the small businesses that have to pay the bills, in this case to Oracle.

Read on here at Monty’s blog (creator of MySQL) or head here for the official website.

Help keep the internet free Read More »

WordPress Security

wordpress_logo

In a follow up to this post a timely reminder that WordPress installations must be secure.

Hackers have developed a distributed WordPress admin account cracking scheme that poses a severe risk for the security of blogs whose owners select insecure passwords.

PHP scripts located on a virtual server run bruteforce (password guessing) attacks on targeted sites. Many sites can be attacked at the same time by the system, with results written into an associated database.

Further details are available here and from the original here.

Having a non standard login (i.e. not administrator) and a long alphanumeric password are easy steps to take, as well as restricting administrative changes to a particular IP address

WordPress Security Read More »

Using LIMIT when querying a single row

mysql_logo

Sometimes you know you are only looking for one row when you are querying your tables. It may be that you are fetching a unique record or checking the existence of any number of records that satisfy your WHERE clause.

Adding LIMIT 1 to your query can increase performance in this situation; – the database engine will stop scanning for records after it finds just one, instead of going through the whole table or index.

For example:
$record = mysql_query("SELECT username FROM user WHERE country = 'UK'");
if (mysql_num_rows($record) > 0) {
// ...
}

Can become:
$record = mysql_query("SELECT username FROM user WHERE country = 'UK' LIMIT 1");
if (mysql_num_rows($record) > 0) {
// ...
}

Using LIMIT when querying a single row Read More »

Taskbar Shuffle

For Boolean to recommend a product it has to be pretty good. This is one application that gets installed after each and every Windows reinstall, – and it is especially useful for those of you still using WindowsXP. Boolean is in no way affiliated with the developer, – we just want to share a software gem with you.

Taskbar Shuffle is a simple, small, free utility that lets you drag and drop your Windows taskbar buttons to rearrange them. Here’s a full feature list:

  • Full 32-bit and 64-bit support
  • Reorder your taskbar buttons by dragging and dropping them
  • Reorder your tray icons in the same way
  • Reorder tasks in a grouped button’s popup menu in the same way
  • Middle-click to close programs on your taskbar
  • Works with UltraMon (version 3+ only) taskbars
  • Tweak taskbar button grouping

If you run more than a few applications at a time, you’ll definitely find Taskbar Shuffle useful, so give it a try!

Link to download here

Taskbar Shuffle Read More »

Suversion Cheat sheet

Subversion

A great Subversion cheat sheet is available from http://ariejan.net/

For those of you not yet in the know, Subversion (SVN) is a version control system initiated in 1999 by CollabNet Inc. It is used to maintain current and historical versions of files such as source code, web pages, and documentation. Its goal is to be a mostly-compatible successor to the widely used Concurrent Versions System (CVS).

Get the cheatsheet here

A few other useful links:

Tortise SVN client (Windows only)
Workbench SVN client
Subclipse SVN client
Ankhsvn (Plugin for Visual Studio)
WebSVN (php based repository browser)

Suversion Cheat sheet Read More »

Dont copy variables without reason

php-logo

Sometimes PHP novices attempt to make cleaner or more legible code by copying predefined variables to variables with shortened names prior to working with them. This actually results in doubled memory consumption (when the variable is altered) and therefore slower scripts. In the following example, if a user had inserted 512KB worth of characters into a textarea field this would result in nearly 1MB of memory being used.


$title = strip_tags($_POST['title']);
echo $title;

This operation can be performed inline, – avoiding the memory overhead.


echo strip_tags($_POST['title']);

Dont copy variables without reason Read More »

PHP Twitter Class

php-logo

Twitter is a service for friends, family, and co-workers to communicate and stay connected through the exchange of quick, frequent answers to one simple question: What are you doing?

PHP Twitter is a (wrapper)class to communicate with the Twitter API written by Tijs Verkoyen. Download page is available here

A quote from the author (and he’s not wrong) The class is well documented inline. If you use a decent IDE you’ll see that each method is documented with PHPDoc. There is also a tutorial available here

So, to sum up, these links should kickstart your twittering ability from PHP (and your website).

Happy tweeting!

PHP Twitter Class Read More »