Development

A Simple Guide to Installing Both Firefox 4 and Firefox 3 on Ubuntu

February 7, 2011

Step 1: Add the Mozilla Daily PPA Repository # First, open up your terminal window. Once it’s up, type in the command below to add the Ubuntu Mozilla Daily PPA repository to your system: sudo add-apt-repository ppa:ubuntu-mozilla-daily/ppa You’ll be prompted to enter your password. Go ahead and do that, then hit Enter to confirm the addition of the repository. Step 2: Update Your Package List # After adding the repository, it’s crucial to update the package list to ensure you get the latest software. ...

Puppet Error – Could not file class in namespace – [solved]

January 18, 2011

How to Solve the Puppet Error: Could not find class in namespace # Sometimes, when working with Puppet, you may encounter an error message that does not accurately reflect the actual problem. For example, if you see this error: err: Could not retrieve catalog: Could not find class php in namespaces standardbuild at /etc/puppet/manifests/templates.pp:15 on domain.internal.com One of the possible causes could be a missing curly bracket in your code. ...

ERROR: phpize failed [solved]

January 17, 2011

How to install PHP development files If you want to run phpize on your system, you need to install the development files of PHP first. Otherwise, you might get an error message like this: sh: phpize: not found ERROR: `phpize' failed To install the PHP development files on Ubuntu/Debian, you can use the following command in the terminal: apt-get install php5-dev That should solve the problem. 🙂

How To Disable Google Analytics

September 30, 2010

You don´t like Google Analytics? # Go to http://tools.google.com/dlpage/gaoptout and install a browser plugin to disable Google Analytics.

How To Get The Current Epoch Time (Unix Timestamp)

September 30, 2010

Perl: time PHP: time() Ruby: Time.now # (or Time.new). To display the epoch: Time.now.to_i Python: import time # first, then int(time.time()) Java: long epoch = System.currentTimeMillis()/1000; Microsoft .NET C#: epoch = (DateTime.Now.ToUniversalTime().Ticks - 621355968000000000) / 10000000; VBScript/ASP: DateDiff("s", "01/01/1970 00:00:00", Now()) Erlang: calendar:datetime_to_gregorian_seconds(calendar:now_to_universal_time( now()))-719528*24*3600. # OR element(1, now()) * 10000 + element(2, now()). MySQL: SELECT unix_timestamp(now()) PostgreSQL: SELECT extract(epoch FROM now()); Oracle PL/SQL: SELECT (SYSDATE - TO_DATE('01-01-1970 00:00:00', 'DD-MM-YYYY HH24:MI:SS')) * 24 * 60 * 60 FROM DUAL SQL Server: SELECT DATEDIFF(s, '1970-01-01 00:00:00', GETUTCDATE()) JavaScript: Math. ...

Database Integration – some points to keep in mind

September 18, 2010

**Always Have a Single, Authoritative Source For Your Schema ** Everyone should know where the official schema resides, and have a frictionless experience in getting a fresh database setup. One should be able to walk up to a computer, get the latest from source control, build, and run a simple tool to setup the database (in many scenarios, the build process can even setup a database if none exists, so the process is one step shorter). ...

Perl – system load

September 7, 2010

To find the system load use the following perl snippet : System load of last one minute : my $system_load = exec('<a class="zem_slink" title="Uptime" rel="wikipedia" href="http://en.wikipedia.org/wiki/Uptime">uptime</a> | awk -F "load average: " \'{ print $2 }\' | cut -d, -f1'); my $system_load = qx('uptime | awk -F "load average: " \'{ print $2 }\' | cut -d, -f1'); System load of last 5 minutes : my $system_load = exec('uptime | awk -F "load average: " \'{ print $2 }\' | cut -d, -f2'); my $system_load = qx('uptime | awk -F "load average: " \'{ print $2 }\' | cut -d, -f2'); System load of last 15 minutes : my $system_load = exec('uptime | awk -F "load average: " \'{ print $2 }\' | cut -d, -f3'); my $system_load = qx('uptime | awk -F "load average: " \'{ print $2 }\' | cut -d, -f3');