My business cards I had forgotten I had.

roland's picture

Today I found a batch of business cards I had completely forgotten I had. For kicks:

Business Card Front

Business Card Back

This is my last day at Finelight and I will miss all the people here, especially our interactive team.

I recycled all my papers too. :D

vhosts_alias Apache Module on Ubuntu Server

roland's picture

Ubuntu Server comes with an interesting way of handling virtualhosts/sites. There are two folders /etc/apache2/sites-available and /etc/apache2/sites-enabled. You can enable and disable using respectively a2ensite and a2disite.

With wildcards introduced into DNS sometime ago, you can take advantage of vhosts_alias modue. You can install it using:

sudo apt-get install libapache2-mod-vhost-hash-alias
sudo a2enmod vhost_alias

The cool thing about this module is that it allows you to easily create subdomains.

To enable your domain you create a file in /etc/apache2/sites-available/www.mydomain.com.conf which can contain something like the virtualhost below, and enable with

sudo a2ensite www.mydomain.com.conf
and finally reload apache with
sudo /etc/init.d/apache2 reload

<VirtualHost *:80>
  ServerName www.mydomain.com
  ServerAlias mydomain.com
  ServerAdmin my.email@mydomain.com
  DocumentRoot /var/www/mydomain/www
  ErrorLog /var/log/apache2/www.mydomain.com.error.log
  CustomLog /var/log/apache2/www.mydomain.com.access.log combined
  <Directory /var/www/mydomain>
    AllowOverride All
  </Directory>
</VirtualHost>

Next, you want to add all sorts of subdomains to show off your projects.

Create another configuration file: /etc/apache2/sites-available/aaa.virtual.mydomain.com.conf . Note the naming of the file, the "aaa" is not chosen in vain. The alphabetical order of the names matters. All your aliased VirtualHost need to come before any other regular VirtualHost. Add something like this in the config file.

International Calls with Google Voice

roland's picture

Recently, I was invited by Google to join their GV (Google Voice) system. They give you a phone number for free when you sign up. When someone calls that numbers all your phone numbers go off simultaneously until you pick one up. Kinda similar to how the Google Talk works. Your phone, email window, and client (such as pidgin) go off when someone sends you a message.

I also have a G1 phone, and Google released an application called "Google Voice" that integrates GV with the G1 really well. In my case, I have configured it so that all my international calls are made using Google Voice. You can set it up to do the same with domestic calls, but I find that a bit useless. However, if you want to keep one number, using the GV program the caller will actually see your GV number.

Alright, so I spend about $40/month on phone cards to call my home country Albania. I have been using "CallingCardPlus.com", and their rates are okay, and generally I get connected. Sometimes, it takes more than one try, but generally it's pretty reliable. So far, calling landlines with GV seems better than calling cell phones. Actually, you will hear the ringing going on and on, but the person's phone on the other end doesn't ring. So you have to try 3-4 times before you can connect. If you're lucky, you may get it on the first time.

At 25 cents/minute for cell phones and 15/cents per minute for landlines, the prices are competitive, but until they resolve such issues, I might have to hold back my purchases.

Getting Ripped Off in Chicago

roland's picture

Sometime ago my girlfriend and I went up to Chicago for a weekend to see the city and visit museums. One attraction that sounded particularly good was the "Chicago Architecture Foundation River Cruise". The prices were advertised at $32/person which sounded reasonable.

On their website they have a ticket purchasing system via ticketmaster. Here's the receipt of the trip:

So, the charges per person are:

Ticket Convenience Charge$5.75
Additional Taxes$1.04
Order processing charge$4.25
TicketFast Delivery$2.50
Totaling:$13.54

That's 40% of the original price of the ticket. I thought technology was supposed to make things cheaper, not more expensive. Anyhoo, we purchased the tickets anyways, and I must say that was one of the best attractions in Chicago. I do recommend this cruise to people but get ready for some fake prices.

If you think this is a bit unfair, wait till you see parking fees in Chicago. They start at about 20/day. :D

Advice for People Considering to Start an Online Business

roland's picture

So you've probably wanted to start your online store and you're wondering where do you start. It takes a great deal to making a site popular; hence increase your sales. Just having a URL in your name doesn't mean much if anything. It will take at least a year for your domain to be recognized/valued by most search engines.

The Technical Aspect

You will need a shopping cart application.

Option 1: There are many sites such as shopify.com that specialize in shopping cart sites. Prices start $25/month, which might be a bit pricey at first. Another option is to choose a hosting companies such as 1and1, because for $4/month you get a bunch of software, including their shopping cart application.

