Wipe a disk via Linux shell

This is how to wipe a disk via Linux shell:

The command above erases all data on the device /dev/sdc and overrides the data 2 times. Finally every bit is overridden by zeros. So in sum it takes 3 iterations to wipe a disk via Linux shell. n specifies the number of iterations taken place […]

Remove empty rows from CSV

Recently I had to remove empty rows from a Magento ImportExport product export CSV file (see https://www.webguys.de/magento-1/turchen-19-produktimport-mit-der-importexport-schnittstelle). The format of these files is really complex. The problem was, that I did a cleanup of the product data inside the file. As a result of this there where empty rows. So I had to eliminate them. […]

Download File via SCP in Ruby

To download a file vie SCP under Ruby, you can just use the NET::SCP class included in ruby like that:

For further information about NET::SCP have a look at https://github.com/net-ssh/net-scp.

Plesk – regain access to the admin panel via shell

Today I had to regain access to the admin panel of one of my root servers that uses Plesk as administrative panel. I had configured a IP restriction for the panel under Tools and Settings > Restrict Administrative Access. The problem was, that I wanted to access the machine from outside of the company network (my […]

Add product attribute columns to Woocommerce backend grid

If you have to extend the backend product grid of Woocommerce by an custom attribute , you have to follow the steps below to add product attribute columns to Woocommerce backend grid: Register and sort  the new columns via a filter hook (‘manage_edit-product_columns’):

Add an action hook to fill in the respective value of each row […]

Get file encoding via Linux shell

To find out which encoding a certain file has, you can use the file command on Linux shell:

Output example:

 

wordpress cron: using wp_mail function

Today I had to solve the problem, that my wordpress cron throws an exception like this when sending an email via wp_mail function inside a cron scheduled event function.

The wordpress cron was registered like that:

And the wordpress cron mechanism was triggered via Linux crontab:

Problem with wp_mail in wordpress cron […]