Tag Archives for " Bash "

Restore single MySQL table from a full mysqldump backup file

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.

Continue reading

Release hold queue email in Postfix – postsuper

Postfix logo

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.

Continue reading

Benchmarking WordPress, simple load & speed testing with ApacheBench

WordPress load testing with ApacheBench. ab is a small benchmark utility that comes with Apache. It’s a really simple HTTP load generating tool, ideal for a simple WordPress load & speed test. How fast does your WordPress site respond? How many HTTP requests per second can your server handle? These are questions on which ab can shed some light.

Continue reading

Recursive scp and symlinks

Recursive scp without following symbolic links. TL;DR: 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!

Continue reading

Generate pseudo-random passwords with OpenSSL

OpenSSL comes in handy when you need to generate random passwords, for example for system accounts and services. 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…

Continue reading

Tunnel RDP through SSH & PuTTY

How to tunnel Remote Desktop 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? You can tunnel RDP over SSH with PuTTY. This particularly comes in handy when there is no VPN available to the remote network…

Continue reading

Turn off swap

How to turn off swap in Linux. Not every Linux server I administer needs to have a swap partition and to start swapping. For instance, the MySQL servers I maintain 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…

Continue reading

Monit monitoring on Ubuntu 14.04 VM on Hyper-V

Monit monitoring for websites and services, on an Ubuntu 14.04 LTS VM, hosted on a Windows Server 2012 R2 or Windows 8.1 Hyper-V. This post is about setting up a Monit monitoring service. 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 […]

Continue reading

How to restore a deleted Open-Xchange context?

How-to restore, or recover, an accidentally deleted OX context. If you’ve accidentally deleted an Open-Xchange context (contextid), then that is bad… Here is how to recover a deleted OX context and filestore… Assuming you make Open-Xchange backups of course.

Continue reading

Convert decimal to hex in Bash?

How to convert decimal to hex in Bash, hexadecimal to decimal and timestamps to dates. Use Linux Bash shell to convert decimal values to hexadecimal, and vice versa

Continue reading

Old-school: Unix wildcards gone wild

DefenseCode’s Leon Juranic released an article explaining an old-school hacking technique: Unix wildcard poisoning attacks. No ASLR bypass, ROP exploits or 0day remote kernel exploits, but if you wonder how basic Unix tools like ‘tar’, ‘chmod’ or ‘chown’ can lead to full system compromise, keep on reading.

Continue reading

How to delete all MAILER-DAEMON emails in Postfix queue

Postfix logo

How to 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. Doing so guarantees normal, valid email messages being sent quickly, and the spam messages never leave your queue. In Postfix, there are various […]

Continue reading

Minify JavaScript, CSS and compress images

Optimize PNG images and minify JavaScript and CSS files, the easy and fast way? With YUI Compressor and OptiPNG on the Windows-, Linux- and macOS command line of course! Compacting HTML, CSS, and JavaScript can speeds up your website because of smaller and faster downloads, parsing, and execution time.

Continue reading

How to test SMTP Authentication and StartTLS

How to investigate and resolve StartTLS/TLS authentication issues on SMTP, IMAP, POP3 servers with the openssl client library, using the command line

Continue reading

Bash: Grep through a large number of files – argument list too long

The other day I was searching for a particular email file in an Maildir on one of our mail servers. Knowing only the From address, I thought I’d use grep. Unfortunately it failed and gave me an error: /bin/grep: Argument list too long. Here is how to overcome this grep error…

Continue reading