Phine Solutions web work notes

Use the third party DNS

Filed under: server setup — 1.618 @ 10:47 am

Using a third party DNS have some great benefit:

  1. By outsourcing the DNS look up the load is reduced on your own server, especially like a VPS or dedicated box which runs everything: Apache, MySQL, Named.
  2. Well know DNS operates on a backbone and provide each DNS request with complete redundancy.
  3. Taking the Named service off from your server not only reduces load but also reduces the open port and maintenance work.
  4. An external DNS server will provide better control. This really applies to the domain or sites on shared hosting service and the capability of updating the DNS zone info such as TTL is limited. When it comes to changing the hosting provider, the delay of switching hosting DNS can be unpredictable.

I tried out dnsmadeeasy.com for one of my site and the result was great. It was amazingly simple to create domain name record in dnsmadeeasy account and the change was propagated in a matter of minutes. Another site dyndns.com also provides this kind of service with the similar fee structure. Using the free DNS check service from intodns.com (dnsstuff.com requires fee now) is also recommended to make sure everything is in order.

Simple command to find out the directory disk usage

Filed under: linux goodies — 1.618 @ 8:37 am

ls -F | grep “/” | xargs du -hs

For admin to snoop everybody, try

ls -F | grep “/” | sudo xargs du -hs

ssh public/private key using ssh-keygen

Filed under: linux goodies — 1.618 @ 4:07 pm

me@connect-from-machine:~> ssh-keygen -t rsa
Generating public/private rsa key pair.
Enter file in which to save the key (/home/me/.ssh/id_rsa):
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /home/me/.ssh/id_rsa.
Your public key has been saved in /home/me/.ssh/id_rsa.pub.
The key fingerprint is:
blah blah ….

The command ssh-keygen -t rsa initiated the creation of the key pair.

The private key was saved in .ssh/id_rsa. The file is read only by you and you can see why since if someone else get it he can try to use it to connect to the same machine. If you happen to make it passphrase free, it will be even easier for the other person.

The public key is save in .ssh/id_rsa.pub.
Its content is then copied in file .ssh/authorized_keys of the system you wish to SSH to without being prompted for a password. Using scp, this can be done by scp .ssh/id_rsa.pub username@remote-machine:/.ssh/authorized_keys .

Once the file is copied you are on ssh private key login.

JQuery vs. Prototype

Filed under: my 2 cents — 1.618 @ 10:57 am

Recently I started looking into both JQuery and ProtoType to simplify the Javascript works on my site and first decision to make was to which one to choose. Besides these popular options, MooTool also caught my attention since it appears there are some very loyal followers on the web.

I found this article best explains the differences between JQuery and Prototype from the level of the framework itself.

In short, Prototype does what a “framwork” is supposed to do. It is a layer between the HTML dom objects the developer and functionality is done through a set of classes.

JQuery is, for lack of better word, a straight DOM manipulator. It also provides a layer between the JavaScript and HTML, but it is more direct and simpler so it is rather provided as a “library” than a “framework”.

I guess which one to pick largely depends on the developer because neither could really go wrong. It is really about how you look at HTML frontend coding, or whether you are more comfortable with treating the HTML dom as an individual entity and Javascript as UI helper; or JavaScript as a UI driver and HTML is a product of it.

I personally enjoyed using JQuery and I like it a lot. And I believe JavaScript should stay small in the whole HTML UI design and not to be too complicated.

Programmer + boss < 0

Filed under: my 2 cents — 1.618 @ 10:49 pm

Dr. Graham’s new article made the reddit.com’s front page. It talks about the programmers’ natural unfitness to work for a corporate environment. Being a programmer myself I can totally relate to what he had to say. I have a day job, its bring me the money to support my family; but my true passion is in my own “moonlight startup”. Comparing two kind of work styles can be interesting and Dr. Graham said it perfectly.

“Programmers learn by doing, and most of the things he wanted to do, he couldn’t—sometimes because the company wouldn’t let him, but often because the company’s code wouldn’t let him. Between the drag of legacy code, the overhead of doing development in such a large organization, and the restrictions imposed by interfaces owned by other groups, he could only try a fraction of the things he would have liked to.”

