Archives for the ‘Linux’ Category

NT_STATUS_BAD_NETWORK_NAME

By Jamsi • Jun 5th, 2007 • Category: Linux

Whilst trying to connect to a windows 2003 server via smbclient, I kept recieivng the error message “NT_STATUS_BAD_NETWORK_NAME”. After much google searching I found that the solution is to drop the trailing slash .. so simple .. so easy. I hate samba.
The error I kept receiving was
tree connect failed: NT_STATUS_BAD_NETWORK_NAME
WRONG way
smbclient //server/Data/ -U james
CORRECT way
smbclient [...]



Removing startup init scripts (rc.d)

By Jamsi • May 16th, 2007 • Category: Linux

For some reason I always get confused which command works on what operating system in order to remove startup scripts under a redhat based distribution.
For Centos use
/sbin/chkconfig –del

For Debian use
update-rc.d



WHM account missing

By Jamsi • Apr 13th, 2007 • Category: Linux

Do you have an account in Web Host Manager (WHM) that for some reason, is missing under the “list accounts” page? This can sometimes happen when you try a cPanel transfer and it fails. The easiest solution to fix this “WHM account missing” problem, is to follow this step;
Login to the console vi SSH and [...]



Installing BitTorrent via YUM

By Jamsi • Dec 27th, 2006 • Category: Linux

Are you trying to install BitTorrent on Centos using YUM? By default it won’t work.
I tried a rpm -i bittorrent, but it reported that I needed 6 python dependencies.
Screw that. What to save some time? Try this!

cd /etc/yum.repos.d
wget http://centos.karan.org/kbsingh-CentOS-Extras.repo

Next open up this file (/etc/sysconfig/rhn/sources) and add this line;

yum kb-centos-extras http://centos.karan.org/el4/extras/stable/$ARCH/RPMS

Next all you have to do [...]



Having troubles with Unrouteable address messages?!?

By Jamsi • Dec 21st, 2006 • Category: Linux

Use the following exim command to debug and find where your config has gone wrong!
/usr/sbin/exim -d -bt test@domain.com



Remove all Postfix queue items

By Jamsi • Dec 20th, 2006 • Category: Linux

Handy!
postsuper -d ALL

-d queue_id
Delete one message with the named queue ID from the
named mail queue(s) (default: [...]



Important Exim Commands

By Jamsi • Dec 11th, 2006 • Category: Linux

How many mails on the Queue
exim -bpr | grep “



Moving data between mysql hosts

By Jamsi • Nov 20th, 2006 • Category: Linux

Just something I used today to move a 60Meg table .. something phpMyAdmin refused to import
This command will utilize mysqldump to move data between two mysql servers. You need to make sure you have permission to access the SECOND server, either by specifying an access mask or using a wildcard (%) to allow [...]



Deleting email from mail queue

By Jamsi • Oct 6th, 2006 • Category: Linux

I had the need to delete all bounce messages in a sendmail mail queue, so I used the following
find /var/spool/mqueue -name ‘*’ -type f |xargs grep -l “User unknown” |xargs rm



Disable System Beep in VMWARE

By Jonesy • Aug 11th, 2006 • Category: Linux

If you, like me, can’t stand that obnoxious system beep in VMWare and have discovered that you can’t cut speaker wires inside a VM, you will probably appreciate this tip. Add the following line to your preferences file (~/.vmware/preferences on linux, preferences.ini on windows):
mks.noBeep = TRUE
Now your internal speaker will no longer drive you crazy [...]



Removing mail from the Exim mail queue

By Jamsi • Aug 4th, 2006 • Category: Linux

Jonesy came through again with a command that helped me out big time. I had all this mail queued up that I wanted to remove.
mailq |grep -B1 your@address.com|awk ‘{print $2 “-D”}’ |grep -v “^-D$” |sed ’s/-D$//g’ |awk ‘{print “/usr/sbin/exim -Mrm “$1}’|sh
Pretty much this will remove all items that are stuck in the EXIM queue that [...]



Command to move large emails from the queue

By Jamsi • Aug 4th, 2006 • Category: Linux

To delete large emails from a postfix or sendmail queue;
find . -size +1000k 2>/dev/null |sed -e ’s/^\.\///g;p;s/^d/q/g’ | xargs rm -rf
(cd /var/spool/mqueue; find . -size +1000k 2>/dev/null |sed -e ’s/^\.\///g;p;s/^d/q/g’ | awk ‘{print “mv ” $1 ” /folder/to/move/to/”}’ |sh)