Randell's Blog

Software development, Fedora how-to's, and random stuff from the web

Clear input values inside a div using JavaScript

By Randell on May 3, 2012

This script recursively traverses all HTML elements, looks for input fields and clears their values. It uses only JavaScript. No jQuery required.

// From http://stackoverflow.com/a/1500073/106778
function clearChildren(element) {
   for (var i = 0; i < element.childNodes.length; i++) {
      var e = element.childNodes[i];
      if (e.tagName) switch (e.tagName.toLowerCase()) {
         case 'input':
            switch (e.type) {
               case "radio":
               case "checkbox": e.checked = false; break;
               case "button":
               case "submit":
               case "image": break;
               default: e.value = ''; break;
            }
            break;
         case 'select': e.selectedIndex = 0; break;
         case 'textarea': e.innerHTML = ''; break;
         default: clearChildren(e);
      }
   }
}

For posterity’s sake. Source: http://stackoverflow.com/a/1500073/106778. Also at https://gist.github.com/2436981.

Posted in Dev Notes | Tagged HTML, JavaScript | Leave a response

How to install SFLphone on Fedora 16

By Randell on April 9, 2012

This is a slightly modified version of the SFLphone build instructions.

First, install the dependencies:

sudo yum groupinstall group "Development Tools" "Development Libraries"
sudo yum install alsa-lib-devel pulseaudio-libs-devel libsamplerate-devel commoncpp2-devel ccrtp-devel libzrtpcpp-devel dbus-c++-devel pcre-devel gsm-devel speex-devel celt071-devel libyaml-devel cppunit-devel cppcheck

Then clone the master branch because the latest release (1.0.2) has a bug, which prevented me from installing it on Fedora 16:

git clone http://git.sflphone.org/sflphone.git

Compile the PJSIP library

cd sflphone/daemon/libs/pjproject/
./configure && make dep && make clean && make

Install the Daemon core

cd ../..
./autogen.sh
./configure  --prefix=/usr
make
sudo make install

Install the Gnome client dependencies

sudo yum install gnome-doc-utils libtool GConf2-devel libsexy-devel libnotify-devel webkitgtk-devel webkitgtk3-devel libgnomeui-devel check-devel rarian-compat

Install the Gnome client

cd ../gnome
./autogen.sh
./configure --prefix=/usr
make && sudo make install

Posted in Dev Notes, Fedora, How-to | Tagged SFLphone | Leave a response

How to install Asterisk on Fedora 16

By Randell on April 8, 2012

Because the installation of Asterisk via Yum didn’t work out-of-the-box for me, I have decided to install it from source. The instructions to compile and install Asterisk from source from the Asterisk wiki is pretty much straight-forward except for a couple of hiccups, which I encountered. So here is a slightly modified version of their installation instruction that worked for me on Fedora 16:

Install the compiler and system libraries

sudo yum install gcc, gcc-c++, openssl, ncurses, ncurses-devel, newt, libxml2, libxml2-devel, kernel-devel, kernel-devel make

We also need to install SQLite3 in order to avoid seeing this message later on:

configure: WARNING: *** Asterisk now uses SQLite3 for the internal Asterisk database.
configure: WARNING: *** Please install the SQLite3 development package.

So let’s install SQLite3:

sudo yum install sqlite, sqlite-devel

We also need to install doxygen for the Asterisk documentation:

sudo yum install doxygen

Download, build, and install libpri

Execute the following as root:

wget http://downloads.asterisk.org/pub/telephony/libpri/libpri-1.4.12.tar.gz
tar -zxvf libpri-1.4.12.tar.gz
cd libpri-1.4.12
make
make install

Download, build, install, and start DAHDI

Execute the following as root:

wget http://downloads.asterisk.org/pub/telephony/dahdi-linux-complete/dahdi-linux-complete-2.6.0+2.6.0.tar.gz
tar -zxvf dahdi-linux-complete-2.6.0+2.6.0.tar.gz
cd dahdi-linux-complete-2.6.0+2.6.0
make
make install
make config
chkconfig dahdi on
service dahdi start

Download, build, install, and start Asterisk

Execute the following as root:

wget http://downloads.asterisk.org/pub/telephony/asterisk/asterisk-10.3.0.tar.gz
tar -zxvf asterisk-10.3.0.tar.gz
cd asterisk-10.3.0
./configure
make menuselect
make
make install
make samples
make progdocs
make config
chkconfig asterisk on
asterisk -vvvvc

Notes: This set of instructions has been tested to also work on Fedora 14 and CentOS 5.7.

Sources:

  • https://wiki.asterisk.org/wiki/display/AST/Installing+Asterisk+From+Source
  • https://wiki.asterisk.org/wiki/display/AST/System+Requirements
  • https://wiki.asterisk.org/wiki/display/AST/Compiler
  • https://wiki.asterisk.org/wiki/display/AST/System+Libraries
  • https://wiki.asterisk.org/wiki/display/AST/Building+and+Installing+LibPRI
  • https://wiki.asterisk.org/wiki/display/AST/Building+and+Installing+DAHDI
  • http://techspotting.org/how-to-install-asterisk-on-centos-5/

 

Posted in Dev Notes, Fedora | Tagged Asterisk, DAHDI, libri | 1 Response