This is so true. Working in a big corporation environment really frustrates me sometime because knowing how NOT to do things is such an important skill and you have to master it. I guess the extreme goes to the government job.

As a programmer, what attracts me starting up my own project is the freedom of thinking. My idea may succeed, or it may fail; but I learn and grow from it. The freedom of implementation also makes working such a fun thing.

I guess people are different. Some enjoy working a corporate, but not for the good programmers.

CVS - update command problem - move away the file is in the way

Filed under: cvs — 1.618 @ 3:56 pm

Sometimes I am getting this weird error when try to updating the CVS sandbox:

…move away the file mydir/myfile, it is in the way.

The file was checked in fine and the problem goes away if I try to run update in the directory where the file is located.

Usually deleting the whole “mydir” and do a fresh update will fix the problem, but what causes this?

One possible reason is that the directory name was not properly updated in CVS. This can be verified by going to the parent dire of “mydir”, and open the entries file in the CVS folder. It should include this line:

D/mydir////

If it’s not there, adding line to the file can probably fix the issue above.

But what caused the missing directory name then? Beats me. My best guess in my case is that the failed style checking when checking in CVS files has caused some inconsistency in the sandbox, thus the error.

Fight spams

Filed under: my 2 cents — 1.618 @ 8:41 pm

If you run a website or websites, you understand how spam is such a pain in the butt. I guess this is one of the things a webmaster has to deal with. With the technology today, it is a lot easier to create content on the web, including spam. So separate yourself from spam becomes an inevitable task for a web builder.

Blog

If you use wordpress, Akismet is THE plugin that you need to activate.

Forums

I have forums using both vBulletin and Simple Machine, and Akismet can be used to handle the spam filtering too. For vBulletin, there is readily made plugin that you can download and install from vbulletin.org. And I wrote a simple Akismet API for my Simple Machine board and it worked fantastic.

POW (Plain Old Website)

If you code your (or someone else’s) site all by yourself, there is no readily made “plugins” for you to use. But on the other hand you will have more power to customize since you know the code throughout. There are a few things you can implement to reduce or block spam.

Country Ban

Not trying to discriminate but there are certain countries where a lot of spams are originated from. If your site’s visitors are mainly from US, you can pretty much block all the foreign users from accessing certain pages such as registration, contact, etc.

To identify the user’s country, you can use the IP to country mapping database from maxmind.com and ip2location.com. Both companies provide trial versions of databases and APIs to use. If you like the result, you can purchase a basic version for only $50 from maxmind.
Ip Ban

I don’t normally use the IP ban since a spammer usually has multiple IPs to use and it is not that hard to hide the real IP.

Akismet web service

I love Akismet!

Where to find images for my websites

Filed under: usability design — 1.618 @ 4:29 pm

Being a website builders, I constantly need the images for my sites. There are several ways that I have used to get the images. Some of them worked out well and some were quite disappointing.

Stock image sites - where you can buy

I use a couple of sites to buy images: stockxpert.com and istockphoto.com. You can get both jpeg or vector images from these sites. Stockxpert.com offers are a little bit cheaper. In my experience, istockphoto.com’s images have slightly better quality.

This has been my best method to aquire the vector images for icons and logos. If you know a little bit about Adobe Illustrator, you should be able to get some vectors files and use them in different places with some simple tweaks.

Use a local graphic designer

Originally I was looking to get some local talent to help me out but it never worked out. I once worked with a graphic designer who work on some design projects for fortune 500 companies on a logo design. Her draft work was just some pensil scribbles on a piece of paper and her rate will double as soon as she touches a computer. Plus she tried to get me to sign a contract so any future change has been done by her only. A friend told me the best way to go is to hire someone just out of school but I haven’t tried that myself.

Use ODesk to hire some designers

ODesk.com is a place to hire the freelancers. You can create your project and get people to bid on it. Since the people for hire are from all over the world often time you can find some talent with very cheap rate.

