MySQL fix. Image via Flickr by Luis M. Gallardo D

Restore single MySQL table from a full mysqldump backup file

Here are the steps required to restore a single MySQL table from a full mysqldump database backup file on the command-line. If you need to restore a single table from a full MySQL backup, you may find yourself wondering “how do I do that?”. There are a few steps required, I outline them here for you to restore the contents of just one table back into the database from the mysqldump using Bash.

Read More

Release hold queue email in Postfix – postsuper

How to flush Postfix’ mail queue from the command line and delete all mail from the queue? Easy, use the Postfix postsuper command as explained in this post. The postsuper command controls different types of queues in the Postfix mail system, like the deferred or hold queue. This post shows you some Postfix queue operations to maintain your mail servers.

Read More

Recursive scp and symlinks

Recursive scp without following symbolic links. When using recursive scp, symbolic links aren’t preserved and are copied as if they are normal directories. So you have to look for another solution to recursively transfer symlinks over ssh. Here is one: Tar over ssh!

Read More

Generate pseudo-random passwords with OpenSSL

Generate a random password using OpenSSL. OpenSSL comes in handy when you need to generate pseudorandom strings, for example to be used for passwords. In this short post I’ll give you a quick example on how to generate random passwords with OpenSSL in Linux (Bash), Windows and PHP, perfect for use with for system accounts and services accounts.

Read More

SSH port forwarding in PuTTY

Tunnel RDP through SSH & PuTTY

How to tunnel Remote Desktop (RDP) over SSH with PuTTY. Have you ever been in a situation where you needed to perform remote administration on a Windows Server, and the RDP port 3389 is blocked on a firewall? Did you know you can tunnel RDP over SSH with PuTTY? This particularly comes in handy when there is no VPN available to the remote network… Here is how to set up a RDP SSH tunnel with PuTTY.

Read More

Turn off swap

Not every Linux server I maintain needs to have a swap partition and to start swapping. For instance, the MySQL servers all have more than enough RAM on board to do their work. Yet, when a swap partition is enabled Linux starts swapping, which may degrade MySQL database performance…

Read More

MONIT - Barking at daemons. Monit is a small Open Source utility for managing and monitoring Unix systems. Monit conducts automatic maintenance and repair and can execute meaningful causal actions in error situations.

Monit monitoring on Ubuntu 14.04 VM on Hyper-V

Set up a Monit monitoring service for your websites and services. Monit is a free and open source service monitoring application which can perform various event-based actions. Monit can send email notifications, restart a service or application, or take other responsive actions. We set Monit up on a Ubuntu 14.04 VM, built on Hyper-V. And we use Monit to monitor several websites, and send out notifications on downtime.

Read More

Postfix logo

How to delete all MAILER-DAEMON emails in Postfix queue

Quickly/Easily delete all MAILER-DAEMON emails from your Postfix queue, when it matches a sender or recipient email address condition. When a large scale spam run was sent through your mail servers, you need to clean up and remove those spam messages, fast. In Postfix, there are various similar commands to delete messages from the Postfix mail queue. Based on the Message-ID and/or email address. This post outlines some of them.

Read More