Archive for January, 2009

Happy Chinese New Year

Tuesday, January 27th, 2009

Well, I am sort of really late, but Happy Chinese New Year anyway!

<Insert various sound bytes here, Kung Hei Fat Choi (don’t PinYin nazi me), etc.>

In other news, I was given a free old laptop today. The specs are, well, crap:

Pentium II 366MHz

128MB RAM

6GB Hard Drive

Here’s a picture of it with my current laptop (no, that’s not Ubuntu) (yes, there’s a good, but arguable reason why FireFox has is fact been changed to Ice Weasel):

Laptops

Laptops

(Yes, the quality is crap because I can’t afford the upload quota)

TODO: Picture of the messed up keyboard (the crap laptop, not my new one which I changed to Dvorak.

Googling myself

Tuesday, January 20th, 2009

I randomly noticed that it’s been qute a while since I’ve Googled myself.

The main thing that I’ve noticed from a few years on is that I now rank much higher than that random German CryptWizard who used to rank first on Google.

To that random other CryptWizard: owned. :P

Also, in other news I am now obsessed with letmegooglethatforyou.com. It’s much more fun than just plain telling someone to Google something, or linking directly to the results:

http://letmegooglethatforyou.com/?q=CryptWizard

CryptWizard’s Web Hosting Launched!

Friday, January 16th, 2009

I’ve basically finished all the work on the CryptWizard’s Web Hosting site and is ready to accept orders.

I am offering web hosting services focused on reliablitiy and performance, and in addition, I have found a potential niche market by hosting and setting up GHost++ on my servers which are on high speed low latency links.

Check out hosting plans at http://host.cryptwizard.info for the best value for money, premium web hosting!

Ordering Pages

Monday, January 12th, 2009

I now have the system able to calculate totals and I have done a lot of the backend stuff for ordering.

CodeIgniter’s secure and easy to use session system makes logging people in and out a breeze.

Go to CryptWizard’s Web Hosting’ Site and click on one of the links to see the latest work on the ordering system.

Database and basic pages with CodeIgniter

Saturday, January 10th, 2009

Having gone through a bit more of the General Topics in CodeIgniters excellent documentation and have worked out how to use the database, and “views”. If you have never used a templating system, or a web framework before, a “view” is a bit like a webpage with all the layout and design elements, but the content is replaced with filler text that gets replaced with the real content by PHP.

So I went ahead and created a new controller called plans, after creating a table for the data using phpMyAdmin. I discovered that CodeIgniter had an excellent “scaffolding” feature, that allows me to quickly enter data into the database table. First, you have to define a “secret” (which is in essence a programming term for a password) in application/config/routes.php:

$route['scaffolding_trigger'] = “secretword”;

Then, after that was setup, all I had to do was add one line to the constructor for each controller where I wanted to use scaffolding.

class Plans
extends Controller
{
function Plans()
{
parent::Controller();
$this->load->scaffolding(‘plans’);
}

}

Then once you access the controller’s URL with /secretword after it, you get a nice interface where you can easily add/remove/modify the data in the database, without having to use phpMyAdmin or write your own interface, which is really good for saving time when writing code.

TODO: Attach screenshot of scaffolding interface.

Setting Up CodeIgniter

Friday, January 9th, 2009

CodeIgniter is a PHP framework, that supposedly does not have the bloat of the other PHP frameworks (Zend Framework was one that I used, and it was a pain to navigate all that bloat).

I decided on CodeIgniter because I had read about it before at a web development blog (SitePoint if I remember correctly), and since IceFrog uses it, it can’t be that bad right? =P

All was going well as I setup a new virtual host in nginx and I downloaded CodeIgniter to my server and editted the config files as it said in the instructions manual: http://codeigniter.com/user_guide/installation/index.html

However, once I got to the Hello World example (http://codeigniter.com/user_guide/general/controllers.html#hello), I noticed that when I visited the URL for it, I still got shown the welcome page, which was unexpected. I tried removing the welcome.php and was then left with a 404 error. I took about 2 minutes thinking about it, and thought that it might’ve been because the PATH_INFO (the bit after .php/) isn’t getting through to the script, so I ran phpinfo with some PATH_INFO passed to it (http://host.cryptwizard.info/phpinfo.php/aoeu), and sure enough, there was no _SERVER["PATH_INFO"] under the PHP Variables section. Knowing the problem, I knew that finding the solution (or lack thereof) would not be hard (trust me, it’s always finding the problem that’s hard, not the solution).

So with my trusty friend, I found this useful mailing list post, straight from the creator of nginx:

> Dear All,
>
> Im a System Admin from Indonesia.
> I have a little trouble with Engine-X (nginx).
> My server can recognize PHP & FCGI well, but a trouble appear when I use
> a FuseBox frame work in my server.
> I assume that the troubles are here:
> ~ when server access a page like this:
> http://jkt6.detiksport.com/raket/index.php/home.read/tahun/2007/bulan/12/tgl/17/ti \
> me/235133/idnews/868421/idkanal/79
> Engine-X will parse that as folder (identified by slash (/)), but that
> doesn’t really a folder. Those are a fuseBox parsing methode.
> I run this application in Apache, and everything going well.
>
> What should I do  ?
>

location ~ \.php($|/) {

set   $script     $uri;
set   $path_info  “”;

if ($uri ~ “^(.+\.php)(/.+)”) {
set   $script     $1;
set   $path_info  $2;
}

fastcgi_pass   127.0.0.1:9000;

fastcgi_param  SCRIPT_FILENAME
/data/labdetiksport/site/sport$script;
fastcgi_param  PATH_INFO        $path_info;

I adjusted my nginx.conf per that post and viola, my “Hello, World!” worked:

http://host.cryptwizard.info/blog/

Now time to get onto some real work…

I’m poor =(

Friday, January 9th, 2009

Wow, no blog post of a while.

I’ve recently realised (or rather had it explicitly pointed out to me) that I’m making nowhere near as much money on the internet as (some of) my friends are. Though I don’t particularly need to make tons money on the internet, I don’t like being outdone (and of course, who doesn’t like money?).

I have decided to write my own online billing system and sell my own webhosting. Why?

- My server administration skills are going to waste (waste = not making money)

- I can learn more programming, and unlike the little fragments of code, or private code made specially for a certain individual, I can start to build a “portfolio” of code, making it easier to make money in the future.

- It’s something that more people can relate to. Honestly, how many people out there care that I’m writing a DotA stat’s tracking system, or something that shows the status of a Warcraft III Hosting Bot on a webpage? Probably not much (but please leave a comment if you do care =))

Also, keeping with the original purpose of this blog, I will try to make a post everyday (again).