Linux
Pure-ftpd does not work with centos vps ispconfig The Perfect Server
by Eric on May.10, 2010, under Linux
So you're following the tutorial at The Perfect Server - CentOS 5.4 x86_64 [ISPConfig 3] and when you get to installing Pure-FTPD you get FAILED on start, and see
May 10 08:09:58 pimp pure-ftpd: (?@?) [ERROR] Unable to switch capabilities : Operation not permitted
in the logs. Well, the answer is at hand. Rather than looking through countless google entries to find the answer buried on page three or four, just go here, where the folks at newart-design.net have put together the answer. Make sure to yum install first, that way you can chkserv on and use /etc/init.d to control.

tee-hee
by Eric on Nov.18, 2009, under Humor, Linux
root@fyre [~]# telnet localhost 25
Trying 127.0.0.1...
Connected to localhost (127.0.0.1).
Escape character is '^]'.
220-fyre.fyrenetworks.com ESMTP Exim 4.69 #1 Wed, 18 Nov 2009 06:07:29 -0600
220-*yawn* huh? Wha? What is it?
220-Oh, it's you. I suppose you want me to send mail.
220-Well fine. But just so you know, I don't send spam.
220-(That means you are not authorized to send unsolicited
220-and/or bulk e-mail through this system, you dimwit.)
220 Now do your thing and let me get back to sleep, huh?
HELO localhost
250 fyre.fyrenetworks.com Hello localhost [127.0.0.1]
This is what happens when I'm under the influence of pain medication, wake up before anyone else in the house, can't get back to sleep, have too much chocolate, don't feel 100%, and am slightly bored...
Now, I just need to figure out if it's possible to include a callout at that point in exim.conf to a perl script that will randomize the connect messages.
Default Mail Clean Script
by Eric on Mar.17, 2009, under Linux, Scripts
Here's a quick little script to clean the default mail accounts of mail on cPanel servers. Note that this only helps if you have already disabled the catchalls.
#!/bin/bash
###############################################
# CLEAN MAIL #
# v0.1 #
# #
# Cleans the mail from default accounts based #
# on cPanel usernames. Create a file in /root #
# called 'doit'. Add one cPanel username per #
# line. That should do nicely. Oh, this will #
# take a while, so run the sucker in screen, #
# mkay, Batman? #
###############################################
# Some dedis have LS_OPTIONS include -a...
# that would be bad for this script.
# so, we reset it.
LS_OPTIONS='-A'
# start the loop...
for i in `cat /root/doit`
do
# Delete from the new folder.
cd /home/$i/mail/new
# can't rm if there's too many, and by using
# an ls and awk, we avoid another loop.
ls -l | awk '{print "rm -fv "$9}'|bash
# Delete from the cur folder.
cd /home/$i/mail/cur
# Comment repetition carefully avoided, here ![]()
ls -l | awk '{print "rm -fv "$9}'|bash
done
# NINJAMOJO!
It's simple. Get a list of cPanel usernames, one per line, create a file in /root called 'doit', and slap the usernames in there. Then, 'bash cleanmail'.

Removing malicious code with perl and sed…
by Eric on Feb.10, 2009, under Linux, One-liners
Today, I had an instance where a customer's site had been attacked with a code injection affected all of his .php files. In this case, it was an old vBulletin install that had several known exploits on milw0rm (proof you should update often) that caused it.
Fortunately, the code was injected as a single line, and was the same in every file, and had the added benefit of being on the top line of the file. So, I could use abit of perl to remove it, and then a bit of sed magic to remove the blank line left by Perl (because for some reason, it didn't want to remove the newline).