How to install AT&T Global Network Client on Fedora 16

By Randell on December 5, 2011

First, download the AT&T Global Network Client from ftp://ftp.attglobal.net/pub/custom/ibm_linux/.

If you try to install this using

rpm -ivh agnclient-1.0-2.0.1.3003.i386

you will get an error similar to:

failed to install file:
agnclient-1.0-2.0.1.3003.i386 requires libcrypto.so.4
agnclient-1.0-2.0.1.3003.i386 requires libssl.so.4

To solve this error, create a symbolic link for the missing modules by executing commands similar to this as root:

ln -s /usr/lib/libssl.so /usr/lib/libssl.so.4
ln -s /usr/lib/libcrypto.so /usr/lib/libcrypto.so.4

Proceed with the installation:

rpm -ivh --nodeps agnclient-1.0-2.0.1.3003.i386.rpm

If you try to run it at this point, you will get this error:

The AT&T Global Network Client daemon (agnclientd) is not running. It must be running to create a VPN connection. Please restart your computer or manually restart the daemon.

To solve this, execute the following command as root or just restart your computer:

/etc/init.d/agnclientd start

Note: This instruction also works for Fedora 14, and 15.

Posted in Fedora, How-to | Tagged AT&T Global Network Client, Fedora, Fedora 16 | 2 Responses

Cannot complete the install because one or more required items could not be found. Software being installed: Subversion Revision Graph 1.0.9

By Randell on November 28, 2011

Cannot complete the install because one or more required items could not be found.
Software being installed: Subversion Revision Graph 1.0.9 (org.tigris.subversion.subclipse.graph.feature.feature.group 1.0.9)
Missing requirement: Subversion Revision Graph 1.0.9 (org.tigris.subversion.subclipse.graph.feature.feature.group 1.0.9) requires ‘org.eclipse.draw2d 3.2.0′ but it could not be found

If you happen to get this error while installing the Subclipse plugin on Aptana Studio 3, it means you need to install the Graphical Editing Framework Draw2d first, which is not included in the current Aptana Studio 3 package.

Draw2d is part of GEF, which you can get from http://download.eclipse.org/tools/gef/updates/releases/. Draw2d is the first package when you expand the GEF from the menu. No need to install the other items unless you know that you need them for something else.

Posted in Dev Notes | Tagged Aptana Studio 3, GEF, Graphical Editing Framework Draw2d, Subclipse | 1 Response

Next »

 Subscribe in a reader

Recent Posts

  • Clear input values inside a div using JavaScript
  • How to install SFLphone on Fedora 16
  • How to install Asterisk on Fedora 16
  • How to install AT&T Global Network Client on Fedora 16
  • Cannot complete the install because one or more required items could not be found. Software being installed: Subversion Revision Graph 1.0.9
  • Fedora 16 pre/post-installation setup
  • error: can’t create transaction lock on /var/lib/rpm/.rpm.lock (Permission denied)
  • How to create custom application launchers in Gnome 3
  • How to add Power Off option in Gnome 3 User Menu on Fedora 15
  • How to clear recent documents in Fedora 15 Gnome 3
  • Google+ welcome page screenshot
  • Error validating location: “org.tigris.subversion.javahl.ClientException: Network connection closed unexpectedly”
  • Fix for “Aw, Snap!” when loading Twitter on Chrome on Fedora 15 with SELinux enforcing enabled
  • GTUGPH-SG Meet-up: Offline Web Applications
  • Fedora 15 pre/post-installation setup

Popular Posts

  • Fedora 15 pre/post-installation setup
  • Fedora 14 post-installation setup
  • How to create custom application launchers in Gnome 3
  • Warning: date(): It is not safe to rely on the system’s timezone settings.
  • Fedora 16 pre/post-installation setup
  • How to add Power Off option in Gnome 3 User Menu on Fedora 15
  • Tai Lung spotted at The Fort
  • GNOME 3 on Fedora 15
  • PLDT myDSL sucks!
  • Install SQLite Database Browser on Fedora
  • PHP Fatal error: Class ‘DOMDocument’ not found
  • Fix for “Aw, Snap!” when loading Twitter on Chrome on Fedora 15 with SELinux enforcing enabled
  • Convert CHM to PDF in (Fedora) Linux
  • How to clear recent documents in Fedora 15 Gnome 3
  • Lessons from The One Minute Manager

Tag cloud

Python Grip Fedora 15 pgadmin3 Firefox The One Minute Manager GNOME 3 Zend Tool YouTube PHP Azureus PostgreSQL Anthony Robbins The Big Bang Theory Add-ons NullPointer.ph Delicious PSP Heroes Javapassion Orson Scott Card Josh Groban Armenia Flash Java Aptana P7zip Ken Blanchard Google Chrome House Neil Gaiman Ajax Twitter Google VLC Skype Amarok Unlimited Power Ender's Game RPM Fusion Unrar Fedora Facebook Linux Robert T. Kiyosaki

Blogroll

  • Mike
  • Nikki
  • Paolo
  • Paolo
  • Renee
  • Rian
Personal - Top Blogs Philippines

Copyright © 2012 Randell's Blog.

Powered by WordPress and Hybrid.