My ODesk experience was a mixed bag. I worked with someone who had tons of hours (total hiring hours by ODesk) but the work was at most mediocro. Sometimes it appeared he didn’t even read my requirements in the email. And he was never shy about asking for good ratings at the end of the project. Once he even IMed me to “request” better rating because it affects his ODesk rating history. Mind you I wasn’t even the one who gave him the one star that he probably deserves. He was FOR SURE blocked from my GTalk.

I also worked with some designers who made great work for one project but came up short on the other.

My advise on hiring on ODesk is to find someone who’s new or hasn’t many hours accumulated yet.

Get free images online

Although Google image search can find a lot of images, they are mostly copyrighted and it is illegal to directly use them on your websites. This site: yotophoto.com , can find the free-to-use images for you.

Hosting short list - updated

Filed under: web site hosting — 1.618 @ 8:30 am

Finding the right hosting can be a real headache for the webmasters.

When I put my first website on the Internet I picked one that only to be mediocre, to say the least. With the growing number of my sites and the real need for the site up-time and service quality, upgrading my hosting company is a necessity.

I was pretty much blind in the hosting world and had to do a lot of research to and listen to what other webmasters say about the hosting and learn from their experiences. webhostingtalk.com is still the place I go to for research and opinions.

I guess a good hosting company should just offer the solid service and let you forget about them. If I often have things like “what the @#$% is going on with company blah and what happened to my supporting ticket…” popping up in my mind it certainly not a good thing. Also see my post about “5 signs you should start planning changing your hosting company“.

Based on my experience I have compiled a short list of hosting companies in different arena. Hopefully it can help someone in the same shoes to get started.

An updated note: I am an affiliated seller for dreamhost.com and hostgator.com. However the review is only based on my true personal experience and it also helps me to track their service quality as well.

Shared hosting

Pair Networks - pair.com

A truly fantastic company. Solid service and support. One thing worth to note is that their MySQL server runs on different boxes (physical or virtual), this really isolate the issues that come across between Apache and MySQL.

Pair supports both PHP4 and PHP5. Since PHP5 runs in CGI mode all you need to do is to put an executable PHP wrapper in the CGI-BIN directory and make the proper configuration change in your .htaccss file.

However they do not provide cpanel…not sure if this is out of the consideration of the high resource usage of cpanel. If you start off a serious site and want some top notch shared hosting service I would strongly recommend Pair.com.

Update: I moved one of my forum site (vbulletin) over to Pair and it has been 2 monthes without any problem. Two thumbs up.

Although Pair is the best shared hosting service that I’ve ever had, I do want to point out that they’ll charge a $5 installation fee on every domain that you add to your account. This may hurt a little if you frequently add/remove domain from your account, which apparently they discourage.

Bluehost.com

I have a few sites hosted with bluehost.com and haven’t had much complaint so far. One thing I do wish to have is to have the capability to run both PHP4 and PHP5 in one single account, and currently this is not possible at Bluehost.

Just a few days back I received a email from bluehost.com stating that they will need to remove all the “catch-all” email accounts to reduce the server load from the spam. And a few days later another email came and canceled this plan. According to bluehost it was apparently due to the customer feedback.

On Jan 18th I received a email announcement from Bluehost President Matt Heaton about the new changes on Bluehost servers for better performance. Some more observations need to be done to see the actual effect on my sites hosted by Bluehost. As a customer I do like their effort of constant improvement.

On Feb. 22 one of my sites hosted by bluehost.com went down for almost 10 hours. The server was down and I am guessing it was some hardware failure and they had to do a whole lot to make it back on line. There was no explanation given after the incidence and I figured even I asked I would probably just get some general answers. NOT a good sign for me.

The bluehost service has been pretty stable lately. One thing I’d like to brought up about their web supporting system. It appears one can log a ticket even without creating an account, but based on my experience, there will be no response to the ticket created this way.

Incident:

