Archive for Quick Tip
MySQL Backup User Privilege Grant
LOCK TABLES and SELECT are the minimal requirements to use ‘mysqldump’.
You can use the following grant statement to create a user with as little privileges as possible:
CUPS Purging not-completed print jobs older than..
When working with CUPS using remote print queues, you may find that the remote printer is not always available, has timed out, ran out of paper, has a paper jam, etc. Sometimes this causes a job to ‘not-complete’ and when running ‘lpstat -o’, you see old print jobs.
We put together a quick script to auto-purge [...]
Extracting files from rpm and deb packages
We ran into an issue where an init script was missing and we needed to restore the file. The backup (of course) did not include the file we needed. We had to download the package, extract the contents, and move the init script back into place. Below are the commands used:
DEB:
$ dpkg-deb -x <package.deb> /restore/dir
RPM:
$ [...]
Retrieve Ensim MySQL root password
You can display the current root password for mysql (if the host is running ensim), by using the following command.
# ensim-python -c “import sys;sys.path.append(\”/usr/lib/opcenter/mysql\”);import mysqlbe;print mysqlbe.read_mysqlpass()”
Read morecPanel / Fantastico Deluxe install doesn't do anything.
We ran into an issue when installing Fantastico. After clicking the installation button, everything seemed to download just fine, but every time you go back to the Fantastico link it says it is not installed.
It turns out, Fantastico uses wget to download files. wget is called with the ‘-P’ option, which is not [...]
Dedicated Linux Server Checklist for the New Year.
If you have a dedicated Linux server, this list is for you. Below are a few items you need to do, to ensure your 2008 will be a bit brighter. This list is by no means comprehensive, but hopefully gets you started in the right direction this year.
Check your backups and perform a [...]
Read moreSecuring your Linux server
We deal with security related issues nearly every day. Many of these issues could be prevented with a few minor changes to php.ini along with the installation of mod_security. It is simply amazing how many machines are hacked, and then used for the sole purpose of sending spam, denial of service (DoS) attacks or [...]
Read moreRate limiting connections with iptables
You may find this iptables based method of limiting packets useful. For example, to drop connection from from someone who is trying to brute force your passwords via ssh.
I have a particular case, where a customer wants to be notified if more than X number of SMTP connections are being generated from a particular [...]
Rename a filesystem, or change a mount point
I was just asked today to provide a quick overview of the steps necessary to rename a filesystem. And here is what I came up with. Please use this information at your own risk, and always ensure you have a backup just in case something does not go well.
Read moreHTTP to HTTPS via mod_rewrite
To redirect a website from http -> https I utilized mod_rewrite. And created a .htaccess file with the following contents.
$ cat .htaccess
Options FollowSymLinks
RewriteEngine On
RewriteCond %{SERVER_PORT} !^443$
RewriteRule ^(.*) https://your_server.com/$1
This can be useful if you need to ensure all access to your site, is done via HTTPS.
