Monthly Archives: May 2014

cpanel rndc: ‘reload’ failed: unexpected end of input

It usually means you have some syntax errors in your named.conf. And there are many chances after reboot bind will not start.

Ok lets fix it:

service named status
WARNING: key file (/etc/rndc.key) exists, but using default configuration file (/etc/rndc.conf)
version: 9.8.2rc1-RedHat-9.8.2-0.23.rc1.el6_5.1

you can try: /scripts/rebuildnamedconf

This script is deprecated. Please use /usr/local/cpanel/scripts/rebuilddnsconfig instead.
Executing /usr/local/cpanel/scripts/rebuilddnsconfig

Named could not be restarted, any obvious config errors should show up below this line.
WARNING: /etc/named.conf appears to contain errors which could not be corrected automatically!
/etc/named.conf:14394: unknown option ‘.tk.db’
/etc/named.conf:17217: unexpected end of input
Please correct these errors manually and rerun /usr/local/cpanel/scripts/fixrndc

you need manually check named.conf line 14394 and remove some incorrect entries from you configuration files.

then try to start named:

service named start

directadmin limit the number of emails sent by each user

if (open (LIMIT, “/etc/virtual/limit_$name”))

If you have that line in your exim.pl, then you’re good to go. If not, save it to /etc/exim.pl and restart exim. The same basic rules apply, you just need to type:
echo 300 > /etc/virtual/limit_username

where username is the User you wish to give the special limit to. This overrides the default /etc/virtual/limit file for that User.

If you think you might have a spammer, check your /etc/virtual/usage directory for a larger than normal filesize.
Any authenticated sends will show up with this command:
cd /var/log/exim
grep ‘A=login:’ mainlog* | less

which will show all emails sent from your server which used smtp-authentication. This is useful to find any email accounts who’s passwords may have been compromised (guessed), or simply just abusive Users.

With DA 1.42.0 and /etc/exim.pl version 13, you can use a per-email send limit, where you can limit each individual email account to a daily limit, eg:
echo 50 > /etc/virtual/user_limit
echo user_can_set_email_limit=1 >> /usr/local/directadmin/conf/directadmin.conf
/etc/init.d/directadmin restart

curl website response time

You can use this bash script:

#!/bin/bash
CURL=”/usr/bin/curl”
GAWK=”/usr/bin/gawk”
echo -n “Please pass the url you want to measure: ”
read url
URL=”$url”
result=`$CURL -o /dev/null -s -w %{time_connect}:%{time_starttransfer}:%{time_total} $URL`
echo ” Time_Connect Time_startTransfer Time_total ”
echo $result | $GAWK -F: ‘{ print $1″ “$2” “$3}’

linux screen scrollback

On your screen press Ctrl + a + [ to enter Copy Mode, then scroll up/down using keys j or k. Below are some other navigation keys:

h – Move the cursor left by one character
j – Move the cursor down by one line
k – Move the cursor up by one line
l – Move the cursor right by one character
0 – Move to the beginning of the current line
$ – Move to the end of the current line.
G – Moves to the specified line
(defaults to the end of the buffer).
C-u – Scrolls a half page up.
C-b – Scrolls a full page up.
C-d – Scrolls a half page down.
C-f – Scrolls the full page down.

delete vs truncate mysql

drop table will remove the entire table with data

delete * from table will remove the data, leaving the autoincrement values alone. it also takes a while if there’s a lot of data in the table.

truncate table will remove the data, reset the autoincrement values (but leave them as autoincrement columns, so it’ll just start at 1 and go up from there again), and is very quick.

amavis – TROUBLE in pre_loop_hook: db_init: BDB no dbC: __fop_file_setup: Retry limit (100) exceeded, File exists. at (eval 80) line 283.

if you are getting some kind of error like this: delivery temporarily suspended: connect to 127.0.0.1[127.0.0.1]:10024: Connection refused.

In your logs you can find some errors like: TROUBLE in pre_loop_hook: db_init: BDB no dbC: __fop_file_setup: Retry limit (100) exceeded, File exists. at (eval 80) line 283.

its amavis bug, you can fix it:

/etc/init.d/amavis stop
rm -rf /var/lib/amavis/db/*
/etc/init.d/amavis start
sendmail -q