// archives

Linux, Unix, and Solaris

This category contains 8 posts

Backing up with mysqldump part deux

MYSQLDUMP is a utility for outputting database contents into text files. This is nice, but has many configuration options. One, often missed detail is the specific permissions required to accomplish the job. I made a note on the mysql manual (bottom of page) to illustrate what I consider to be a best practice for automated [...]

Getting OpenCV setup on Fedora Linux with QT

Funny thing I’ve found about Linux distros and software applications… settings are meant to be paid attention to and tweaked. There are no common folder layouts that one should really count on. Maybe /bin or /usr/bin. But anyway, getting a QT project setup to utilize OpenCV libs was interesting. Here’s what I did: 1. Install [...]

Using screen in the Linux shell

Have you ever been remotely connected to a host using SSH and thought to yourself: “self, I wish I had more than one window…” So naturally, you opened an additional SSH session. This is fine, but then you need to organize desktop windows when there’s a much simpler solution: Use the screen shell program. Screen [...]

Scripting MySQL replicated slave restarts

The recent reboot requirements at Amazon AWS have brought up the topic of automated restarts of MySQL database servers. I’d like to offer a safe solution for scripting the procedure. Let’s pretend that we’ve already confirmed there’s no production traffic. Here are the basic commands: Stopping MySQL Server Stop replication mysqladmin -u root -p stop-slave [...]

My favority BASH one-liners

Let me preface this post by saying, these are hacks. Neither the best or the only ways to achieve the desired results. But hey, if they work for me, they may work for you. Enjoy! ping -i 10 4.2.2.2 Send a ping request to an IP address once every 10 seconds. Why would I do [...]

Use BASH to extract MySQL ACL list

Need to quickly extract all the GRANT info for your database users? Here’s a one-liner: for i in $( mysql -u readuser -pReadPassword -h your.host -e “SELECT CONCAT(user,’@\”,host,’\”) AS ACL FROM mysql.user ORDER BY user” -s ); do mysql -u readuser -pReadPassword -h your.host -e “SHOW GRANTS FOR $i” -s ; done ; Here’s a [...]

How to use Bash to extract Qmail accounts for OpenSRS import

Since I happen to be going through the pain of a bulk migration from Qmail to OpenSRS, I figured I can’t be the only one. Here’s a Bash script I wrote to extract Qmail users accounts into a CSV file. Enjoy! #!/bin/bash # # # Simple Email Account Extractor for Qmail # – Extracts username/password [...]

Backing up your MySQL databases

MYSQLDUMP is a utility for outputting database contents into text files. This is nice, but has many configuration options. One, often missed detail is the specific permissions required to accomplish the job. I made a note on the mysql manual (bottom of page) to illustrate what I consider to be a best practice for automated [...]