Option 2: Another option is to use a blog like wordpress as your online store. Then, you can use paypal (business account) to create buttons for people to purchase your stuff. You'd have to create a button for every product. I think you can do the same thing with google checkout.

Option 3: A third option is to use another shopping cart application such as www.oscommerce.com. It's free and it does a good job with managing the inventory. You will need to purchase a SSL certificate that can range from 35-100/year depending on the reseller. Paypal, authorize.net and other payment gateways integrate very seemlessly, and you should be able to quickly get your store going.

The Marketing Aspect - The Road to Success

You've got to devise a marketing campaign for your site. Now, you can advertise your stuff on facebook, write posts, open up a different dedicated only to your online personality.

Here are some recommendations:

A collection of technical skills a web developer ought to have

roland's picture

Recently I've had to think a lot about what are the skills a web developer should have. Not all web developers are the same, and not all projects are the same. So I decided to put together a list of skills:

Front End:

* XHTML/HTML W3C Compliant
* CSS W3C Compliant
* Cross Browser Compatibility
* Familiarity with a PNG fix js script
* AJAX (Knowledge of a library jQuery, Prototype, dojo, etc)
* Javascript, JSON, DOM Manipulation
* Accessibility Requirements WAI/Section 508
* Prevention of XSS and CSRF
* SEO comprehension, Meta tags, Robots
* Flash/ActionScript
* Firefox+Firebug+other tools
* Some Photoshop/Fireworks/Gimp?

Back End Programming

* A web language from: PHP, Java, Perl, Ruby, Python, .NET C#/VB, Coldfusion, and many more.
* Object Oriented Programming (even when using a scripting language like php or perl)
* Model View Controller (MVC) paradigm
* Work with a web framework or create one
* Accessible form with server side validation
* SQL: Minimum expertise in a version of SQL (Sql Server, MySQL, PostgreSQL, Oracle etc).
* SQL: Views, Joins, Inserts, Stored Procedures (create/execute), Dumping/Loading/Exporting, User Access
* SQL injection prevention. Escaping database inputs etc.
* Cron/Task Scheduler
* Shell/Scripting
* Unix/Windows configuration requirements
* Apache/IIS/other web servers configuration. Understanding of htaccess and redirect rules
* Regular Expressions
* Spiders, Indexing, Searching
* Penetration testing
* Stress/Unit/Functional Testing
* Customization of CMS, Blogware, other prebuilt applications
* Session/Cookie handling
* Internationalization
* Source control. CVS/SVN/git etc
* Webservices: SOAP, XML RPC
* XML/JSON/Feed parsing
* Captchas, either generate them or use a service like reCaptcha
* Single Sign On (SSO)
* LDAP/DAV configuration, invocation

Application Deployment

* DNS: Bind(9) configuration of dns zones

How to Disable Teasers in Drupal

roland's picture

I don't quite like teasers because your posts look funny. Especially if you have images or anything else meaningful. So, how do you disable the darn thing?

I have found only a manual hack so far. Edit node/node.module and find the node_view function. Append right after the funciton declaration $teaser = FALSE;

And voila, this will disable all teasers from your site. The down side to this solution is that next time you upgrade drupal you'll have to manually add this line in again.

Collision Detection with ActionScript

roland's picture

Have you ever wondered how do you detect that a object has hit another object? Well, some computational geometry functions should come in handy.

The black line is the line that we want to detect if something hits it. The end coordinates are (a.x, a.y) and (b.x, b.y).

The point (c.x, c.y) is the point that will cross the line (a, b). If we compute the surface of the area going from a->b->c we should get an area with a different sign in comparison with the triangle (a,b,d).

So, we simply compute the surface every time the point c moves towards the line.

    /*
      Returns the area sign of the triangle formed by the vectors ab, bc, ca
      Area Sign       Vertices Walk          Point c Location
      ------------------------------------------------------
          1            Clockwise              Right of ab
         -1           Clockwise             Left of ab
          0           Clockwise             On ab
          1           Counter-Clockwise     Left of ab
         -1           Counter-Clockwise      Right of ab
          0            Counter-Clockwise      On ab
    */
    public function areaSign(c:Point):int {
      var a:Point = this.getBegin();
      var b:Point = this.getEnd();
      
      var area2:Number; // This is twice the area of the triangle. IE: Parallelogram

      area2 = ( b.x - a.x ) * ( c.y - a.y ) -
              ( c.x - a.x ) * ( b.y - a.y );
      
      /* The area should be an integer. */
      if      ( area2 >  0.5 ) return  1;
      else if ( area2 < -0.5 ) return -1;
      else                     return  1;
    }

Here's an example using the code above. Each player bar is a rectangle with 4 lines like the one in the picture above.

Syndicate content