A2Billing Auto Installer for CentOS 5 (i386 or x86_64)

Hi buds,

I am sharing a script that I have worked for a couple of days for my work in order to keep things easy and automated for me as I normally have to install some A2Billing boxes and it’s a quite long and tedius process. For more info here is the README:

README

This script allows you to install A2Billing on a clean install of CentOS 5 (Either i386 or x86_64) just ‘Base’ is required to install it.

Among other things the script does:

- Install & Configure of LAMP (Requesting MySQL root & a2billing password)
- Install A2Billing
- Configure it for production state
- Compile from sources the Sangoma Wanpipe drivers if desired
- Disable SELinux & Firewall
- Disable unused default services in CentOS 5
- Install Asterisk from Digium repositories
- Configure cronjobs, logs, etc

HOW TO INSTALL

Be sure to have the ‘screen’ package installed, in order to do it you can run:

yum -y install screen

Then you have to execute the script on a screen session, to do this run:

screen

And then execute the script:

chmod +x a2billing_setup.sh
./a2billing_setup.sh

Source code available at: https://github.com/amontalban/A2Billing-Install-Script

Thanks for checking it out!

Quick TIP (Remember to restart crond service after a timezone change)

Hi folks!

I learned this the hard way! I migrated a website from one server to another with crontabs, and the customer needed to have the scripts running on CEST timezone (While the server was on CST timezone), so I changed the timezone but the scripts were still running at CST timezone, some googling and I found out that the crond service doesn’t take the changes of the timezone if you don’t restart so remember:

For RHEL/CentOS:

service crond restart

For other Linux:

/etc/init.d/crond restart

Take care!

Cheers.

How to delete a huge amount of files at once on linux

I was trying to delete a folder which tons of files and the rm command was giving me an error,
luckly the almighty find command did the job for me :)

-bash-3.2# ls -1 | wc -l
54999

Wow that’s a lot of files!

-bash-3.2# rm *
-bash: /bin/rm: Argument list too long

Yikes! Let’s try the find alternative

-bash-3.2# find . -type f -exec rm -f {} \;
-bash-3.2# ls -1 | wc -l
0

Great :)