Posts Tagged ‘ linux

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!

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 :)

How to do a port forward with IPTables on Linux

Hi there!

Long time no post so I am posting this simple howto to show you how to forward a port with IPTables on Linux. This come up because I installed Zenoss on a server and the default port is 8080 and I don’t want to use it so I forwarded the port 80 to the port 8080 on the same machine.

The command to do this is:

iptables -A PREROUTING -i eth0 -p tcp -m tcp --dport 80 -j REDIRECT \
--to-ports 8080

Cheers!