How To's
Note: for some weblog editors you will need to provide the following string as id to edit this blog: 2aedf40b67b5479f6a28ceaeee7774b4
2010-02-09
cc avenue payment integration in Django
2010-01-23
Change permission for only folders
find . -type d -exec chmod 0755 {} \;
(similiar to)
chmod -R u+rwX,go+rX .
2010-01-22
Configuring Asterisk and Celliax with Centos5.3
These are the steps followed for installing Celliax with Asterisk
Step1: Install all Dependencies
# yum -y upgrade
# yum -y install "Development Tools"
# yum -y group install "Development Tools"
# yum -y groupinstall "Development Tools"
# yum -y search ncurses
# yum -y install ncurses.i386 ncurses-devel.i386 php-ncurses.i386
# yum -y search termcap
# yum -y install libtermcap.i386 libtermcap-devel.i386
# yum -y install kernel-devel
# yum -y install gcc gcc-c++
# yum -y install kernel-xen-devel
# yum -y install mlocate lynx tar wget nmap bzip2 mod_ssl crontabs vixie-cron
# yum -y install unixODBC unixODBC-devel libtool-ltdl libtool-ltdl-devel
# yum -y install mysql-connector-odbc
# vim /etc/odbcinst.ini
# yum -y install mysql mysql-devel mysql-server
# init 6 (restart system)
Step 2: Install Asterisk and Dahdi
# cd /usr/src/
# ls
# wget http://downloads.digium.com/pub/asterisk/asterisk-1.4-current.tar.gz
# wget http://downloads.digium.com/pub/asterisk/asterisk-addons-1.4-current.tar.gz
# wget http://downloads.digium.com/pub/telephony/dahdi-linux-complete/dahdi-linux-complete-current.tar.gz
# tar zxf asterisk-1.4-current.tar.gz
# tar zxf asterisk-addons-1.4-current.tar.gz
# tar zxf dahdi-linux-complete-current.tar.gz
# mv dahdi-linux-complete-2.2.0.2+2.2.0/ dahdi-linux
# mv asterisk-1.4.27.1/ asterisk-1.4.27
# cd dahdi-linux
# make all
# make install
# make config
# chkconfig dahdi on
# service dahdi start
# cd /usr/src/asterisk-1.4.27/
# make clean
# ./configure
# make menuselect
# make
# make install
# make samples
# make progdocs
# make config
# chkconfig asterisk on
# asterisk -vvvvvvvvvvvvvvvvvvvc
# service asterisk start
# cd /usr/src/asterisk-addons-1.4.9/
# make clean
# ./configure
# make menuselect
# make
# make install
# make samples
# mysql -u root -p
# /etc/init.d/mysqld start
# mysql -u root -p
# init 6
# asterisk -r
Step 3: Download and Compile Celliax
To build celliax on Linux you need to install ALSA-dev libs
You can do it on Debian/Ubuntu with:
# apt-get install libasound2-dev
You can do it on Fedora/CentOS with:
# yum --nogpgcheck -y install alsa-lib-devel
# cd /usr/src
# wget http://www.gsmopen.org/sites/default/files/chan_celliax.tgz
# tar xvf chan_celliax.tgz
# cd chan_celliax
# make clean
# make
--edit and copy celliax.conf in the asterisk configuration
directory
--copy ciapalo (or your program that accepts text in stdini) in
the location defined in celliax.conf (sms_receiving_program)
--edit modules.conf and put noload in front of *BOTH* chan_oss.so
AND chan_alsa.so AND chan_console.so
--copy asound.conf in /etc/asound.conf
For more info refer README of chan_celliax
Thats it restart asterisk and u have celliax working !!!
Installing Festival and setting voice to female
# aptitude install festival festival-freebsoft-utils
In a terminal:
Test festival:
# echo "Hello World"| festival --tts
To copy to wav:
# echo "Hello World" | text2wave -o Hello_World.wav
To read man pages of cron:
#man cron | festival --tts
To read a saved file:
#festival --tts snort-usage.odt
To change voice to a female:
#cd /usr/share/festival/voices/english
#wget http://festvox.org/packed/festival/latest/festvox_cmu_us_slt_arctic_hts.tar.gz
#tar xvf festvox_cmu_us_slt_arctic_hts.tar.gz
#mv festival/lib/voices/us/cmu_us_slt_arctic_hts .
Check if the female voice is loading
#festival
Copyright (C) University of Edinburgh, 1996-2004. All rights reserved.
For details type `(festival_warranty)'
festival> (voice_cmu_us_slt_arctic_hts) <== Set Voice
#<Utterance 0xb7216598>
festival>
text2wave can be set to the voice using
so a wrapper script is created in /usr/local/bin/text2wave
#!/bin/bash
/usr/bin/text2wave -eval "(voice_cmu_us_slt_arctic_hts)" "$@"
this script will give sometimes "Segmentation fault"
so a replacement of text2wave is taken from http://irlp.kc6hur.net/downloads/text2wave
and copied to /usr/bin
(this one is bug-fixed version)
You have a successfully change the voice!
phew!
Ref:
http://festvox.org/packed/festival/latest/
Debian User Forums • View topic - Festival Text to Speech
Dumping SQLite Database
The command to dump a sqlite database from a .db file in terminal
$ sqlite3 database.db .dump > filename.sql
If you are in Ubuntu, you can install the gui for sqlite: sqlite-browser
To see which os is running and last reboot date
$ cat /etc/issue -----------------------> To see the version of os
$ who -b ---------------> To see the last reboot
$ last reboot --------------> last shutdown
$ last shutdown ------------> last shutdown
$ last ---------------------> It will gives all last userlog with IP, system reboot time.
$ last publico -a ----------------------> only display the history for a given user.
System starts in low graphics mode(3d disabled)
Since Ubuntu comes with open source drivers in a default installation,Nvidia drivers have to be installed later.
For NVIDIA card owners:
Install the drivers from a terminal window with the command :
sudo apt-get install nvidia-glx-185 (pressing tab will auto complete all the package names)
Restart system.
Or
You could try installing graphically from System>administration>Hardware drivers
2010-01-21
Steps to install the zabbix server on ubuntu
Prerequisites to install zabbix server:
Intended for Zabbix 1.6.5 on Ubuntu Feisty Fawn 7.04
Install pre-requisites:
Apache
MySQL-Server
PHP5
Net-Snmp libraries
$ sudo aptitude install build-essentials mysql-server php5 php5-gd snmp
libsnmp9-dev snmpd
1 - Make the zabbix user and group:**
$ sudo adduser zabbix
enter in new password
confirm
use the remaining defaults.
Add zabbix to the admin group
$ sudo adduser zabbix admin
2 - Download and Untar the sources:
$su - zabbix
$ wget http://internap.dl.sourceforge.net/sourceforge/zabbix/zabbix-1.4.tar.gz
$ tar zxvpf zabbix-1.4.tar.gz
3 - Create a zabbix database and populate it:
$ mysql -u root -p$ create database zabbix;
$ quit;
$ mysql -u root zabbix -p < /home/zabbix/zabbix-1.4/create/schema/mysql.sql
$ mysql -u root zabbix -p < /home/zabbix/zabbix-1.4/create/data/data.sql
4 - Configure, compile and install the server:
$ cd zabbix-1.4/
$ ./configure --prefix=/usr --with-mysql --with-net-snmp \
--enable-server --enable-agent &&
$ make
$ sudo checkinstall
5 - Prepare the rest of the system:
$ sudo nano /etc/servicesAdd at the end:
zabbix_agent 10050/tcp # Zabbix ports
zabbix_trap 10051/tcp
Save and exit.
$ Sudo mkdir /etc/zabbix
$ sudo chown -R zabbix.zabbix /etc/zabbix/
$ cp misc/conf/zabbix_* /etc/zabbix/
Edit /etc/zabbix/zabbix_agentd.conf:
$ nano /etc/zabbix/zabbix_agentd.conf
Make sure that the Server parameter points to the server address, for the agent that runs on the server it is like this:
Server=127.0.0.1
Edit /etc/zabbix/zabbix_server.conf:
nano /etc/zabbix/zabbix_server.conf
For small sites this default file will do, however if you are into tweaking your config for your 10+ hosts site, this is the place.
Change this:
# Database password
# Comment this line if no password used
DBPassword=Secret
Start the server :
zabbix_server
Start the client:
zabbix_agentd &
6 - Configure web interface:
$ mkdir /home/zabbix/public_html
$ cp -R frontends/php/* /home/zabbix/public_html/
Edit /etc/apache2/sites-enabled/000-default:
$ sudo nano /etc/apache2/sites-enabled/000-default
Work into file:
Alias /zabbix/ /home/zabbix/public_html/
<Directory /home/zabbix/public_html>
AllowOverride FileInfo AuthConfig Limit Indexes
Options MultiViews Indexes SymLinksIfOwnerMatch IncludesNoExec
<Limit GET POST OPTIONS PROPFIND>
Order allow,deny
Allow from all
</Limit>
<LimitExcept GET POST OPTIONS PROPFIND>
Order deny,allow
Deny from all
</LimitExcept>
</Directory>
Save and exit.
Make php.ini adjustments:
$ sudo nano /etc/php5/apache2/php.ini
Change the following values:
max_execution_time = 300 ; Maximum execution time of each script, in seconds
date.timezone = America/Kentucky/Louisville
(use this url to find your correct timezone format: http://us3.php.net/manual/en/timezones.php )
Restart Apache:
$ sudo /etc/init.d/apache2 restart
Now point your browser to:
http://<servername or ip>/zabbix/
1. Introduction
read and click Next
2. License Agreement
Read, check 'I Agree', click Next
3. Check of Pre-Requisites
Fix any problems, click retry. Click Next when all pre-requisites are OK.
4. Configure DB Connection
Enter appropriate settings and click Test Connection.
Click Next when OK.
5. Pre-Installation Summary
Verify installation settings, click Next.
6. Install
Click Save Configuration file and save to machine.
Copy zabbix.conf.php to /home/zabbix/public_html/conf/zabbix.conf.php
One way to do this from a desktop machine (requires ssh installed):
scp zabbix.conf.php zabbix@<serverip>:/home/zabbix/public_html/conf/
Click Retry and click Next when OK.
7. Finish
Click Finish to complete installation.
Your New Zabbix install will now be shown.
Log in with username: Admin
No Password
First go to the tab Configuration and then Hosts.
Now create a host-group, see that you can give it some templates,
e.g: Application.MySQL, Host.SNMP, Host.Standalone, Host.Unix.
Then some hosts:
Select your host-group and use Link with Template Host.Unix
Now a lot of triggers are imported and the game begins.
Go to the monitoring tab and watch the latest values roll in.
Installing agent :
Download the server package and install only the agent
./configure --enable-agent
make
$ sudo checkinstall
sudo nano /etc/services
Add at the end:
zabbix_agent 10050/tcp # Zabbix ports
zabbix_trap 10051/tcp
$ mkdir /home/zabbix/public_html
$ cp -R frontends/php/* /home/zabbix/public_html/
Edit /etc/apache2/sites-enabled/000-default:
$ sudo nano /etc/apache2/sites-enabled/000-default
Work into file:
Alias /zabbix/ /home/zabbix/public_html/
<Directory /home/zabbix/public_html>
AllowOverride FileInfo AuthConfig Limit Indexes
Options MultiViews Indexes SymLinksIfOwnerMatch IncludesNoExec
<Limit GET POST OPTIONS PROPFIND>
Order allow,deny
Allow from all
</Limit>
<LimitExcept GET POST OPTIONS PROPFIND>
Order deny,allow
Deny from all
</LimitExcept>
</Directory>
Save and exit.
Make php.ini adjustments:
$ sudo nano /etc/php5/apache2/php.ini
Change the following values:
max_execution_time = 300 ; Maximum execution time of each script, in seconds
date.timezone = America/Kentucky/Louisville
(use this url to find your correct timezone format: http://us3.php.net/manual/en/timezones.php )
Restart Apache:
$ sudo /etc/init.d/apache2 restart
Now point your browser to:
http://<servername or ip>/zabbix/
1. Introduction
read and click Next
2. License Agreement
Read, check 'I Agree', click Next
3. Check of Pre-Requisites
Fix any problems, click retry. Click Next when all pre-requisites are OK.
4. Configure DB Connection
Enter appropriate settings and click Test Connection.
Click Next when OK.
5. Pre-Installation Summary
Verify installation settings, click Next.
6. Install
Click Save Configuration file and save to machine.
Copy zabbix.conf.php to /home/zabbix/public_html/conf/zabbix.conf.php
One way to do this from a desktop machine (requires ssh installed):
scp zabbix.conf.php zabbix@<serverip>:/home/zabbix/public_html/conf/
Click Retry and click Next when OK.
7. Finish
Click Finish to complete installation.
Your New Zabbix install will now be shown.
Log in with username: Admin
No Password
First go to the tab Configuration and then Hosts.
Now create a host-group, see that you can give it some templates,
e.g: Application.MySQL, Host.SNMP, Host.Standalone, Host.Unix.
Then some hosts:
Select your host-group and use Link with Template Host.Unix
Now a lot of triggers are imported and the game begins.
Go to the monitoring tab and watch the latest values roll in.
Installing agent :
Download the server package and install only the agent
./configure --enable-agent
make
$ sudo checkinstall
sudo nano /etc/services
Add at the end:
zabbix_agent 10050/tcp # Zabbix ports
zabbix_trap 10051/tcp
Installation of karl3 in ubuntu
Download and Installation
As of the 3.0 release, KARL is relatively straightforward for both developers and evaluators to download and install. In particular, there is no installation for Windows. See the FAQ for an explanation and suggestion.
Note
Note: The most up-to-date installation information is in the developer installation page and the README.txt that comes in the software.
Prerequisites for Evaluation
To get KARL running quickly as an evaluation, you can skip many of the steps used in deployment. Before getting started, make sure you have the following setup.
- Python 2.5.x. While you can use a Python package installed by your system, we HIGHLY recommend that you build your own Python. Make sure you include SSL support in the Python.
- Subversion. You need a way to check out the KARL software from the repository and keep it up to date.
- virtualenv (optional but recommended). Use Python’s easy_install to install virtualenv and isolate it from changes in your Python configuration.
- Converters (optional but recommended). Indexing content in PDF, Word, etc. requires some add-on packages. Look in the software’s README.txt for more detail. This is optional and can be done after an installation of KARL.
Installation for the Impatient
Want to see what’s involved before reading the developer installation instructions or the README.txt? Here are the immediate steps to get a running KARL.
- svn co http://osi.agendaless.com/bfgsvn/karlsample/trunk/ karl3
- cd karl3
- /path/to/your/python/bin/virtualenv --no-site-packages .
- bin/python ./bootstrap.py
- bin/buildout -U
- Wait a number of minutes while lots of work is done.
- download and install repoz.bfg.formish.
- bin/supervisord
- Visit in your browser: http://localhost:6543/ and login as username admin and password admin
- When finished: bin/supverisorctl shutdown
2009-07-22
Webalizer Report Generating
Step 1: login to the particular website server (eg. Mahiti.org at 192.168.x.x)
$ ssh username@hostname
Step 2: After loggen in to above server, go to apache2 folder as below:
$ cd /var/log/apache2
Step 3: execute below command to open all access.log files and find the mentionded website (mahiti.org) in all the access.log files and store in a file (linweb)
$cat access.log access.log.1 | grep mahiti.org >> linweb
Step 4: create a script file to sort the linweb file
the final file will be in jumbled time format. Webalizer stops when it reaches todays date. As a result dont forget to sort the final file so that the webalizer analyzes all the entries
$sudo vi sort.sh
Step 5: copy the below text into newly created (sort.sh) script file then save & exit.
#!/bin/sh
if [ ! -f $1 ];
then
echo "Usage: $0 "
exit
fi
echo "Sorting $1"
sort -t ' ' -k 4.9,4.12n
-k 4.5,4.7M -k 4.2,4.3n -k 4.14,4.15n -k 4.17,4.18n -k 4.20,4.21n $1
> $1.sorted
Step 6: to see the content of the file (linweb) type the below command, which is still not sorted.
$ vi linweb
$ ls -l
Step 7: run the following command to change the permission level of sort.sh file.
$ chmod 775 sort.sh
Step 8: run the following command to sort the linweb file.
$ ./sort.sh linweb
Note: the above command will create a file a sorted file as below.
linweb.sorted
Step 9: to see the sorted contents in the linweb file
$ vi linweb.sorted
Step 10: to generate a webalizer report run the following command.
$ webalizer linweb.sorted
$ ls -ltr
Step 11: run the following three commands only if webalizer application is not installed on your computer. If already installed then go to step 12 directly from step 10.
$ sudo aptitude update
$ sudo aptitude install webalizer
$ webalizer linweb.sorted
Step 12: create a folder to store the webalizer report.
$ sudo mkdir lin
Step 13: run the following webalizer command to generate & store the webalizer report into newly created folder (lin)
$ webalizer linweb.sorted -o lin/
Step 14: go to new (lin) folder and see the contents stored (there will be around five files)
$ cd lin
$ ls
Step 15: run the following command to see the webalizer report index.
$ lynx index.html
Step 16: now copy the newly created folder (i.e lin) to your computer for futher use.
$ sudo scp -r lin user@hostname:/location/location/location/.
Note: Here "linweb" & "lin" are the just examples only, you can use any name you want.
2009-03-22
Printing
Printing
Most printers will be automatically supported by Ubuntu. The Printer Configuration application allows you to add printers, as well as modify their settings. You can also use this application to share the printer with other computers on a network, disable the printer, or restart it.
A local printer is one which is directly connected to your computer (as opposed to a network printer, discussed in the following section).
To setup a new local printer, plug your printer into your computer and power it on. Most printers will automatically be detected and configured. Once detected, a printer icon will appear in the notification area and after waiting a few moments, you should get a popup with the text Printer added.
If your printer was not detected after a few moments, then you will need to follow these steps:
-
Obtain the model name of your printer.
-
Ensure the printer is turned on.
-
Choose → →
-
Click .
-
Your printer should be automatically detected. If so, simply click and then .
-
Finally, you can enter in a description and location for your printer.
If your printer was not automatically detected, you can try to select the port and printer driver manually. Some printers need further setup. Search the databases at LinuxPrinting.org or check the Ubuntu Wiki Printer page for information on your printer.
You can also configure your Ubuntu system to send print jobs to a remote print server. Remote printers are hosted somewhere on a network. To configure a remote printer:
-
Obtain the model name of your printer.
-
Ensure the printer is turned on.
-
Choose → →
-
Choose .
-
If your printer is directly connected to a Windows machine on your network, choose Windows Printer via SAMBA. Otherwise, select the protocol your printer uses to communicate.
-
Insert the details of the network printer and click .
-
Select the printer model and then click .
-
Finally, you can enter in a description and location for your printer.
|
If you do not know the protocol or details of your network printer, you should consult your network administrator. |
To check if your printer works correctly:
-
Choose → →
-
Right click on the printer's name in the list.
-
Click .
-
Under the Settings tab, Click . A page will then be printed if your printer is working correctly.
To find out how much ink is left in your printer, follow the instructions which apply to your printer:
-
Hewlett-Packard (HP) printers: Press Alt+F2, type
hp-toolboxand click . Select the Supplies tab in the HP Device Manager window which appears to view a summary of ink levels. -
Epson and some Canon printers: Install the mtink package and click → → to check your ink levels.
-
Some other Epson and Canon printers: Install the inkblot package, press Alt+F2, type
inkblotand click . A printer icon will appear in the notification area on the top panel; click it to view ink levels.
For printers from other manufacturers, the best chance of viewing ink levels for your printer in Ubuntu is to install an official Linux printer driver from your manufacturer if one exists.

This how to is directly pasted from the official ubuntu documentation wiki.
Thanks to the Ubuntu wiki contributors.
2008-01-22
Installing Ubuntu
There are many common ways to install and run Ubuntu. You can run Ubuntu:
- as your sole operating system (single booting).
- in addition to another operating system (dual booting).
-
within your existing operating system (virtualization).
- from your CD disc drive, using the Live CD.
-
in addition to Windows, using Window's Boot Manager, via the Wubi installation
NOTE: Prior to installing Ubuntu, it is recommended that you back up your computer. If things do go wrong there are a number of options to get help listed on http://www.ubuntu.com/support
Acquiring Ubuntu
To acquire Ubuntu, you can order a free CD from Canonical or purchase a CD or DVD from a distributer You can also download and burn the image to a CD or DVD. You can download the Ubuntu installer from Canonical. Downloading the installer requires a blank CD or DVD, and a CD or DVD burner that is capable of burning disc images.
To download Ubuntu:
-
Using your web browser, navigate to http://www.ubuntu.com/getubuntu/download
- Select Desktop Edition, and then click Ubuntu 9.04.
- In the Choose a download location near you menu, select the location closest to you.
- Click Begin Download. A pop up window opens, prompting you where to run or save the file.
- In Internet Explorer, click Run to automatically open the installation file in a CD burning utility or click Save to save the file to your disk. In Mozilla Firefox, select Open with to open the installation file in a CD burning utility or select Save File to save the file to your disk.
After downloading the Ubuntu installation CD image, you need to burn it to a CD or DVD. That meeans ,burn the iso file as an image,and not as data cd .Do not extract the iso. file.
To burn the installation disk to a CD or DVD:
- Place a recordable CD or DVD into your CD/DVD drive.
- Load an application that is capable of burning .ISO image files to CDs or DVDs.
- Using your CD and DVD writing program, copy the disk image to your blank CD or DVD.
To Install Ubuntu
Ubuntu can be installed with the graphical CD. Make sure that your computer is set to boot from a CD before a hard drive.
- Insert the Ubuntu disc into your CD drive.
-
Start or restart your computer. The Language screen appears.

-
Select your desired language and press Enter. The startup window appears.

-
Select Install Ubuntu and press Enter. The Welcome window appears.

-
From the taskbar, choose your preferred language. Click Forward. The Where are you? window appears.

-
From the Selected city box, choose your closest location. Click Forward. The Keyboard layout window appears.

-
Select your keyboard layout. To test if you have chosen the correct layout, enter characters in the text box. Click Forward. The Prepare disk space window appears.
-
If you want to install Ubuntu over your entire hard drive, then Select Guided – use entire disk and select the hard drive that you want to install Ubuntu. Click Forward. The Who are you? window appears.
WARNING: Installing Ubuntu on your entire hard disk will erase all data that is currently on the drive.
OR
-
If you want to install Ubuntu on a single partion Select Guided – resize. In the New partition size area, drag the area between the two partitions to create your desired partition sizes.

Click 'Forward. The Who are you? window appears.
- In the What is your name? field, enter your name.

- In the What name do you want to use to log in? field, enter a login name.
- In the Choose a password to keep your account safe field, enter a password in both text boxes.
- In the What is the name of your computer? Field, enter a name to identify your computer.
-
If you are the only user and wish to avoid the login screen, check Log in automatically (optional).
-
Click Forward. The Ready to install window appears.

Verify that the language, layout, location, and personal information are correct and click Install. The installation wizard begins.
-
- When the installation wizard finishes, the installation complete window appears.
Click Restart now to restart your computer. Ubuntu is now installed.
Entire content is pasted from the official Ubuntu documentation wiki site.All credit goes to the Ubuntu wiki contributors.



XPgBQHVBvtWUua