Mysql: display row count for all tables in a database

When playing the role of the DBA, it’s often useful to get a quick listing of how many rows each table in a database contains. The syntax for this is pretty simple in Mysql: SELECT table_name, table_rows FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA = '***database name***'; Replace database name with the actual database name in the SQL above. Notice that when using innodb tables, it’s only a rough estimate.

Which packages are installed (on Ubuntu)

If you’re using a Debian based Linux Desktop such as Ubuntu, Linux Mint - or Debian itself naturally - you can easily create a simple text file of all packages installed on the machine. I have a habit of removing a lot of the “extras” (junk) which comes with the basic install - not religiously, but just to keep it reasonably tidy and not have too much stuff eating up the harddisk, requiring updates (without providing any value).

Password failure in Wordpress Plugin

One of the great features of Wordpress is the wide variety of plugins available. They often enable a lot of interesting functionality and integrations to other services not native to Wordpress itself. Most of these plugins are developed by individuals or small teams independent of the core community - and often not with a keen interest in security, but an exclusive focus on “making stuff work”. I’ve been using the Wordpress “Google AdSense Dashboard” for awhile, and after the recent host of password leaks, I’ve been changing and upgrading password all around.

HTTPS, SSL, TLS - What it does

While surfing the net, you often come across web agencies how promote SSL-certificates (or TLS security) on their products - or their ability to create “secure web applications” with SSL. Most users know HTTPS/SSL/TLS as the little lock, that promises “security” when visiting a page - but what kind of security it actually provides is rarely explained - and far worse often misunderstood. The while SSL is the popular name (and as it was once known) and HTTPS usually is the way users sees it (as part of a URL in a browser) - the correct name is TLS a short for Transport Layer Security.

Removing the hash part of an URL

A url may contain a hash/an anchor reference. If you need to remove it from url, it’s quite easy. Here’s a short recipe on how to do it in PHP (including a little test input): $urls = array( 'http://example.com/', 'http://example.com/#test', 'http://example.com/?id=1', 'http://example.com/?id=1#test', 'http://example.com/?id=1&id2=2#test#test', 'http://example.com/?id=1#test#test' ); foreach ($urls as $url) { if (strpos($url, '#')) { $url = substr($url, 0, strpos($url, '#')); } echo $url, "\\n"; } Apart from removing the hash ending from urls, the function can naturally also be used on any number of other similar cases, where you need to trim a string.