BinaryGuru

Hacking digital systems

Increasing the size of the NTFS Change Journal


The default size for the NTFS change journal is around 1 MB which is too small for large servers with many (1 million+) files.


1. Find Total number of files on an NTFS volume

At an elevated command prompt, type:

C:\Windows\system32> dir C:\ /s /a /w
...
     Total Files Listed:
           1291512 File(s) 1,946,620,624,461 bytes
           325206 Dir(s)  390,660,280,320 bytes free

Add the number of files and directories together for the total amount; 1,616,718 in this example.


2. Check current USN journal size

Query the current value:

C:\Windows\system32> fsutil usn queryjournal C:
Usn Journal ID   : 0x01cba9fe68247fa6
First Usn        : 0x0000001047d00000
Next Usn         : 0x000000104a0bac58
Lowest Valid Usn : 0x0000000000000000
Max Usn          : 0x7fffffffffff0000
Maximum Size     : 0x0000000002000000
Allocation Delta : 0x0000000000400000

Use the table below to find the approriate values for Maximum Size and Allocation Delta.

Files Maximum Size (m) in bytes Allocation Delta (a) in bytes m (MB) m (hex) a (hex)
400,000 536,870,912 67,108,864 512 20000000 4000000
600,000 805,306,368 100,663,296 768 30000000 6000000
800,000 1,073,741,824 134,217,728 1,024 40000000 8000000
1,000,000 1,342,177,280 167,772,160 1,280 50000000 A000000
1,200,000 1,610,612,736 201,326,592 1,536 60000000 C000000
1,400,000 1,879,048,192 234,881,024 1,792 70000000 E000000
1,600,000 2,147,483,648 268,435,456 2,048 80000000 10000000
1,800,000 2,415,919,104 301,989,888 2,304 90000000 12000000
2,000,000 2,684,354,560 335,544,320 2,560 A0000000 14000000
2,200,000 2,952,790,016 369,098,752 2,816 B0000000 16000000
2,400,000 3,221,225,472 402,653,184 3,072 C0000000 18000000
2,600,000 3,489,660,928 436,207,616 3,328 D0000000 1A000000
2,800,000 3,758,096,384 469,762,048 3,584 E0000000 1C000000
3,000,000 4,026,531,840 503,316,480 3,840 F0000000 1E000000
3,200,000 4,294,967,296 536,870,912 4,096 100000000 20000000

As for the example above, the default USN change journal size of 33,554,432 is to small for the volume. According to the table above, since our volume has at least 1,616,718 file entries; we should set the Maximum Size to 2,415,919,104 and Allocation Delta to 301,989,888.


3. Change the size of the USN change journal

Increase the Maximum Size of the USN change journal using fsutil:

C:\Windows\system32> fsutil usn createjournal m=2415919104 a=301989888 J:

Query the USN change journal to verify the changes were applied:

C:\Windows\system32> fsutil usn queryjournal C:
Usn Journal ID   : 0x01cba9fe68247fa6
First Usn        : 0x0000001047d00000
Next Usn         : 0x000000104a0bac58
Lowest Valid Usn : 0x0000000000000000
Max Usn          : 0x7fffffffffff0000
Maximum Size     : 0x0000000090000000
Allocation Delta : 0x0000000012000000

Resources

Advertisements

Upgrade GIT 1.8.x to GIT 2.10.x on RHEL Server 7.3


1. Install the latest updates

In this step, you will download and install the latest updates for your system from Red Hat. In the process, you will verify that your system has a current Red Hat subscription and is able to receive updates.

First, start a Terminal window from the Application menu. Then, after using su to change to the root user ID, use subscription-manager to verify that you have access to Red Hat software repositories.

$ su -
# subscription-manager repos --list-enabled

If you don’t see any enabled repositories, your system might not be registered with Red Hat or might not have a valid subscription. See Troubleshooting and FAQ for more information.

Now download and install any available updates by running yum update.

# yum -y update

If yum updates the kernel package or installs a large number of updates, you should reboot your system. You can do this from the VM’s desktop by clicking the down arrow icon in the upper right corner, then clicking the power icon. Alternatively you can reboot the system from the command line:

# reboot

(You do not nee to reboot the machine unless this is a fresh install)


2. Enable additional software repositories

In this step you will configure your system to obtain software from the Optional RPMs and RHSCL software repositories. The Optional RPMs repository includes a number of development packages. The RHSCL repository includes the both Red Software Collections as well as Red Hat Developer Toolset (DTS).

$ su -
# subscription-manager repos --enable rhel-server-rhscl-7-rpms
# subscription-manager repos --enable rhel-7-server-optional-rpms
# subscription-manager repos --enable rhel-7-server-extras-rpms

3. Extra Packages for Enterprise Linux (EPEL)

You need to install the EPEL repository:

# sudo yum install https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm

3. Inline with Upstream Stable (IUS)

You need to install the IUS repository:

# sudo yum install https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm

4. Replace GIT 1.8.x with GIT 2.10.x

# sudo yum shell
> erase git
> install git2u
> quit

5. Check to make sure GIT has been upgraded.

# git --version
git version 2.10.2

Resources:

Adobe CS6 Activation Bypass 2014


Add these entries to your HOSTS file to block adobe products from on-line activation.Adobe Logo

If you need help editing your hosts file, check this page for instructions:
http://www.howtogeek.com/howto/27350/beginner-geek-how-to-edit-your-hosts-file/

