SELECT table_schema AS "Database", 
ROUND(SUM(data_length+index_length)/1024/1024,2) AS "Size (MB)" 
FROM information_schema.TABLES 
GROUP BY table_schema;

From: https://www.a2hosting.com/kb/developer-corner/mysql/determining-the-size-of-mysql-databases-and-tables

sudo apt-get update
sudo apt-get install nagios4
sudo a2enmod auth_digest authz_groupfile
sudo service apache2 restart

Get ARP Cache from PowerShell: Get-NetNeighbor

April 10, 2018 | No comments

Ping from PowerShell: Test-Connection

March 7, 2016 | No comments

Query DNS from PowerShell: Resolve-DnsName

March 7, 2016 | No comments

I just released version 0.4 of my Smart Quotes WordPress plugin. It works with WordPress versions 3.4 and 3.5 now (guess I am a bit behind on these things).

Download “Smart Quotes” (.zip) now

This isn’t really new, but it’s sure worth knowing… The fact that there’s a 128K buffer used to pass arguments to child processes in the Linux Kernel can have the following effect on shell external commands:

When you run commands such as rm spam* the shell (e.g. bash) will expand the “spam*” to a list of names of all files in the working directory that start with “spam”. That list is then passed to the executable /bin/rm using the 128K buffer mentioned above. If you have a large number of files, or the list gets long because of long file names, you may get an error message saying /bin/rm: Argument list too long.

To work around this you can get the list of filenames using find and pipe it to xargs which in turn invokes rm for every single file. There is no limit on the size of a pipe (or at least none that I am aware of for this practical purpose). Here’s the full command:

find . -name 'spam*' -print0 | xargs -0 rm

This differs from similar commands you might find in the -print0 and -0 arguments: These are needed in case you have spaces in your filenames.

For an in-depth explanation of both the 128K buffer and the spaces in filenames issue you may also want to read the May 2004 update in this blog post. (See, I told you it’s not really new.)

Let’s assume you have a value in cell E2 that has several components separated by slashes, e.g. a file path. You may find yourself in the position that you need to truncate the value at the last slash, e.g. get the full path of the folder that your file resides in.

E
2 /path/to/folder/file

The following formula will do the job:

=LEFT(E2,SEARCH("%",SUBSTITUTE(E2,"/","%",LEN(E2)-LEN(SUBSTITUTE(E2,"/",))))-1)

This will return “/path/to/folder”.

Please note that for the formula to work “%” must not be present anywhere in your value. If your value contains “%” you should substitute that in the formula with another character that is not present. (Know your legal characters!)

Update: Works in LibreOffice Calc, too, and I presume OpenOffice Calc will be no different.

In case you’ve ever wondered what the monthly traffic allowance in your web hosting plan means in bandwidth, here’s an easy-to-remember number:

3.19 (month kbit) / (sec GB) – I shall call this the Brian Adkins number

Under the assumption that traffic from a web server only flows in one direction it means that for every GB (gigabyte) of monthly traffic included in your plan you could consume 3.19 kbit/s constantly. Or for every TB (terabyte) of traffic allowed per month you can transmit data at a constant rate of 3.19 Mbit/s.

I have recently released my newest WordPress plugin to the public:

Smart Quotes should appeal to the international audience. E.g. if you’re a German writer and would like to use German book style quotation marks (»…«) even when you type so-called "dumb" quotes or use the <q> element: This plugin is for you!

Right now the plugin comes with shortcuts for Croatian/Hungarian/Polish/Romanian style quotation marks („…”), Czech or German style („…“), Danish (or German books) style (»…«), Finnish or Swedish style (”…”), French style (« … » – with spaces), Greek/Italian/Norwegian/Portuguese/Russian/Spanish/Swiss style («…» – without spaces), Japanese or Traditional Chinese style (「⋯」), but you’re free to manually enter/paste any arbitrary characters or character combinations.

Download “Smart Quotes” (.zip) now

After you’ve installed the plugin go to your Wrting Settings screen where you will find this:

Screenshot of Smart Quotes Settings

Right now the plugin comes in English and with a German translation, but for “Smart Quotes” I’d be particularly interested in adding more languages. Contact me if you think you can help! The .POT file for this one is really small, so I’m thinking it could be a quick fix. – If you have never translated software before: this thread on Lester Chan’s Forums is a good start and it’s specific to WordPress plugins.

« Older entries