Andreas – Joakal

August 16, 2009

Where I get me fun

Filed under: Personal Life — Tags: , , , — Andreas Markauskas @ 4:54 pm

As of this moment, I have about 90 projects, not counting the closed ones. If this seems a lot to you, I agreed long ago and adopted a 3-active project rule that means I won't have to face tremendous amount of work to do. I do each of the three projects alternately at one every three days so each day is dedicated to project work. Yes, I consider projects to be a fun hobby in giving me a challenge and something to read. However I'm not always in the mood so here's what I do for fun on the web.

News Sites

These sites update me to the happenings and are mostly related to my interests and pursuits.

  • Slashdot.org A 'News for Nerds' user-submissions site. It updates me to the general idea of the world IT industry although some of the news and users predominately American.
  • Whirlpool It's not a washing machine, it's the biggest Australian forum that features a cool broadband choice section, ISP-related daily news and a hugely active forum that I browse.
  • Boston's The Big Picture A pretty impressive blog of big pictures, usually due to recent highlights in the media such as Typhoon activity.
  • Fark.com USA-Centred user-submissions site where it features the most random and bizarre yet actual news articles of the world. However, it has faltered lately as sometimes it appears to be male-biased or has an agenda when moderators approve certain news (eg news that males want and political content).
  • Wired Science USA-Centred editorial site like a newspaper, it features some cool exciting articles of science.
  • Wired Epiccenter From the same site as above, this is the technical business section. It features articles such as how Google helped Twitter in the recent DDOS attacks.
  • paidContent A site that provides global coverage on the economics of digital content. Gives an insight to site finances.

Daily Sites

  • digg - 24 hours A user-submission popularity based site, it gives a link to what people generally like at the moment. It tends to lean to USA-centred content at times but only because of the amount of USA users on the site. The maturity of the content can be very varied though.
  • Not Always Right A user-submission moderator-approval based site. It features the interaction from customers who have bizarre responses. Sometimes it's the other way around.
  • The Daily WTF A humorous blog dedicated to "Curious Perversions in Information Technology". It offers living examples and stories of disasters, horrors, etc. Great for those who are IT. For others, the error messages are funny and easy to understand most of the time.

Web Comics

I have Web Comics which are numerous but most notable ones I like:

  • Sluggy Freelance College students comic but centered around fantasy, talking animals and other outrageous hijinks.
  • Ctrl+Alt+Del A windows-centered comic of gamers. Also features storylines.
  • xkcd A webcomic of romance, sarcasm, math, and language.
  • PHD Comics The ongoing chronicle of life (or the lack thereof) in grad school. Some laughs, etc.
  • Digger Comic A wombat that goes on a mysterious adventure. Relatively new webcomic to me.
  • Dawn of Time A cave woman that seems to be going through many different timelines in the land for a funny tale of mishaps and interactions of the different periods.
  • UserFriendly.org An IT based comic by an IT guy who keeps copying and pasting. But there are quite some good jokes and storylines.

Other Sites

Here are some sites that don't fit above.

  • Wikipedia's Random Page Sometimes there's a good article.
  • Omegle Talk to a complete stranger. Sometimes interesting, sometimes rude, you never know.

August 13, 2009

Beefing up website and downsizing for performance

Filed under: Joakal.com — Tags: , , , , , , — Andreas Markauskas @ 8:53 pm

Validating to W3 standards

I have currently validated all my code to by XHTML 1.0. W3 Validator. To validate, submit a site and check the suggested tips and links. If that's not enough, the wide available documentation online of the standard made the job a breeze!

YSlow Grade A drive

  1. Use firefox
  2. Add firebug required plug-in.
  3. Add YSlow

I was determine to get the best grade possible. Joakal.com initially started at 86 with a grade B (YSlow V2) for most sections. The problem areas to fix:

  • Use a Content Delivery Network (CDN)
  • Add Expires Headers
  • Compress components with gzip
  • Configure entity tags (ETags)
  • Use cookie-free domains

