Apr 212014
 

Several issues found after upgrade various version of Ubuntu to latest 14.04 LTS, luckily things are not that hard to fix.

ejabberd does not work, turned to be ejabberd was trying to get rid of asn1, and there were some problem caused by that. Though ejabberd fixed the problem right away, it seems Ubuntu took the wrong version. What you should do is upgrade ejabberd from 2.1.11 to 2.1.12 (later version may work as well, but I didn’t try), Continue reading »

Aug 022013
 

I think I’m going to play with Perl, PHP, and Python at almost the same time for some time, and thinking of the fact that dynamic graph is one of the most important feature for web pages, I think I need to find a cross-language solution.

I’m happy with PHPlot and decide not to touch GD::Graph, and I came across GDChart which seems to be good in cross-platform/cross-language area. I will give it a try and will post the result here.

Jul 192013
 

I was assigned to a Web project which is to present data analysis result to users. Original data came from Web log, plus some extra information, then headed to Hive, then populated statistics files after scientist’s analysis┬áThere are several interesting topics: geo graph, rendering another web page, and metrics graph, roughly speaking, I have no idea of any of these at the beginning of the project.

I think the best decision I made is to use GD based solution, actually that could be the only solution I can think about, I decided to use PHP for Web, plus Perl for batch processing, this actually seems not to be quite right as I’m migrating everything to PHP now as there is not much “real” batch processing, and everything could be done in shell. Also I decided to use server-side DOM model (read: PHP DOM) so not to slow down the project by my poor JS skills, actually my PHP skill is not that good but JS is definitely *poor*. Continue reading »

Jul 182013
 

PHPlot looks better than Perl’s GD::Graph … I don’t know how to exactly describe the difference, but feel like: neat, easy to understand, easy to control, and better default values.

I’m migrating some BI sites to PHPlot so to get rid of Perl stuffs, so to make things purely PHP based, thus other PHP guys can take over it easily.

Jan 252013
 

I was asked to find a solution to write customized Apache log entry (in Apache access log, not error log), other requirements include easy to use, which implicitly means “PHP friendly”, and flexible, which means “free format” and “may or may not have the value”.

Seriously, the first thing jumped into my mind was an Apache module (let’s hack mod_log!) or a PHP extension, but later on I found that … I don’t want to maintain another orphan project especially it will be orphan since nobody want to touch it after it’s up and running (I have one already, which does some cookie stuffs). So I move on to Google …

Then I found apache_note(), plus mod_log_config (search for %{Foobar}n), all that I need to do is tell PHP guys to call this function, and tell ops guys to setup Apache log properly, we are all set.

It’s good to see apache_note can change the note as many times as you want, whenever the request is finished on server side, the final data will be written to log.

Sep 252012
 

Just found that last post was back to Aug 15, which was 40 days ago (or more), guess I need to post something.

There is not much to update though, good thing is that two guys pinged me the other day, asking why I’m no longer update my blog, also mentioned that it’s really impressive that I was working on so many different stuffs.

Another update is that I have $1.81 on my AdSense account now, if you believe my articles do help, please click ads on the page. My target is to get $10 AdSense income within a year, so please help me. Continue reading »

Aug 152012
 

Need to play with PHP extension for redis for a while, and after reading several articles on the web, I decided to with PHPRedis instead of Predis because of performance.

My goal is build up a webservice to proxy requests to backend redis servers, the web server is actually a proxy handling all routing related issues, so that clients don’t have to worry about hashing, sharding, etc. So I do prefer something pretty fast, though I don’t know how fast I need.

I dig out an article of how to build up PHPRedis extension, but need to get redis.ini from github to so that build won’t fail. However, if you are lazy you can just put “extension=redis.so” to redis.ini by yourself, anyway, all up to you. Determine name of tarball and directory in spec file is some sort of tricky, as it seems things changed every version. I was using nicolasff-phpredis-2.2.1-66-g89bdaf2.tar.gz and nicolasff-phpredis-89bdaf2, note that they are not identical though have some common parts.

I’ve deployed the extension to one of my test box, and will do some tests later on.

Oct 222011
 

I built a captcha for a friend a while back for a shopping site, obviously it was too simple to be corrupted so I built this new one last night. It was not perfect though, as I don’t have enough knowledge to create dynamic fonts.

Under Ubuntu it is easy to get things work – install php5-gd, luckily it brought couple of fonts and then the script works like a charm. Under my friend’s machine I need to install some extra packages to get TrueType fonts, but it is not that hard.

Let’s see how this works, I believe the captcha is a little bit hard to be read, but it can block spammers.

Nov 242009
 

“not fast” is better than “slow”, so I think I’m making progress, better than before.

Updates:

  • I moved to proxmox which gives me better VM performance so that I can have more VMs for my test, it did take me some time to dig out a usable solution. Now I’m running 4 VMs so I can test fail-over and bootstrap etc.
  • I moved to Python since PHP is not that popular now especially in all these new technology, I’m a code-by-sample guy, so while the whole world is writing codes in Java, Ruby, and Python, I don’t have many choices. I picked Python because I don’t want to run things like Tomcat, and built-in web servers does not convince me (I’m talking about Ruby).
  • I’ve done some simple tests but dealing with columns, etc., the test environment gives me reasonable performance number – 8ms per read/write.
  • I’m still learning Python and its web stuffs, seems not that hard to catch up though. I’m using web.py which seems to be the lightest framework, I may be wrong but I don’t want to dig in more at this moment.

To-do list:

  • I need to figure out if Ubuntu is still the way to go for my virtualization environment, I’m worrying proxmox is not a major player in this area so it may ruin my long term plan.
  • I need to find out if there is any other better HTTP server, “better” here means: light, support wsgi.
  • I’m going to compose some test scripts dealing with super column, which is what I need to use for the statistic project.
  • Revisit original design, both schema and work flow may have some changes.

I would like to say, everything is on the track, though I’m not that fast. I will post updates after this thanks giving as I doubt if I will have time coding during the holiday.

Nov 172009
 

Here is the deal – I decided to drop PHP and moving to Python, so that I can spend less time on dealing with less-supported PHP (in this nosql wave), I’ve removed PHP from all dev/test environments and wish I won’t come back later.

Actually I’ve made PHP works, but I’m just not feeling well as not many people are using PHP and it seems hard to seek help whenever needed. Also, seems setting up Python with Apache (through wsgi) is not that difficult. It could be a good chance to lear Python as well, though I did some PyS60 a while ago (for Jabber on E90).

BTW, I’ve upgraded all Fedora instances (3 of them) to Fedora 12, so far so good.