PASTEBIN: http://pastebin.com/YvfJss2Q

127.0.0.1 209-34-83-73.ood.opsource.net
127.0.0.1 3dns-1.adobe.com
127.0.0.1 3dns-2.adobe.com
127.0.0.1 3dns-3.adobe.com
127.0.0.1 3dns-4.adobe.com
127.0.0.1 3dns-5.adobe.com
127.0.0.1 3dns.adobe.com
127.0.0.1 activate-sea.adobe.com
127.0.0.1 activate-sjc0.adobe.com
127.0.0.1 activate.adobe.com
127.0.0.1 activate.wip.adobe.com
127.0.0.1 activate.wip1.adobe.com
127.0.0.1 activate.wip2.adobe.com
127.0.0.1 activate.wip3.adobe.com 
127.0.0.1 activate.wip4.adobe.com
127.0.0.1 adobe-dns-1.adobe.com
127.0.0.1 adobe-dns-2.adobe.com
127.0.0.1 adobe-dns-3.adobe.com
127.0.0.1 adobe-dns-4.adobe.com
127.0.0.1 adobe-dns.adobe.com
127.0.0.1 adobe.activate.com
127.0.0.1 adobeereg.com
127.0.0.1 ereg.adobe.com
127.0.0.1 ereg.wip.adobe.com
127.0.0.1 ereg.wip1.adobe.com
127.0.0.1 ereg.wip2.adobe.com
127.0.0.1 ereg.wip3.adobe.com
127.0.0.1 ereg.wip4.adobe.com 
127.0.0.1 hl2rcv.adobe.com
127.0.0.1 lm.licenses.adobe.com
127.0.0.1 lmlicenses.wip4.adobe.com
127.0.0.1 ood.opsource.net
127.0.0.1 practivate.adobe
127.0.0.1 practivate.adobe.com
127.0.0.1 practivate.adobe.ipp
127.0.0.1 practivate.adobe.newoa
127.0.0.1 practivate.adobe.ntp
127.0.0.1 t3dns.adobe.com
127.0.0.1 tpractivate.adobe.newoa
127.0.0.1 wip.adobe.com
127.0.0.1 wip1.adobe.com
127.0.0.1 wip2.adobe.com
127.0.0.1 wip3.adobe.com 
127.0.0.1 wip4.adobe.com
127.0.0.1 wwis-dubc1-vip100.adobe.com
127.0.0.1 wwis-dubc1-vip101.adobe.com
127.0.0.1 wwis-dubc1-vip102.adobe.com
127.0.0.1 wwis-dubc1-vip103.adobe.com
127.0.0.1 wwis-dubc1-vip104.adobe.com
127.0.0.1 wwis-dubc1-vip105.adobe.com
127.0.0.1 wwis-dubc1-vip106.adobe.com
127.0.0.1 wwis-dubc1-vip107.adobe.com
127.0.0.1 wwis-dubc1-vip108.adobe.com
127.0.0.1 wwis-dubc1-vip109.adobe.com
127.0.0.1 wwis-dubc1-vip110.adobe.com
127.0.0.1 wwis-dubc1-vip111.adobe.com
127.0.0.1 wwis-dubc1-vip112.adobe.com
127.0.0.1 wwis-dubc1-vip113.adobe.com 
127.0.0.1 wwis-dubc1-vip114.adobe.com
127.0.0.1 wwis-dubc1-vip115.adobe.com
127.0.0.1 wwis-dubc1-vip116.adobe.com
127.0.0.1 wwis-dubc1-vip117.adobe.com
127.0.0.1 wwis-dubc1-vip118.adobe.com
127.0.0.1 wwis-dubc1-vip119.adobe.com
127.0.0.1 wwis-dubc1-vip120.adobe.com
127.0.0.1 wwis-dubc1-vip121.adobe.com
127.0.0.1 wwis-dubc1-vip122.adobe.com
127.0.0.1 wwis-dubc1-vip123.adobe.com
127.0.0.1 wwis-dubc1-vip124.adobe.com
127.0.0.1 wwis-dubc1-vip125.adobe.com
127.0.0.1 wwis-dubc1-vip30.adobe.com
127.0.0.1 wwis-dubc1-vip31.adobe.com
127.0.0.1 wwis-dubc1-vip32.adobe.com 
127.0.0.1 wwis-dubc1-vip33.adobe.com
127.0.0.1 wwis-dubc1-vip34.adobe.com
127.0.0.1 wwis-dubc1-vip35.adobe.com
127.0.0.1 wwis-dubc1-vip36.adobe.com
127.0.0.1 wwis-dubc1-vip37.adobe.com
127.0.0.1 wwis-dubc1-vip38.adobe.com
127.0.0.1 wwis-dubc1-vip39.adobe.com
127.0.0.1 wwis-dubc1-vip40.adobe.com
127.0.0.1 wwis-dubc1-vip41.adobe.com
127.0.0.1 wwis-dubc1-vip42.adobe.com
127.0.0.1 wwis-dubc1-vip43.adobe.com
127.0.0.1 wwis-dubc1-vip44.adobe.com
127.0.0.1 wwis-dubc1-vip45.adobe.com
127.0.0.1 wwis-dubc1-vip46.adobe.com
127.0.0.1 wwis-dubc1-vip47.adobe.com 
127.0.0.1 wwis-dubc1-vip48.adobe.com
127.0.0.1 wwis-dubc1-vip49.adobe.com
127.0.0.1 wwis-dubc1-vip50.adobe.com
127.0.0.1 wwis-dubc1-vip51.adobe.com
127.0.0.1 wwis-dubc1-vip52.adobe.com
127.0.0.1 wwis-dubc1-vip53.adobe.com
127.0.0.1 wwis-dubc1-vip54.adobe.com
127.0.0.1 wwis-dubc1-vip55.adobe.com
127.0.0.1 wwis-dubc1-vip56.adobe.com
127.0.0.1 wwis-dubc1-vip57.adobe.com
127.0.0.1 wwis-dubc1-vip58.adobe.com
127.0.0.1 wwis-dubc1-vip59.adobe.com
127.0.0.1 wwis-dubc1-vip60.adobe.com
127.0.0.1 wwis-dubc1-vip61.adobe.com
127.0.0.1 wwis-dubc1-vip62.adobe.com 
127.0.0.1 wwis-dubc1-vip63.adobe.com
127.0.0.1 wwis-dubc1-vip64.adobe.com
127.0.0.1 wwis-dubc1-vip65.adobe.com
127.0.0.1 wwis-dubc1-vip66.adobe.com
127.0.0.1 wwis-dubc1-vip67.adobe.com
127.0.0.1 wwis-dubc1-vip68.adobe.com
127.0.0.1 wwis-dubc1-vip69.adobe.com
127.0.0.1 wwis-dubc1-vip70.adobe.com
127.0.0.1 wwis-dubc1-vip71.adobe.com
127.0.0.1 wwis-dubc1-vip72.adobe.com
127.0.0.1 wwis-dubc1-vip73.adobe.com
127.0.0.1 wwis-dubc1-vip74.adobe.com
127.0.0.1 wwis-dubc1-vip75.adobe.com
127.0.0.1 wwis-dubc1-vip76.adobe.com
127.0.0.1 wwis-dubc1-vip77.adobe.com 
127.0.0.1 wwis-dubc1-vip78.adobe.com
127.0.0.1 wwis-dubc1-vip79.adobe.com
127.0.0.1 wwis-dubc1-vip80.adobe.com
127.0.0.1 wwis-dubc1-vip81.adobe.com
127.0.0.1 wwis-dubc1-vip82.adobe.com
127.0.0.1 wwis-dubc1-vip83.adobe.com
127.0.0.1 wwis-dubc1-vip84.adobe.com
127.0.0.1 wwis-dubc1-vip85.adobe.com
127.0.0.1 wwis-dubc1-vip86.adobe.com
127.0.0.1 wwis-dubc1-vip87.adobe.com
127.0.0.1 wwis-dubc1-vip88.adobe.com
127.0.0.1 wwis-dubc1-vip89.adobe.com
127.0.0.1 wwis-dubc1-vip90.adobe.com
127.0.0.1 wwis-dubc1-vip91.adobe.com
127.0.0.1 wwis-dubc1-vip92.adobe.com 
127.0.0.1 wwis-dubc1-vip93.adobe.com
127.0.0.1 wwis-dubc1-vip94.adobe.com
127.0.0.1 wwis-dubc1-vip95.adobe.com
127.0.0.1 wwis-dubc1-vip96.adobe.com
127.0.0.1 wwis-dubc1-vip97.adobe.com
127.0.0.1 wwis-dubc1-vip98.adobe.com
127.0.0.1 wwis-dubc1-vip99.adobe.com
127.0.0.1 www.adobeereg.com
127.0.0.1 www.wip.adobe.com
127.0.0.1 www.wip1.adobe.com
127.0.0.1 www.wip2.adobe.com
127.0.0.1 www.wip3.adobe.com
127.0.0.1 www.wip4.adobe.com