Use a Content Delivery Network (CDN)

Unfortunately, this requires me to have servers dispersed across multiple countries to more rapidly deliver cached content. So I'll be skipping this.

Add Expires Headers

Initially, this wouldn't work until I came across the solution below

To the .htaccess file in your root, eg joakal.com/.htaccess. As for the line for auto_prepend_file, you need to add the DOCUMENT_ROOT which can be found by uploading a file with phpinfo(); at beginning.

<FilesMatch "\.(ico|pdf|flv|jpg|jpeg|png|gif|js|css|swf)$">
Header set Expires "Thu, 15 Apr 2010 20:00:00 GMT"
</FilesMatch>

Source: Add Far Future Expires to Speed Up Your Site

Compress components with gzip

The hardest one. I came across many solutions, but my server did not come with mod_gzip for this tip or I didn't want to rename all my files to use zlib. Some flat out didn't work. After some searches and refreshes, I came across this:

.htaccess file

<FilesMatch "\.(txt|html|htm|php)">
ForceType application/x-httpd-php
php_value auto_prepend_file /f1/content/joakal/public/gzip-enable.php
</FilesMatch>

Place gzip-enable.php in your root too

 <?php if (substr_count($_SERVER['HTTP_ACCEPT_ENCODING'], 'gzip')){
 // initialize ob_gzhandler function to send and compress data
ob_start ("ob_gzhandler");
} else {
ob_start();
} ?>

Note: There must not be any space before and after the <?php ?>

My site size has changed as I managed to get content size from 91K to 81K.

CSS and JavaScript

For CSS and JavaScript:

.htaccess file

<FilesMatch "\.(css)">
ForceType application/x-httpd-php
ExpiresActive On
ExpiresDefault "access plus 1 year"
php_value auto_prepend_file /f1/content/joakal/public/gzip-css.php
</FilesMatch>
<FilesMatch "\.(js)">
ForceType application/x-httpd-php
php_value auto_prepend_file /f1/content/joakal/public/gzip-js.php
</FilesMatch>

For gzip-css.php in root.

<?php
    // initialize ob_gzhandler function to send and compress data
    ob_start ("ob_gzhandler");
    // send the requisite header information and character set
    header ("Content-type: text/css; charset: UTF-8");
    // check cached credentials and reprocess accordingly
    header ("cache-control: must-revalidate");
    // set variable for duration of cached content
    $offset = 365 * 24 * 60 * 60;
    // set variable specifying format of expiration header
    $expire = "expires: " . gmdate ("D, d M Y H:i:s", time() + $offset) . " GMT";
	$gmt_mtime = gmdate('D, d M Y H:i:s', time() + $offset ) . ' GMT';
	header("Last-Modified: " . $gmt_mtime );
    // send cache expiration header to the client broswer
    header ($expire);
    ?>

For gzip-js.php in root.

<?php
    // initialize ob_gzhandler function to send and compress data
    ob_start ("ob_gzhandler");
    // send the requisite header information and character set
    header ("content-type: text/javascript; charset: UTF-8");
    // check cached credentials and reprocess accordingly
    header ("cache-control: must-revalidate");
    // set variable for duration of cached content
    $offset = 365 * 24 * 60 * 60;
    // set variable specifying format of expiration header
    $expire = "expires: " . gmdate ("D, d M Y H:i:s", time() + $offset) . " GMT";
	$gmt_mtime = gmdate('D, d M Y H:i:s', time() + $offset ) . ' GMT';
	header("Last-Modified: " . $gmt_mtime );
    // send cache expiration header to the client broswer
    header ($expire);
  ?>

Source: Compress PHP, CSS, JavaScript(JS) & Optimize website performance

My site size went to 31K, woot!

Configure entity tags (ETags)

This proved to be a bit tricky until I found these two lines to add to .htaccess

Header unset Etag
FileETag none

Source: Remove ETag Headers to Speed up

Worked a treat!

Result

