Tech

PHP 5.2 has support for showing the percentage uploaded for a file upload in progress. If you're not running Apache as your web server,

Drupal's FileField module automatically detects for and uses upload progress support on the server end. This can either be APC (Alternative PHP Cache) with rfc1867 support or with the uploadprogress PECL extension. In Drupal, the upload progress bar looks like this:

You can check to see if you already have support by going to admin/reports/status.

If the report shows that your server has support yet FileField CCK fields aren't updating the upload progress bar then your server has a problem.

Read the rest of this article...

Getting Drupal to stream video using PHP and the FlashVideo module to manage video uploads is not easy. It involves 5 distinct pieces of software, which means 5 places where things could go wrong with little error logging.

Here's what you need:
1. FlashVideo http://drupal.org/project/flashvideo
2. ffmpeg
3. flvtool2
4. xmoov-php
5. JW Player

Read the rest of this article...

Server Colocation and VPS Hosting in Vietnam

Submitted by tomo on January 23, 2011 - 6:30pm

I used to run a hosting company back in the states. I wouldn't want to get into that business again as it's capital-intensive (for a tech company) and highly competitive.

Looking at the server colocation market in Vietnam it seems small and expensive for what you get, and maybe there is far more demand from Vietnam-based businesses to host in the US because that's where their customers are. But companies that aim for the domestic market need to consider hosting locally since the Internet link to the US is relatively narrow and expensive with high latency.

When I searched for colocation servers in Vietnam, the #1 result, vn84.com, was down; webhosting.com.vn's account has been suspended; aacecom.net is now a parked domain just showing ads. Not very good results.

After distilling the first 100 or so results on Google:

Conclusion: FPT is definitely a stable business, yet prices aren't out of line, with higher upload speeds. It's always best to avoid anything priced in USD since the Vietnam dong is certainly going to weaken against the dollar soon. But even the cheapest colo at 1.3 million VND is more than I can lease a dedicated server for in the US.

So how much are dedicated servers at these places?

Oddly, for pavietnam.com the price to lease a dedicated server is cheaper than to buy and colo your own!

Virtual Private Servers are another option. Let's compare:

They come out to roughly a third of the cost to colo. You'd be better off finding a friend to chip in and get pavietnam's dedicated server deal.

UPDATE April 3, 2012:
There are a lot of small providers in Vietnam outside of the big ones listed above. If you want to check some out, many even have free trials. Check out the forum at vn-zoom.com if you can read Vietnamese.

For colocation, Viettel's IDC "Sóng Thần" datacenter in Binh Duong is the largest in Vietnam, and possibly all of southeast Asia.

When considering Singapore as an alternative hosting center, be aware that generally prices for VPSs in Singapore are significantly higher than what you would pay in the US, while latency is still around an order of magnitude (10x) that of a Vietnam-based host, while still 1/2 to 1/3 of a North American host. YMMV.

Google Spam / Content Farm Filter

Submitted by tomo on January 21, 2011 - 3:06pm

There's been a lot of talk about the decrease in quality of Google search results over the years due to spammers / content farms with strong SEO skills. I'm glad I'm not the one who's been annoyed by this.

Google should know which sites are spam, content farms, or duplicated content. That they aren't properly filtering or demoting them could be due to a conflict of interest - they make money from the ads on those crap sites.

But we, as individuals, can easily distinguish the spam results from the quality ones and we do so everyday. If only there were a way to stop duplicating this effort.

If Google won't do this for us, then we can do this ourselves.

Here's what I want:
1. When I've been tricked into opening an ad-filled page without meaningful content, I want to go back to Google and mark that link as "spam", have that noted somewhere in the cloud so I can access it from any computer, and have future search queries filter out that link.

2. I probably don't want to see any pages from that domain show up on any other queries.

3. I probably don't want to see any pages that my friends have also marked as spam.

4. I probably don't want to see any pages that friends of my friends have also marked as spam.

5. I may even want to befriend / "follow" strangers just because they're good at marking spam.

Read the rest of this article...

Easy Access to Facebook in Vietnam, Part Deux

Submitted by tomo on January 14, 2011 - 2:58pm

Here's an easier way to access Facebook again in Vietnam, as a follow-up to my earlier post Bypass Vietnam's Block on FaceBook - or China's Block on YouTube.

Just change your DNS settings to use 65.111.171.175 as your DNS server like before. I've set up a DNS server which returns different IP addresses for facebook (facebook.com and fbcdn.net). You can also do this on your computer by setting entries for all subdomains of facebook.com to 153.16.15.71 and for fbcdn.net to 60.254.175.11.

For detailed instructions on changing your computer's DNS settings refer to http://code.google.com/speed/public-dns/docs/using.html but remember to use the address 65.111.171.175 instead of Google's 8.8.8.8 and 8.8.8.4.

Read the rest of this article...

Sorting broken after upgrading Pligg

Submitted by tomo on January 6, 2011 - 7:36am

If, after upgrading from an old version of Pligg to 1.1.2, you notice that the front page is sorted completely backwards and you can't change the sorting even by fiddling with the sort-query code in index.php, it may be because of the new Groups feature. A new groups table has been added and all queries join this table but the Pligg upgrader only creates the table and sets the new link_group_id to 0 for all rows in links. The solution is to populate the groups table. An easy way is to head to groups/submit/ and create a generic catchall group. Then in your database, change the group_id for the newly created row in groups to 0 (if it's 1).

If the Pligg group submitter is broken (as Pligg is prone to be buggy) then just:
INSERT INTO groups (group_id) VALUES (1);