Webmin 1.710 on Ubuntu Server 14.04 64-bit running on Amazon EC2


Webmin LogoThis tutorial shows how to install the latest version of Webmin in Ubuntu Linux from its official repository.

As you may know, Webmin is a web-based interface for system administration for Unix. Using any modern web browser, you can setup user accounts, Apache, DNS, file sharing and much more. Webmin removes the need to manually edit Unix configuration files like /etc/passwd, and lets you manage a system from the console or remotely.

To get started, login your remote server and follow the steps below:

Amazon EC2 AMI usedUbuntu Trusty Logo

Ubuntu Server 14.04 LTS 64-bit (HVM), EBS General Purpose (SSD) Volume Type. Support available from Canonical (http://www.ubuntu.com/cloud/services). – ami-9eaa1cf6

https://console.aws.amazon.com/ec2/home?region=us-east-1#launchAmi=ami-9eaa1cf6


  1. Update sources:
    # sudo apt-get update
  2. Install new kernel to support quotas:
    # sudo apt-get install linux-image-extra-virtual↵
    # sudo reboot↵

    ⇒ When asked, choose to install the package maintainers version (top option)

  3. Upgrade rest of packages and reboot:
    # sudo apt-get dist-upgrade↵
    # sudo reboot↵
  4. Load and install kernel modules:
    # sudo depmod -a↵
    # sudo modprobe quota_v1↵
    # sudo modprobe quota_v2↵
  5. Enable new kernel modules to load on boot and reboot:
    # sudo echo quota_v1 >> /etc/modules↵
    # sudo echo quota_v2 >> /etc/modules↵
    # sudo reboot↵
  6. Install quota:
    # sudo apt-get install quota↵
  7. Please see official documentation for configuration and usage of quota:
    # man fstab↵
    # man quotacheck↵
    # man quota↵
    # man quotaon↵
  8. Add inbound rule to the security group assigned to your EC2 instance:
    Type: Custom TCP Rule
    Protocol: TCP
    Port Range: 10000
    Source: 0.0.0.0/0

    ⇒ I highly recommend you set the source to your IP. This will block access to unauthorized users.
    ⇒ Official documentation for Amazon EC2 Security Groups:

    https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/using-network-security.html

  9. Login to Webmin over HTTPS using your EC2 Public DNS or Elastic IP:
    https://ec2-54-1-1-1.compute-1.amazonaws.com:10000/
    https://54.1.1.1:10000/

If you need help using Webmin, please refer to the Webmin Wiki hosted at:
http://docs.virtualmin.com/Webmin/Main_Page

FreePBX 1.8.1.4 (CentOS 5.5) & A2Billing 1.9.4 (Stable) inside VirtualBox 4.0.8 Installation Notes


32-bit CentOS 5.5 Only

1. Download FreePBX from http://www.freepbx.org/download-freepbx

Here’s a direct link to the version I downloaded:
http://downloads.freepbxdistro.org/ISO/FreePBX-Distro-Net-1.8.1.4.iso


2. Make a new VirtualBox virtual machine with these specs:

  • OS Type: Red Hat
  • Base Memory: 512MiB (Default)
  • Hard Disk Type: Dynamic
  • Hard Disk Size: 8.00GiB
  • Network: Bridged Adapter

NOTE: You will have to go into the settings and change the network adapter type after you create the virtual machine.


3. Start the virtual machine, VBox will then present the firstime run dialog.

This dialog will ask you to show it where the instllation media is located.
Please point it to where you saved FreePBX-Distro-Net-1.8.1.4.iso


4. FreePBX installation will now start.

Please follow the on-screen instruction for completeing the installation.
I reccoment at this point to setup a static IP for this server.


5. When you have rebooted and logged in, please update using YUM:

yum clean all
yum update
yum upgrade

Reboot using:

shutdown -r now

Then install the packeges nessesary to install VirtualBox Guest Additions:

yum install -y gcc
yum install -y kernel-devel

Reboot again:

shutdown -r now

NOTE: I have found you need to add the option ‘divider=10’ to you kernel boot options to reduce idle CPU load. On my machine, the idle load went from ~20% down to ~1% idle load.


6. We are now ready to install the Guest Additions.

Login as root and then from the Devices menu, choose Install Guest Additions… (or press [Hostkey]+D on your keyboard). This will insert then ISO into the virtual optical drive.

We will need to mount this ISO to use it:

mkdir /mnt/cdrom
mount /dev/cdrom /mnt/cdrom

7. Run the install script to install the guest additions:

cd /mnt/cdrom
./VBoxLinuxAdditions.run

Follow the standard procedure for installing the Guest Addtions documented in the VirtualBox User’s Manual. You will have to reboot when the installation has completed.


8. We must now manually upgrade PHP 5.1.x to 5.2.x

I will be using Jason Litka’s YUM Repo.

Instructions on installing this repo into your system can be found here:
http://www.jasonlitka.com/yum-repository/


9. Once you have added the repo following the instuction on Jason’s site, run the following commands:

yum clean all
yum update

YUM will ask you if it’s OK to upgrade the selected packages, type ‘y’ and hit [Enter].
Once YUM has finished updating, reboot the system:

shutdown -r now

10. Download the A2Billing tarball and extract:

cd /usr/local/src/
wget --no-check-certificate https://github.com/Star2Billing/a2billing/tarball/v1-current
tar xvf Star2Billing-a2billing-v1-current-0-g95789f5.tar.gz
ln -s ./Star2Billing-a2billing-d960375 ./a2billing

I made a symlink to /usr/local/src/Star2Billing-a2billing-d960375 called a2billing to make the directory access easier.


11. Before we can install A2Billing we need to make sure we have the required dependent packages installed:

ln -s /var/lib/asterisk /usr/share/asterisk
yum install -y php-mcrypt.i386

The symlink is for avoiding compatibility issues from .deb based distros. A2Billing setup scripts tend to assume a LOT of things.


12. Prepare the database:

mysql -u root -p
Enter password:
Welcome to the MySQL monitor.  Commands end with ; or g.
Your MySQL connection id is 1706
Server version: 5.1.52 MySQL Community Server (GPL) by Utter Ramblings

Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
This software comes with ABSOLUTELY NO WARRANTY. This is free software,
and you are welcome to modify and redistribute it under the GPL v2 license

Type 'help;' or 'h' for help. Type 'c' to clear the current input statement.
mysql> CREATE DATABASE a2billing;
 Query OK, 1 row affected (0.00 sec)
mysql> quit
 Bye

NOTE: I had to change the MySQL root password becuase I had not set the password and I could not find the default password set by FreePBX. Also, FreePBX does not use the root user anyway for database access, it instead uses ‘freepbxuser’.

NOTE: If you need help changing the MySQL root user password without knowing the original password, please read the insructions here:
http://www.cyberciti.biz/tips/recover-mysql-root-password.html

NOTE: You will have to change /etc/init.d/mysql to /etc/init.d/mysqld where applicable in the above tutorial.


13. Populate the database with new tables from install-db.sh script:

cd /usr/local/src/Star2Billing-a2billing-d960375/DataBase/mysql-5.x
./install-db.sh

When the script is executed, it will interactively ask for input to setup the database for you. Following the example below, you will need your A2Billing database name, hostname where the database is located, username to use to make the changes and the respective password.

Install A2Billing DataBase
-----------------------------
Enter Database Name :
a2billing
Enter Hostname :
localhost
Enter UserName :
root
Enter Password :
mypass
mysql --user=root --password=mypass --host=localhost a2billing

NOTE: Make sure to replace ‘mypass‘ for the password you use for the MySQL root user.

The script will take a few seconds to process and then it will drop you back at the command prompt with no errors if everything went well.


14. Set permissions for the new database:

mysql -u root -p
Enter password:
Welcome to the MySQL monitor.  Commands end with ; or g.
Your MySQL connection id is 1706
Server version: 5.1.52 MySQL Community Server (GPL) by Utter Ramblings

Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
This software comes with ABSOLUTELY NO WARRANTY. This is free software,
and you are welcome to modify and redistribute it under the GPL v2 license

Type 'help;' or 'h' for help. Type 'c' to clear the current input statement.
mysql> CREATE USER 'a2buser'@'localhost' IDENTIFIED BY 'mypass';
 Query OK, 1 row affected (0.00 sec)
mysql> GRANT ALL ON a2billing.* TO 'a2buser'@'localhost';
 Query OK, 1 row affected (0.00 sec)
mysql> quit
 Bye

Check for the new tables (should be 97 of them), and check the new users grants (should be all of them):

mysql -u a2buser -p
Enter password:
Welcome to the MySQL monitor.  Commands end with ; or g.
Your MySQL connection id is 1706
Server version: 5.1.52 MySQL Community Server (GPL) by Utter Ramblings

Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
This software comes with ABSOLUTELY NO WARRANTY. This is free software,
and you are welcome to modify and redistribute it under the GPL v2 license

Type 'help;' or 'h' for help. Type 'c' to clear the current input statement.
mysql> USE a2billing
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A
Database changed
mysql> SHOW TABLES;
+---------------------------+
| Tables_in_a2billing       |
+---------------------------+
| cc_agent                  |
| cc_agent_commission       |
| cc_agent_signup           |
| cc_agent_tariffgroup      |
| cc_alarm                  |
| cc_alarm_report           |
| cc_autorefill_report      |
| cc_backup                 |
| cc_billing_customer       |
| cc_call                   |
| cc_call_archive           |
| cc_callback_spool         |
| cc_callerid               |
| cc_callplan_lcr           |
| cc_campaign               |
| cc_campaign_config        |
| cc_campaign_phonebook     |
| cc_campaign_phonestatus   |
| cc_campaignconf_cardgroup |
| cc_card                   |
| cc_card_archive           |
| cc_card_group             |
| cc_card_history           |
| cc_card_package_offer     |
| cc_card_seria             |
| cc_card_subscription      |
| cc_cardgroup_service      |
| cc_charge                 |
| cc_config                 |
| cc_config_group           |
| cc_configuration          |
| cc_country                |
| cc_currencies             |
| cc_did                    |
| cc_did_destination        |
| cc_did_use                |
| cc_didgroup               |
| cc_epayment_log           |
| cc_epayment_log_agent     |
| cc_iax_buddies            |
| cc_invoice                |
| cc_invoice_conf           |
| cc_invoice_item           |
| cc_invoice_payment        |
| cc_iso639                 |
| cc_logpayment             |
| cc_logpayment_agent       |
| cc_logrefill              |
| cc_logrefill_agent        |
| cc_message_agent          |
| cc_monitor                |
| cc_notification           |
| cc_notification_admin     |
| cc_outbound_cid_group     |
| cc_outbound_cid_list      |
| cc_package_group          |
| cc_package_offer          |
| cc_package_rate           |
| cc_packgroup_package      |
| cc_payment_methods        |
| cc_payments               |
| cc_payments_agent         |
| cc_payments_status        |
| cc_paypal                 |
| cc_phonebook              |
| cc_phonenumber            |
| cc_prefix                 |
| cc_provider               |
| cc_ratecard               |
| cc_receipt                |
| cc_receipt_item           |
| cc_remittance_request     |
| cc_restricted_phonenumber |
| cc_server_group           |
| cc_server_manager         |
| cc_service                |
| cc_service_report         |
| cc_sip_buddies            |
| cc_sip_buddies_empty      |
| cc_speeddial              |
| cc_status_log             |
| cc_subscription_service   |
| cc_subscription_signup    |
| cc_support                |
| cc_support_component      |
| cc_system_log             |
| cc_tariffgroup            |
| cc_tariffgroup_plan       |
| cc_tariffplan             |
| cc_templatemail           |
| cc_ticket                 |
| cc_ticket_comment         |
| cc_timezone               |
| cc_trunk                  |
| cc_ui_authen              |
| cc_version                |
| cc_voucher                |
+---------------------------+
97 rows in set (0.00 sec)
mysql> SHOW GRANTS;
+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Grants for a2buser@localhost                                                                                                                                                                                                 |
+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| GRANT USAGE ON *.* TO 'a2buser'@'localhost' IDENTIFIED BY PASSWORD '*C6A9E404EE2F46734320E4727B7A791BC483BEC1'                                                                                                               |
| GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, REFERENCES, INDEX, ALTER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE ON `a2billing`.* TO 'a2buser'@'localhost' |
+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
2 rows in set (0.00 sec)
mysql> quit
Bye

15. Setup the a2billing.conf file:

ln -s /usr/local/src/a2billing/a2billing.conf /etc/a2billing.conf
nano /etc/a2billing.conf

Make sure the parameters in the file match these below:

[database]
hostname = localhost
port = 3306
user = a2buser
password = mypass
dbname = a2billing
dbtype = mysql

Type [Ctrl]+O and then [Enter] to save. Press [Ctrl]+X to exit to the command line.

NOTE: Don’t forget to replace ‘mypass‘ with the one you selected earlier.


16. Fix permissions, files and folders:

chmod 777 /etc/asterisk
touch /etc/asterisk/additional_a2billing_iax.conf
touch /etc/asterisk/additional_a2billing_sip.conf
echo '#include additional_a2billing_sip.conf' >> /etc/asterisk/sip.conf
echo '#include additional_a2billing_iax.conf' >> /etc/asterisk/iax.conf
chown -Rf apache:apache /etc/asterisk/additional_a2billing_iax.conf
chown -Rf apache:apache /etc/asterisk/additional_a2billing_sip.conf
chmod 777 /etc/asterisk/additional_a2billing_iax.conf
chmod 777 /etc/asterisk/additional_a2billing_iax.conf

17. Install sound files

cd /usr/local/src/a2billing/addons/sounds
./install_a2b_sounds.sh
chown -R asterisk:asterisk /usr/share/asterisk/sounds/

18. Configure Asterisk Manager

nano /etc/asterisk/manager.conf

Notice that we are using the default values (myasterisk, mycode) in this section. The configuration should look like this

[general]
enabled = yes
port = 5038
bindaddr = 0.0.0.0
[myasterisk]
secret=mycode
permit=127.0.0.1/255.255.255.0
read=system,call,log,verbose,command,agent,user
write=system,call,log,verbose,command,agent,user

19. Install The AGI components

Create a symbolic link of the entire content of the AGI directory into asterisk agi-bin directory:

ln -s /usr/local/src/a2billing/AGI/a2billing.php /var/lib/asterisk/agi-bin/a2billing.php
ln -s /usr/local/src/a2billing/AGI/a2billing_monitoring.php /var/lib/asterisk/agi-bin/a2billing_monitoring.php
ln -s /usr/local/src/a2billing/common/lib /var/lib/asterisk/agi-bin/lib
chmod 0774 /usr/local/src/a2billing/AGI/a2billing.php
chmod 0774 /usr/local/src/a2billing/AGI/a2billing-monitoring.php
chmod -Rf 0774 /usr/local/src/a2billing/common/lib
chown asterisk:asterisk /usr/local/src/a2billing/AGI/a2billing.php
chown asterisk:asterisk /usr/local/src/a2billing/AGI/a2billing-monitoring.php
chown -Rf asterisk:asterisk /usr/local/src/a2billing/common/lib

20. Install web-based Graphical interfaces

mkdir /var/www/html/a2billing
chown asterisk:asterisk /var/www/html/a2billing
mkdir -p /var/lib/a2billing/script
mkdir -p /var/run/a2billing
ln -s /usr/local/src/a2billing/admin /var/www/html/a2billing/admin
ln -s /usr/local/src/a2billing/agent /var/www/html/a2billing/agent
ln -s /usr/local/src/a2billing/customer /var/www/html/a2billing/customer
ln -s /usr/local/src/a2billing/common /var/www/html/a2billing/common
chmod -R 755 /usr/local/src/a2billing/admin/templates_c
chmod -R 755 /usr/local/src/a2billing/customer/templates_c
chmod -R 755 /usr/local/src/a2billing/agent/templates_c
chown -Rf asterisk:asterisk /usr/local/src/a2billing/admin/templates_c
chown -Rf asterisk:asterisk /usr/local/src/a2billing/customer/templates_c
chown -Rf asterisk:asterisk /usr/local/src/a2billing/agent/templates_c

You should be able to login to the A2Billing Admin site located at:
http://yourip/a2billing/admin/

Username: root
Password: changepassword

NOTE: You should test this to make sure A2Billing works.

NOTE: I also had to set permissions on the /var/lib/php/sessions folder otherwise after logging into the Admin panel, clicking on any of the links would kick me off and force me to log in again. Here are the commands I used to fix this problem:

chmod -R 777 /var/lib/php/session
chown -R asterisk:asterisk /var/lib/php/session

21. Integrating FreePBX with A2Billing

I followed instructions for integrating A2Billing into FreePBX from this web site:
http://sysadminman.net/blog/2009/integrating-freepbx-with-a2billing-621

NOTE: Make sure to change the pipe symbols ‘|’ to commas ‘,’ in the examples in that site as you are using Asterisk 1.8.4.1. The pipe opertator was changed to commas in version 1.6 of Asterisk.


As a final note, A2Billing does not officially support Asterisk versions 1.6.x and 1.8.x; if you have problems, you will need to get help on the A2Billing forum located at: http://forum.asterisk2billing.org/

Good luck with getting all of this working the way you want!

Installing Asterisk With Yum


This tutorial tells you how to install Asterisk 1.6x on CentOS 5 and RHEL 5 using yum.I will be testing this on my production server to see if it is a better method for installing Asterisk than by compiling from source wi\hich is what I normally do.

Description:
Installing a binary distribution of Asterisk makes it easier to maintain your system. Using the package management tools that are included with your Linux distribution, you can install and update software without manually managing dependencies (libraries and utilities on which applications rely). Currently Asterisk is available for automated binary installation using the ‘yum’ utility on CentOS 5 Linux and for RedHat Enterprise Linux 5.

See link:
http://www.asterisk.org/downloads/yum

Notes:
Where it first says to install using yum, there are a few package names cut off bauce of the advertisement. You need to enter the following command into your terminal:
yum install asterisk16 asterisk16-configs asterisk16-voicemail dahdi-linux dahdi-tools libpri

Installing D-Link DWA-552 on CentOS 5.5 (i386)


Installing D-Link DWA-552 on CentOS 5.5 (i386)

NOTE: You must be logged in as root to perform these operations.

Prerequisites
* Configure RPMforge in yum
* Install madwifi drivers
* Enable NetworkManager
* Install Priorities

>>> Configure RPMforge in yum <<<
You need to install RPMforge in order to add madwifi to the yum repositories.

1. Make sure you have wget:
# yum -y install wget*
> Loaded plugins: fastestmirror, priorities
> Loading mirror speeds from cached hostfile
>  * addons: centos.mirror.iweb.ca
>  * base: centos.mirror.iweb.ca
>  * centosplus: centos.mirror.iweb.ca
>  * contrib: centos.mirror.iweb.ca
>  * extras: centos.mirror.iweb.ca
>  * rpmforge: apt.sw.be
>  * updates: centos.mirror.iweb.ca
> Excluding Packages from CentOS-5 – Base
> Finished
> Reducing CentOS-5 – Plus to included packages only
> Finished
> Excluding Packages from CentOS-5 – Updates
> Finished
> 436 packages excluded due to repository priority protections
> Setting up Install Process
> Resolving Dependencies
> –> Running transaction check
> —> Package wget.i386 0:1.11.4-2.el5_4.1 set to be updated
> –> Finished Dependency Resolution
>
> Dependencies Resolved
>
> ================================================================================
>  Package        Arch           Version                     Repository      Size
> ================================================================================
> Installing:
>  wget           i386           1.11.4-2.el5_4.1            base           582 k
>
> Transaction Summary
> ================================================================================
> Install       1 Package(s)
> Upgrade       0 Package(s)
>
> Total download size: 582 k
> Downloading Packages:
> wget-1.11.4-2.el5_4.1.i386.rpm                           | 582 kB     00:00
> Running rpm_check_debug
> Running Transaction Test
> Finished Transaction Test
> Transaction Test Succeeded
> Running Transaction
>   Installing     : wget                                                     1/1
>
> Installed:
>   wget.i386 0:1.11.4-2.el5_4.1
>
> Complete!

2. Make sure you are in the root home folder:
# cd ~

3. Download the rpmforge-release package:
# wget http://packages.sw.be/rpmforge-release/rpmforge-release-0.5.1-1.el5.rf.i386.rpm
> –2010-06-24 01:29:41–  http://packages.sw.be/rpmforge-release/rpmforge-release-0.5.1-1.el5.rf.i386.rpm
> Resolving packages.sw.be… 85.13.226.40
> Connecting to packages.sw.be|85.13.226.40|:80… connected.
> HTTP request sent, awaiting response… 302 Found
> Location: http://rpmforge.sw.be/redhat/el5/en/i386/rpmforge/RPMS/rpmforge-release-0.5.1-1.el5.rf.i386.rpm [following]
> –2010-06-24 01:29:41–  http://rpmforge.sw.be/redhat/el5/en/i386/rpmforge/RPMS/rpmforge-release-0.5.1-1.el5.rf.i386.rpm
> Resolving rpmforge.sw.be… 85.13.226.40
> Connecting to rpmforge.sw.be|85.13.226.40|:80… connected.
> HTTP request sent, awaiting response… 200 OK
> Length: 16600 (16K) [application/x-rpm]
> Saving to: `rpmforge-release-0.5.1-1.el5.rf.i386.rpm’
>
> 100%[======================================>] 16,600      81.5K/s   in 0.2s
>
> 2010-06-24 01:29:42 (81.5 KB/s) – `rpmforge-release-0.5.1-1.el5.rf.i386.rpm’ saved [16600/16600]

4. Install DAG’s GPG key:
# rpm –import http://dag.wieers.com/rpm/packages/RPM-GPG-KEY.dag.txt
5. Verify the package you have downloaded
# rpm -K rpmforge-release-0.5.1-1.el5.rf.*.rpm
> rpmforge-release-0.5.1-1.el5.rf.i386.rpm: (sha1) dsa sha1 md5 gpg OK

6. Install the package:
# rpm -i rpmforge-release-0.5.1-1.el5.rf.*.rpm
This will add a yum repository config file and import the appropriate GPG keys. At this point, you can set the priority of the RPMForge repository, and also of the CentOS repositories if you have not done so yet.

7. Test with this command:
# yum check-update
It should output these two lines:
> Loading “priorities” plugin
> …
> 76 packages excluded due to repository priority protections

The number above may differ, but there should be several packages shown as being excluded.

>>> Install madwifi drivers <<<

1. Install madwifi:
# yum -y install madwifi
This will pull in dkms and a bunch of other dependencies required to build the madwifi kernel module. (So this is not just the firmware, but a complete driver). If this worked out fine, you need to load the modules.

2. Load kernel modules:
# modprobe ath_pci

>>> Enable NetworkManager <<<

1. First we are going to configure your CentOS system to automatically start the NetworkManager on startup. You can do this by running:
# chkconfig NetworkManager on

2. Then we are going to start it so we can use it right away without needing to reboot:
# service NetworkManager start

If you have done that in your graphical environment (Gnome), your Notification Area (usually in the Gnome panel on the top-right) will show a new icon. If you left-click on this icon, you will see a list of possible Wireless networks to connect to.

3. You may also want to disable the network and wpa_supplicant services at boot time, as NetworkManager will now handle these. For this, simply do:
# chkconfig network off
# chkconfig wpa_supplicant off

>>> Install Priorities <<<

After installing RPMforge, you *must* install Priorities! If you don’t install this package, you’re going to have a< hell of a time updating you’re system with yum. >This is because there are a lot of packages provided by RPMforge that are also on the CentOS Repos. This causes dependency conflicts for yum, which in turn causes yum to fail updating some packages.

To install priorities, follow the instructions found on the CentOS Wiki for CentOS 5:
http://wiki.centos.org/PackageManagement/Yum/Priorities

When you edit you’re *.repo files to add the new ‘priorities’ variable, don’t forget to add a ‘priorities’ level for every Repo section in every file.

Here’s what my .repo files look like:
*CentOS-Base.repo*
—————————————————————————–
# CentOS-Base.repo
#
# The mirror system uses the connecting IP address of the client and the
# update status of each mirror to pick mirrors that are updated to and
# geographically close to the client.  You should use this for CentOS updates
# unless you are manually picking other mirrors.
#
# If the mirrorlist= does not work for you, as a fall back you can try the
# remarked out baseurl= line instead.
#
#

[base]
name=CentOS-$releasever – Base
mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=os
#baseurl=http://mirror.centos.org/centos/$releasever/os/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5
exclude=postfix
priority=1

#released updates
[updates]
name=CentOS-$releasever – Updates
mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=updates
#baseurl=http://mirror.centos.org/centos/$releasever/updates/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5
exclude=postfix
priority=1

#packages used/produced in the build but not released
[addons]
name=CentOS-$releasever – Addons
mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=addons
#baseurl=http://mirror.centos.org/centos/$releasever/addons/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5
priority=1

#additional packages that may be useful
[extras]
name=CentOS-$releasever – Extras
mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=extras
#baseurl=http://mirror.centos.org/centos/$releasever/extras/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5
priority=1

#additional packages that extend functionality of existing packages
[centosplus]
name=CentOS-$releasever – Plus
mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=centosplus
#baseurl=http://mirror.centos.org/centos/$releasever/centosplus/$basearch/
gpgcheck=1
enabled=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5
includepkgs=postfix
priority=2

#contrib – packages by Centos Users
[contrib]
name=CentOS-$releasever – Contrib
mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=contrib
#baseurl=http://mirror.centos.org/centos/$releasever/contrib/$basearch/
gpgcheck=1
enabled=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5
priority=2
—————————————————————————–

*CentOS-Media.repo*
—————————————————————————–
# CentOS-Media.repo
#
# This repo is used to mount the default locations for a CDROM / DVD on
#  CentOS-5.  You can use this repo and yum to install items directly off the
#  DVD ISO that we release.
#
# To use this repo, put in your DVD and use it with the other repos too:
#  yum –enablerepo=c5-media [command]
#
# or for ONLY the media repo, do this:
#
#  yum –disablerepo=\* –enablerepo=c5-media [command]

[c5-media]
name=CentOS-$releasever – Media
baseurl=file:///media/CentOS/
file:///media/cdrom/
file:///media/cdrecorder/
gpgcheck=1
enabled=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5
priority=9
—————————————————————————–

*rpmforge.repo*
—————————————————————————–
### Name: RPMforge RPM Repository for Red Hat Enterprise 5 – dag
### URL: http://rpmforge.net/
[rpmforge]
name = Red Hat Enterprise $releasever – RPMforge.net – dag
baseurl = http://apt.sw.be/redhat/el5/en/$basearch/rpmforge
mirrorlist = http://apt.sw.be/redhat/el5/en/mirrors-rpmforge
#mirrorlist = file:///etc/yum.repos.d/mirrors-rpmforge
enabled = 1
protect = 0
gpgkey = file:///etc/pki/rpm-gpg/RPM-GPG-KEY-rpmforge-dag
gpgcheck = 1
priority=11
—————————————————————————–

*rpmforge-testing.repo*
—————————————————————————–
### Name: RPMforge RPM Repository for Red Hat Enterprise 5 – dag
### URL: http://rpmforge.net/
[rpmforge-testing]
name = Red Hat Enterprise $releasever – RPMforge.net – test
baseurl = http://apt.sw.be/redhat/el5/en/$basearch/test
enabled = 0
protect = 0
gpgkey = file:///etc/pki/rpm-gpg/RPM-GPG-KEY-rpmforge-dag
gpgcheck = 0
priority=11
—————————————————————————–

*webtatic.repo*
—————————————————————————–
[webtatic]
name=Webtatic Repository $releasever – $basearch
baseurl=http://repo.webtatic.com/yum/centos/$releasever/$basearch/
enabled=0
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-webtatic-andy

[webtatic-source]
name=Webtatic Repository $releasever – $basearch
baseurl=http://repo.webtatic.com/yum/centos/$releasever/SRPMS/
enabled=0
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-webtatic-andy
priority=12
—————————————————————————–

Hope this helps!!!