Category Archives: Programming

Perl and Google Authenticator

In this article I’ll explain (with code) how to create and validate a Google Authenticator two-step authentication token, using Perl. Both on the command-line and on a simple website. Some background Google Authenticator is a two-step authentication process created by Google. It’s software based, unlike those hardware tokens your bank may use, and when paired… Read More »

HelloWorld java application on Codenvy.com

Recently I discovered the codeny.com and it amazing! You can code in the cloud wherever you want. Bellow, it’s a Hello World java application which runs on the codenvy.com HelloWorld.java, located on src/main/java/HelloWorld public class HelloWorld { public static void main(String[] args) { System.out.println(“Hello, World”); } } pom.xml <?xml version=”1.0″ encoding=”UTF-8″?> <project xmlns=”http://maven.apache.org/POM/4.0.0″ xmlns:xsi=”http://www.w3.org/2001/XMLSchema-instance” xsi:schemaLocation=”http://maven.apache.org/POM/4.0.0… Read More »

Send email from Gmail using Perl

You can send email from Perl using the following code: use Email::Send; my $mailer = Email::Send->new( { mailer => ‘SMTP::TLS’, mailer_args => [ Host => ‘smtp.gmail.com’, Port => 587, User => ‘username@gmail.com’, Password => ‘password’, Hello => ‘fayland.org’, ] } ); use Email::Simple::Creator; # or other Email:: my $email = Email::Simple->create( header => [ From… Read More »

6 Powerful Frameworks for creating RESTful services in Java

Representational State Transfer (REST) is a software architecture style consisting of guidelines and best practices for creating scalable web services. Here is a list of best Frameworks specifically for creating RESTful services in Java. 1) Dropwizard Dropwizard is a Java framework for developing ops-friendly, high-performance, RESTful web services. Dropwizard is a opinionated framework for setting… Read More »

35 best practices for Web Application/Site performance boost

Bellow is a list of 35 best practices for web site/application performance optimization. Minimize HTTP Requests 80% of the end-user response time is spent on the front-end. Most of this time is tied up in downloading all the components in the page: images, stylesheets, scripts, Flash, etc. Reducing the number of components in turn reduces… Read More »

Perl, character encoding and the WWW

For most applications, UTF-8 is a good choice, since you can code arbitrary Unicode codepoints with it. On the other hand English text (and of most other European languages) is encoded very efficiently. HTTP offers the Accept-Charset-Header in which the client can tell the server which character encodings it can handle. But if you stick… Read More »

Force Apache to use proxy

ProxyRemote * http://ip.of.proxY.host:port More info available on Apache web page: http://httpd.apache.org/docs/2.2/mod/mod_proxy.html#proxyremote

Convert SSL Certificates .crt to .cer

In some cases when submitting a CSR request some certificate authorities only have the option to select the server as “IIS 5+”. The actual version we run is IIS 6. When IIS 5+ is selected the certificate is issued as a “.CRT”. If this is the case we have included directions on how to convert… Read More »

SMTP Relay

Normally, mail and derivatives (and almost any other Unix MUA) use the traditional sendmail interface – /usr/bin/sendmail, provided by almost all MTAs (postfix, exim, sendmail, courier). This is the traditional Unix way. Once a message is submitted through sendmail, your MTA handles message transmission. Depending on configuration, it may either connect directly to the destination MTA (if on a server), or… Read More »