Now those queries like:

SELECT link_id FROM links LEFT JOIN groups ON links.link_group_id = groups.group_id WHERE link_status='published' AND (groups.group_privacy!='private' OR ISNULL(groups.group_privacy) OR groups.group_id IN(1)) GROUP BY link_id ORDER BY link_published_date DESC, link_date DESC LIMIT 0,10

will work again!

LifeHack: Abuse Tinyurl for Any Info

Submitted by tomo on January 5, 2011 - 9:08pm

Here's a trick for storing and compressing information in a pinch.

Let's say you have an address or a set of directions or maybe a shopping list.

Example: "Calle de la Magdalena N8, 5D Floor, Madrid, Spain 28012"

Stick it into http://bit.ly but prepend "http://" to the text, to make it look like a URL: "http://Calle de la Magdalena N8, 5D Floor, Madrid, Spain 28012 "

When we go to the resulting shortened URL http://bit.ly/dL9MXS we get an error, but Chrome displays back:
"Oops! Google Chrome could not find calle de la magdalena n8, 5d floor, madrid, spain 28012" and voila! we have the text we wanted.

All we have to write on our hands, remember, or pass around via text message is the string "dL9MXS". It takes less work than using a pastebin and the resulting URL is shorter anyways.

Any other practical uses for this trick? Leave a comment!

For some time now, ISPs in Vietnam have been blocking a small number of websites, particularly Facebook. Fortunately, the number of blocked sites was really small (in China hundreds of sites are blocked) and the method of blocking traffic to Facebook was very weak. The Vietnamese ISPs simply stopped returning DNS queries for the Facebook domain. So everyone soon figured out they could simply change their computer's DNS settings to use a non-blocking DNS server, such as Google's (8.8.8.8).

I'm hearing rumors now, while I'm traveling in Europe, that Vietnamese ISPs have really cracked down on access to Facebook and that the DNS trick no longer works.

So here are some more foolproof ways to get around the Facebook block in Vietnam which will also work for any website that is blocked in any country. For example, the Great Firewall of China blocks access to an ever-changing list of sites by more than just DNS. But these methods should work there too.

An added advantage is that you may also be able to access US sites that block all non-US computers like Hulu and certain YouTube videos.

1. Pay for VPN access outside of Vietnam. This is essentially what I do by renting a server in the US, but I only tunnel my web traffic over an ssh connection. If anyone wants a shell on my server for tunneling purposes (and not downloading porn) contact me.

Setting up SSH is a bit quirky so most people are better off with a true VPN solution.

One that comes recommended is StrongVPN. By going with them you'll get full support and they show you how to set it all up.

2. Install free but ad-supported Hotspot Shield

From their site:

Secure your web session, data, online shopping, and personal information online with HTTPS encryption.
Protect yourself from identity theft online.
Hide your IP address for your privacy online.
Access all content privately without censorship; bypass firewalls.
Protect yourself from snoopers at Wi-Fi hotspots, hotels, airports, corporate offices.

You may want to install ad blockers if you go this route. They will also track information about you to sell to advertisers.

3. Proxy servers.

Pick a proxy server from http://www.xroxy.com/ and set your browser to use it without needing to buy or install anything. You don't need to use a proxy server in Vietnam, in fact it's probably better not to.

In a pinch you can browse through a "CGI proxy" like http://12345proxy.com/ without having to set up anything.

Using a proxy server could slow down access to some websites, especially ones in Vietnam. You can install some browser add-ons so that you only go through a proxy for the sites that are blocked, like Facebook.

For Google Chrome:
Proxy Switchy: https://chrome.google.com/extensions/detail/caehdcpeofiiigpdhbabniblemipncjj

For FireFox:
FoxyProxy: https://addons.mozilla.org/en-US/firefox/addon/2464/

4. Just for watching videos on sites like Hulu, Amazon Video on Demand, Pandora, or YouTube, you can try http://www.usvideo.ca/ although it costs $5.25/month.

Drupal Administration Menu Missing Links

Submitted by tomo on December 7, 2010 - 5:30pm

Working on a Drupal site that's already half-way started, I noticed that after installing the admin_menu module many links I expected were missing, such as the refresh cache links and several content types under the Content Types menu.

First, I tried clearing out all caches manually via the Performance page.

Next, I tried truncating all cache tables in case cache_menu or another table was corrupted.

Still no go, so I tried disabling, uninstalling, and reinstalling the admin_menu module which should rebuild the admin_menu links in the menu router.

In the end it turned out to be a Wampserver problem as it (as well as Xampp) use PHP 5.3, which Drupal has a lot of problems with. PHP 5.3 has a change from earlier versions in that function declarations like:

function admin_menu_admin_menu(&$deleted)

no longer work. Normally, you'd see that in your error messages.

The solution is to remove the & before $deleted on line 107 in admin_menu.inc in the admin_menu module. This will also make the related PHP warnings go away.

Running 5.2 and 5.3 on one computer using XAMPP (on OSX) is easy by following these instructions: https://gist.github.com/1012774

Simple Way to Download YouTube HTML5 Videos

Submitted by tomo on November 24, 2010 - 3:52am

A lot of the existing YouTube video download scripts don't work today as YouTube have changed their "API" so those hacks no longer work. Programs that simple detect whatever media files get downloaded should still work.

Here's a dead simple way to download HTML5 videos from YouTube. Drag the following link to your bookmark bar. In Chrome, you have to set "Always show bookmark bar" for this to make sense.

Tubelet

Read the rest of this article...
Syndicate content
© 2010-2014 Saigonist.