How to: dynamically add input field in form, using Javascript

Recently I ran across this issue on a project. Whereas I need to employ a html textarea when needed (dynamic), plus the delete link. These is the Javascript part: function addElement(fieldType, fieldName, className, ctrl1, ctrl2) { var ni = document.getElementById(ctrl1); var numi = document.getElementById(ctrl2); var num = (document.getElementById(ctrl2).value -1)+ 2; numi.value = num; var divIdName = ctrl1+num; var newdiv =…

Read More »

Unrar solution on CentOS

For CentOS 32bit: rpm -i http://dag.wieers.com/rpm/packages/unrar/unrar-3.7.4-1.el5.rf.i386.rpm For CentOS 64bit: rpm -i http://dag.wieers.com/rpm/packages/unrar/unrar-3.7.4-1.el5.rf.x86_64.rpm To extract rar file, format: unrar e /path/to/file.rar Eg.: unrar e /home/me/somefile.rar

Read More »

How to: install mod_geoip2 for Apache2 on CentOS server.

mod_geoip2 is an Apache 2.x module for finding the country and city that a web request originated from. It uses the GeoIP library and database to perform the lookup. Steps: [*] Login via SSH as root to your server [*] Get the GeoIP C Library from MaxMind wget http://geolite.maxmind.com/download/geoip/api/c/GeoIP.tar.gz Wait until finished –09:43:23– http://geolite.maxmind.com/download/geoip/api/c/GeoIP.tar.gz Resolving geolite.maxmind.com… 64.246.48.99 Connecting to geolite.maxmind.com|64.246.48.99|:80……

Read More »
How to Read and Set Environment Variables on Linux (Bash)

How to Read and Set Environment Variables on Linux (Bash)

If you’ve ever SSH’d into a server, changed some setting, and then… nothing happened, there’s a good chance environment variables were involved. Before: your script can’t find programs, your app can’t see its config, and every new shell feels like it “forgets” what you just set. After: you know exactly how to view, set, export, and persist environment variables so…

Read More »
Basic Linux Navigation: Using cd, pwd, and ls Safely

Basic Linux Navigation: Using cd, pwd, and ls Safely

If you’ve just logged in to a Linux server and you’re staring at a blinking cursor thinking, “Now what?” — you’re in the right place. This is for you if you’re new to the command line, running a VPS or small server, and you just want to understand where you are and how to look around without breaking anything. Good…

Read More »