Changing the MySQL client prompt

It is quite easy to get lost in MySQL when working between a lot of databases.

While you can find out which database you are in, it soon becomes quite irritating having to type

mysql> select database();

+------------------+
| database() |
+------------------+
| test_database |
+------------------+
1 row in set (0.01 sec)

The simplest way to solve this and make life easier, is to change the prompt to include the info! Simple edit the [mysql] section of your my.cnf file and add the prompt option:

[client]
host = "localhost"
user = "mehuser"
pass = "someubersecurepassword"
prompt=mysql [\\u@\\h - \\d]>

Now when you use the client the prompt will show mysql [user@host - database]>:

mysql [test1@localhost - test_database]>

No more getting confused! If you don’t have access to /etc/my.cnf then use ~/.my.cnf, I usually stick the connection details in there as well - then you can have huge passwords and never have to type/remember them:

[client]
host = "localhost"
user = "mehuser"
pass = "someubersecurepassword"
prompt=mysql [\\u@\\h - \\d]>

Useful cPanel paths

Some common and useful paths for cPanel are as below - please note that these may change at any time.

Location Contents
/etc/ips IP Addresses
/etc/reservedips Reserved IP addresses
/etc/reservedipreasons Reserved IP address reasons
~/.accesshash WHM API key
/etc/cpupdate.conf cPanel update configuration
/etc/wwwacct.conf Basic cPanel config
/var/cpanel/maxemailsperhour System wide max emails per hour setting
/var/cpanel/packages cPanel packages
/var/cpanel/users User data
/var/cpanel/templates/apache2 Apache vhost templates
/usr/local/apache/conf/userdata/std/2/$user/$domain/configuration.conf Apache vhost config customizations for $user's $domain (not SSL)
/usr/local/apache/conf/userdata/ssl/2/$user/$domain/configuration.conf Apache vhost config customizations for $user's $domain (SSL)
/etc/userdomains Users domains
/usr/local/cpanel/version cPanel version
/var/cpanel/resellers Resellers
/scripts Loads of useful cPanel related scripts
/usr/local/cpanel/bin Loads of useful cPanel scripts

Upgrade EOL Clamav


ClamAV have EOL'd all their versions prior to 0.95 - if you see an error like the following then ClamAV needs an update:
 LibClamAV Warning: ***********************************************************
 LibClamAV Warning: *** This version of the ClamAV engine is outdated. ***
 LibClamAV Warning: *** DON'T PANIC! Read http://www.clamav.net/support/faq ***
 LibClamAV Warning: ***********************************************************
 LibClamAV Error: cli_hex2str(): Malformed hexstring: This ClamAV version has reached End of Life! Please upgrade to version 0.95 or later. For more information see www.clamav.net/eol-clamav-094 and www.clamav.net/download (length: 169)
 LibClamAV Error: Problem parsing database at line 742
 LibClamAV Error: Can't load daily.ndb: Malformed database
 LibClamAV Error: cli_tgzload: Can't load daily.ndb
 LibClamAV Error: Can't load /var/lib/clamav/daily.cld: Malformed database
 ERROR: Malformed database

To upgrade ClamAV on a RHEL based system perform the following:

  1. wget http://pkgs.repoforge.org/clamav/clamav-0.96.1-1.el5.src.rpm
  2. yum install srpm unzip
  3. CFLAGS=”-O0” ./configure –disable-zlib-vcheck
  4. make && make install
  5. Update /usr/local/etc/clamd.conf (notably removing the “Example” line and uncommenting the TCP socket line).

ClamAV should now work once again.

Spoon!

It still needs some work to smooth out the handle and round the top off as well as sanding the dip out but I’ve made a pretty decent start on a spoon.

This started out as part of a tree trunk which got removed and split with an axe, from there all the work has been done with 3 knives:

  • Spoon knife - for rounding the handle and scraping out the dip
  • 9” knife - for taking off the thick outer and bark
  • Gerber STL 2.5 knife - for taking tiny slivers off the handle and smoothing out some of the head

Here are some “early” (4/5 days of on and off work) pictures…

SMTP Authentication in Postfix using local system accounts

In /etc/postfix/main.cf ensure the following values are set

message_size_limit = 204800000
smtpd_recipient_restrictions = permit_sasl_authenticated permit_inet_interfaces reject_unauth_destination, permit
smtpd_sasl_auth_enable = yes
broken_sasl_auth_clients = yes

This will ensure postfix denies any un-authenticated attempts to send mail and enabled sasl authentication.

Next we just need to make sure sasl/postfix are setup to run:

chkconfig saslauthd on
/etc/init.d/saslauthd restart
chkconfig postfix on
/etc/init.d/postfix restart

Once this is done all we need to do is add our users and they can send mail:

adduser -s /sbin/nologin -M user1
passwd user1

adduser -s /sbin/nologin -M user2
passwd user2