How to Edit the sudoers File Safely with visudo

How to Edit the sudoers File Safely with visudo

If you break your sudoers file, you can lock yourself out of root. That’s the nightmare we’re trying to avoid here. This guide is for anyone managing Linux servers (VPS, bare metal, cloud instances) who needs to give or adjust sudo access without shooting their future self in the foot. I’ll walk you through how to use visudo correctly, how…

Read More »

How to fix: Google Earth crash on Ubuntu 10.04 Lucid Lynx

I got the following error after executing Google Earth application on Ubunto 10.04 Lucid Lynx ubuntu@ubuntu:/opt/google-earth$ /usr/local/bin/googleearth Fatal error in __driConfigOptions line 1, column 0: unknown encoding. Google Earth has caught signal 6. We apologize for the inconvenience, but Google Earth has crashed. This is a bug in the program, and should never happen under normal circumstances. A bug report…

Read More »

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 »