It appears the database hasn’t been quite stable recently and I have a few occasions that DB was not accessible. I emailed the support in one case, and DB was back up later. Next day an email arrives, from support, and ask more detail about how I use DB, what error I saw, blah blah…

On Dec.26 my site at Bluehost stopped responding again. It took about 5 hours to get back online and none of my two support tickets got a single response except the automatic message. Maybe one of the site on the same server is a E-Comm site? Who knows. But at this point I am very disappointed with Bluehost and I don’t recommend using it.

Dreamhost.com

A hosting company with a fairly good reputation. It seems so hard to find a company that has no gripe from someone, and dreamhost is not an exception.
I started to use Dreamhost this year. The experience has been good so far.

What I like:
The easy and no frill setup process. I placed an order and literally within a minute or so I received the turn up email.
Nice domain directory management. Most hosting service lets you create multiple domains in one account. But the hosting directory for your second domain will reside under your main domain as a sub-directory.

For example, if you have domain1.com setup and create a second one for domain2.com, the web server directory will look something like this:

/home/username/public_html/ <– this is for domain1.com
/home/username/public_html/domain2 <– this is for domain2.com

A big deal? not really. But it definitely add some complication when maintaining the code.

In a Dreamhost account, you will have them separate:
/home/username/domain1.com <– this is for domain1.com
/home/username/domain2.com <– this is for domain2.com

Dreamhost also has their own version of control panel, which maybe a problem for someone. In my opinion, their control panel is simple and functional. The only issue I have is the naming and organizing of the left navigation menu of the control panel. For example, the “Managing MySQL” link is under “Goodies”… I guess it depends on how much you are bothered with this, for most people, this shouldn’t be a big deal.

Dreamhost has a very generous hosting plan. You can add/remove domain at your wish and the disk space and bandwidth limits grow as you stay with them. I do get occasional downtime with my sites at dreamhost. But if you have some domains that just want to put aside with a few pages, dreamhost is a nice place to start. 

Lunarpages.com

Can’t say I have a lot of experience with the company but once I did buy the basis hosting plan for 12 months and later found out the plan doesn’t include the SSH access. I cancelled the plan and it was quite simple with their 30 day money back ganrantee feature. It was totally my fault and their support was great on this matter.

So I didn’t have a chance to use their supporting system. Anyway, it is a company scores a lot of good reviews. My own little experience adds point to this company too.

hostgator.com

A fast growing and fairly new company. It also has received a lot of positive reviews. It may worth a try if the price is right.

VPS

servint.com

I use its VPS for a couple of my sites.
Since I am not in the reseller or hosting business I don’t fully utilize tools like Cpanel so my review has some limited perspective.
So far I have been very satisfied with servint’s service. I bought the Essential VPS package and it was setup in a couple of days. I did have an inquiry about the status and the response was prompt.

With the growth of the site the server started to slow down. I upgraded by VPS and still saw load average constantly over 1.00 mark. This is when great support can really help. I email the support and Tommy quickly adjusted a setting of mysql configuration and the server started to fly again. This also prompted me to look into my.cnf file more carefully and make necessary tweaking.

Fully managed VPS != holding hands on everything. But Servint’s tech support has been great with their knowledge.

liquidweb.com

This is another company that has great reviews.
I almost went to Liquidweb and a post on webhostingtalk.com changed my mind and I signed up for Servint (This proves how easy it is to lose a potential customer on the internet). However my previous research has favored this company and I still want to recommend them.

powervps.com

This is another company mentioned frequently by webmasters and has mostly good reviews.

Facebook’s worth, Microsoft’s gamble

Filed under: my 2 cents — 1.618 @ 10:43 am

Is Facebook worth really this much?

Personally I don’t think so. Unless there is some secret revenue making channel that I can’t see.

Is this a good move for Microsoft? The key is not how small the percentage of the FB stake that MS gets, it’s the stake of the FB ad netowrk. And the victory of blocking out Google in the deal. Comparing with the other ad network deals happened earlier this year, it is possibly good move from MS side.

« Previous PageNext Page »

©phinesolutions.com