96 at highest. The only exception was my admin area where my modifications that were supposed to be site-wide seem to have broken it but it got me a grade B over C (admin baseline test). Debugging result: a modification to allow HTTP compression somehow disabled the CSS giving me a semantic list-like look. I have commented it out. For those that want the whole .htaccess available for viewing is below.

# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>

# This breaks admin look. Uncomment if concerned about bandwidth and/or want compression
#<FilesMatch "\.(txt|html|htm|php)">
#ForceType application/x-httpd-php

#php_value auto_prepend_file /f1/content/joakal/public/gzip-enable.php

#</FilesMatch>

<FilesMatch "\.(css)">
ForceType application/x-httpd-php
ExpiresActive On
ExpiresDefault "access plus 1 year"
php_value auto_prepend_file /f1/content/joakal/public/gzip-css.php
</FilesMatch>
<FilesMatch "\.(js)">
ForceType application/x-httpd-php
php_value auto_prepend_file /f1/content/joakal/public/gzip-js.php
</FilesMatch>

<FilesMatch "\.(ico|pdf|flv|jpg|jpeg|png|gif|js|css|swf)$">
Header set Expires "Thu, 15 Apr 2010 20:00:00 GMT"
</FilesMatch>

Header unset Etag
FileETag none

# END WordPress

Addendum

Other links I came across for PHP, CSS and JavaScript performance.

Final words

Overall, it was a pretty good challenge and as a result, this site should perform very well. I will be carrying this knowledge over to some future web projects for a noticeable increase in performance. Some of the problems were encountered and too complex to solve were all because of WordPress' bloated code, however I can not find any alternative so I will continue to use WordPress for now.

August 6, 2009

A job RSS feed template

Filed under: Web Development — Tags: , , , — Andreas Markauskas @ 8:25 pm

While rehashing my knowledge of XML at XML lessons [w3schools.com], I decided to create a Career RSS Feed that would provide an easy way for job sites to create feeds that job sites can aggregate freely and in turn get more candidates for the job. I quickly scoured and came across this blog [RecruitmentDirectory.com.au]. This does the job pretty neatly.

August 4, 2009

Job hunt progress – August

Filed under: Personal Life — Tags: , , , , , — Andreas Markauskas @ 9:38 pm

I have not found any good jobs as of this moment. My most recent interview almost achieved me an internship until I baulked at the technical question that was out of my expertise. I suppose I had hoped I would get on the job training as I progressed.

Otherwise, yesterday, I had a particular dilemma where I realised from my courses this semester that were mostly business-oriented and economics-oriented yet the advertised business jobs had specifically stated their desire for business degrees and for IT jobs, they were requesting 3-5 years of minimum work experience in the IT industry. Since I am an IT person with business-economics knowledge, I thought that this was not helpful for my career goals and considered deferring or dropping out to attempt IT work experience. However, the recession is making jobs quite scare and I don't see it ending any time soon enough to gain some experience in place of a resume. As a result, I plan to continue my university education and build up my portfolio.

Some people have asked what I use to search for jobs, here's the list:

My tips:

  • Firefox users: Create a folder just below that URL bar named 'Job sites'. Next add all the job sites you like to browse. You can then right-click and click 'Open in all tabs'. Quick and easy.
  • When bookmarking job sites, try to bookmark the programmed search URL so you will always get the pre-programmed searches. For example http://whirlpool.net.au/jobs/?state=NSW for only jobs in NSW.
  • Don't go to random places during a job recession. Most likely if they wish to hire people, they will either advertise jobs in the local newspaper or a local job site (I'm guilty of it).
  • If the job ads are the same or there's more online at the local newspaper site, then you don't need to buy the paper every day like my Newcastle Herald does.

August 2, 2009

Blog up’s set up.

Filed under: Joakal.com — Andreas Markauskas @ 11:44 pm

There seems to be some cosmetic glitches as I attempted to add a portfolio and contact section. Please say what you think of the site.

Older Posts »