June 14, 2008
I had a perfectly working Asterisk server and then suddenly all of my sip peers started showing this error. I did the following over a period of two weeks to solve this problem:
- Checked Asterisk logs in /var/log/asterisk for any clues.
- There were some errors about IAX timing interface not available. I remembered that I have compiled a new kernel and that because Asterisk compiles some kernel modules, so I need to compile the installation again.
- I downloaded new zaptel, libpri, asterisk, asterisk-addon packages, all of them from links given on Asterisk download webpage. Compiled and installed all of these packages.
- Problem is still there but the IAX timing error is gone. Looked at dmesg. There were some errors to the tune of:
Starting udevd: udevd: lookup_user: specified user 'asterisk' unknown
udevd: lookup_group: specified group 'asterisk' unknown
Solved this error by:
- Someone suggested that because I did not have a zaptel hardware so perhaps ztdummy was not being loaded. I checked it using:
lsmod | grep zaptelwhich showed:
zaptel 201476 13 ztdummy,xpp,wcusb,wctdm,wcfxo,wctdm24xxp,wcte11xp,wct1xxp,wcte12xp,wct4xxp,tor2which meant this went also off the list.
crc_ccitt 2304 1 zaptel
- Because my system is based on Xenomai, where HPET is disabled, so I suspected that perhaps ztdummy cannot get hold of a timer. To this end,
dmesg | grep ztdummyrelieved my doubts.
[ 42.992332] ztdummy: Trying to load High Resolution Timer
[ 42.993543] ztdummy: Initialized High Resolution Timer
[ 42.994480] ztdummy: Starting High Resolution Timer
[ 42.995372] ztdummy: High Resolution Timer started, good to go
- Now what? I was now feeling quite desperate. There was not understandable issue with /etc/asterisk/sip.conf considering also that it was working before without any issues.
- Perhaps RTP traffic is hindered somewhere. Actually this was the first thing that came to mind and I verified in my router that certain port range was being forwarded to Asterisk server and that this also matched with the settings in /etc/asterisk/rtp.conf. It just flashed in my mind that the router is somehow hindering Asterisk. And lo! the culprit was SPI Firewall in my router configuration. I have no idea how it became enabled by itself. I disabled it and Asterisk started running smoothly again.
June 12, 2008
You need to have putty installed on your windows box.
Open a command prompt on windows machine and
cd to putty folder.
pscp -l username local_file linuxserver:/path_on_server
June 11, 2008
wget is a command line utility to download files from internet. You can use it to get all files or of a given type linked on a webpage. e.g, use:
wget -r -l1 -H -t1 -nd --limit-rate=8k -N -np -A.pdf -erobots=off http://www.somesite.com/somepage.asp
to download all pdf files linked on somepage.asp.
-r makes it recursive, -l1 is to allow 1-level deep recursion, -H allows it to span hosts while doing recursion. -t1 stands for number of re-tries (here “1”), -nd for no-directory structure, -N to enable time stamping so that only newer same files are overwritten, -np for no-parent retrieval, -A to enforce certain filers, and the rate is limited to 8 KBytes/sec.
This functionality is also available in GUI form in firefox using an addon called downthemall.
June 4, 2008
Add the following to the top of the file containing
Add following line before the end of the
main function, or wherever the
Compile as debug and execute. Memory leaks will be printed on the output window which can be clicked to point the problem location.
June 3, 2008
- Download AWStats from http://awstats.sourceforge.net/
- Unzip the file to a temporary folder, e.g.,
tar -xvzf awstats-6.7.tar.gz
- Create a folder /var/www/awstats
- From the awstats file you unzipped in step 2 copy the “js”, “classes”, “css” and “icon” folders (located in the wwwroot folder) to the “/var/www/awstats” folder you just created in your website directory.
- Copy the contents of the “cgi-bin” folder into your cgi-bin website directory (/usr/lib/cgi-bin). This is selected in a default way, as specified in your
/etc/apache2/sites-enabled/000-defaultor your own configuration file by the following directives:
ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
Allow from all
You may also need to add:
AddHandler cgi-script .cgi .pl
/etc/apache2/apache2.conffile as well as
Options FollowSymLinks +ExecCGI +SymLinksIfOwnerMatchin the <Directory /> section.
- Copy the awstats.model.conf file to awstats.www.yoursite.com.conf in the cgi-bin directory and change the following parameters:
LogFile = "../www/log.%YYYY%MM" (assuming your log files are being placed in the www root directory).
SiteDomain = "www.yourdomain.com"
DirIcons = "TO YOUR NEEDS "
AllowToUpdateStatsFromBrowser = 1
./awstats.pl -config=www.yoursite.com -updateto update the stats manually from the command prompt.
To add the awstats update to cron jobs, do:
crontab -e -u root
00 * * * * /usr/lib/cgi-bin/awstats.pl -config=www.yoursite.com -update >/dev/null 2>&1
C-o to save C-x to exit
This shall add a cron job that will run at 00 of every hours, i.e., every hour.
- If, while updating using web-interface, you see the following error:
Cannot generate update files from the webpage
Error: Couldn’t open server log file “/var/log/apache2/access.log” : Permission denied
You need to change permissions on log files. Issue:
chmod -R 755 /var/log/apache2
to solve it.
May 29, 2008
- Get the git:
apt-get install git-core
- Get latest u-boot sources for coldfire:
mkdir u-boot && cd u-boot
- Make u-boot for M5282EVB evaluation board. A list of available boards can be found under
board/folder and of cpus under
cpu/. Now make the images
- You might encounter the error:
start.S: Assembler messages:
start.S:143: Error: operands mismatch — statement `movec %d0,%RAMBAR1′ ignored
start.S:169: Error: operands mismatch — statement `movec %d0,%RAMBAR1′ ignored
make: *** [start.o] Error 1
make: Leaving directory `/usr/src/u-boot/u-boot-coldfire/cpu/mcf52x2′
To correct this error:
On lines 143 and 169, change RAMBAR1 to RAMBAR0
- At the end of compilation you will get the following files that can be used to boot an M5282EVB coldfire board:
u-boot u-boot.bin u-boot.map u-boot.srec
May 28, 2008
In a previous post, I have described how to make a coldfire toolchain using gcc 4.2.3. In this post, we shall see how we can use the latest cvs trunks to build the toolchain based on latest sources.
You should have ample free space (ca. 3GB) on your hard disk and I assume you are root.
- Become root
- Install the tools:
apt-get install gcc g++ build-essential gcc-3.4 automake autoconf gdb bzip2 texinfo patch flex bison subversion cvs
Make required folders:
- Get and build binutils:
cvs -z 9 -d :pserver:firstname.lastname@example.org:/cvs/src login
Enter “anoncvs” as password.
cvs -z 9 -d :pserver:email@example.com:/cvs/src co binutils
../src/configure --prefix=/usr/local/coldfire --target=m68k-elf --enable-multilib
- Make and install gmp and mpfr libraries:
tar -xvf gmp-4.2.2.tar.gz
make -j 2
bzcat mpfr-2.3.1.tar.bz2 | tar -xf -
make -j 2
- Update library configuration:
- Download and uncompress latest gcc sources, at the time of writing:
bzcat gcc-4.3.1-RC-20080523.tar.bz2 | tar -xf gcc-4.3.1-RC-20080523.tar.bz2
- Get newlib and link to gcc:
cvs -z 9 -d :pserver:firstname.lastname@example.org:/cvs/src co newlib
Enter "anoncvs" as the password.
rm -rf newlib
ln -s ../newlib/src/newlib newlib
- ***IMPORTANT: DO NOT COMPILE WITHIN THE SOURCE DIR***
- Make and install gcc:
Configure the toolchain:
../gcc-4.3.1-RC-20080523/configure --build=i686-pc-linux-gnu --host=i686-pc-linux-gnu --target=m68k-elf \
--disable-libmudflap --disable-libssp --disable-libgomp --enable-threads \
--enable-languages=c,c++ --disable-checking --disable-shared --with-newlib \
--with-bugurl=http://deneb.homedns.org/things --with-pkgversion=HIRTS-0.1 \
--disable-nls --prefix=/usr/local/coldfire --enable-poison-system-directories \ --with-build-time-tools=/usr/local/coldfire/bin
Make and install the toolchain (can take ca. 1 hour on most computers!):
- Add the tools to your path:
/usr/local/coldfire/binto the end of
Press C-x C-s to save, C-x C-c to exit. Enter:
to load the new path information.
This will add it to all the users' path except root. If you want to add it to root's path as well, you need to edit .bashrc file in /root folder by adding the following:
- Check the toolchain:
Using built-in specs.
- Compile a simple hello world program:
Enter the following simple program:
int hello_world (int argc, char *argv)
printf ("Hello World\n");
Press C-x C-s to save and C-x C-c to exit
Compile the program:
m68k-elf-gcc -g -c -mcpu=5282 hello_world_m68k.c
Feedback/comments are welcomed.
May 25, 2008
- First of all, clear any traces of previous installs, if any:
apt-get remove ndiswrapper-utils
rm -r /etc/ndiswrapper/
rm -r /etc/modprobe.d/ndiswrapper
rm -rf ndiswrapper
- Get, unzip, make and install new ndiswrapper:
tar -xzf ndiswrapper-1.52.tar.gz
- Install the WG11T drivers:
Copy the windows xp drivers of WG11T to
ndiswrapper -i athfmwdl.inf
ndiswrapper -i netwg11t.inf
should make the adapter active, some leds may flash
will include the module in the auto-load at bootup sequence.
May 25, 2008
You should have ~2-3GB free space to make the kernel and must have root privileges.
apt-get install subversion
svn co svn://svn.gna.org/svn/xenomai/trunk xenomai
- Goto www.kernel.org and download the latest kernel. At the time of writing:
bzcat linux-220.127.116.11.tar.bz2 | tar -xf -
ln -s linux-18.104.22.168 linux
to see the options and parameters.
- Configure the Linux kernel
Copy the old configuration file, you may need to change the name depending on your kernel version:
cp /boot/config-22.214.171.124 .config
I chose the following options. Dis means pressing “n”(for no), and En means pressing “y” (for yes). When you get into Real-time sub-system section, you should closely read the messages on top. It will indicate if some un-recommended/conflicting options are set.
Dis: Kernel IRQ Balancing
Dis: CPU Freq Scaling
Dis: CPU Idle PM Support
Dis: Legacy Power Management
Dis: HPET Timer
Dis: ACPI Processor
Dis: all deprecated from ACPI
Dis: Power Management Timer Support
Dis: ACPI Container Driver
En: Enable Periodic Timing -> RT Subsystem
En: Scalability -> 0(1) Scheduler
En: Enable SMI Workaround
En: Globally Disable SMI
En: POSIX API all enable
En: Select support for RTDM file descriptors
En: Serial Driver -> Any access mode
Dis: Check for non-fatal errors on AMD Athlon/Duron / Intel Pentium 4
Dis: check for P4 thermal throttling interrupt.
Dis: Enable kernel irq balancing
Dis: Power Management Timer Support
Dis: APM (Advanced Power Management) BIOS suppor
Dis: All Interfaces except Native API and POSIX
- Make the new kernel, can take ca. 1 hour:
CONCURRENCY_LEVEL=2 (on dual core processors)
make-kpkg --initrd --append-to-version=-rtosx --revision=0.1 kernel_image kernel_headers
Note:Do not use xeno in
--append-to-versionoption as linux disregards xeno in some of its operations which creates a chaotic situation when finding proper /lib/modules/kernel_version folder.
- Add modules so that splash screen/console can load at boot
echo vesafb | tee -a /etc/initramfs-tools/modules
echo fbcon | tee -a /etc/initramfs-tools/modules
- Install the newly built kernel and headers:
dpkg -i linux-image-126.96.36.199-rtosx_0.1_i386.deb
dpkg -i linux-headers-188.8.131.52-rtosx_0.1_i386.deb
to confirm that the new kernel has been properly entered into the list. If not, you may need to add it manually.
- Boot with the new kernel:
shutdown -r now
- Build and install xenomai user-space components:
mkdir build_root && cd build_root
../xenomai/configure --enable-x86-sep --enable-smp
- Test the new Xenomai RTOS:
At the end of some tests, you should see the user-space RT latencies. Press Ctrl-C to exit the test.
May 22, 2008
Issue the following command in the folder where *.JPG files are located:
for i in *.JPG; do convert -resize 800x600 -quality 90 $i s_$i; tar --remove-files -rvf pics.tar s_$i; done
The files will be resized, renamed with a prefix of
s_ and will be added to the
tar -tvf pics.tar
to see the contents of the created archive.
zip is required, then use:
for i in *.JPG; do convert -resize 800x600 -quality 90 $i s_$i; zip -m pics.zip s_$i; done