Apr 302012
 

I just removed a primary backup from Amazon S3 after putting it into GMail, I just wish GMail will be secure enough – whenever I’m saying secure, I mean mails won’t be deleted without being notified in advance, either purposely or not.

I still have backups on other places but none of them are primary, that is, they can be deleted without any reason, and without carefully being watched.

Apr 272012
 

Migrating various hosts to 12.04, result is half-half – EC2 hosts got upgraded without any problem, I think I’m really lucky in this case as those EC2 hosts are serving live traffic, the VM and bridge host at home failed to reboot after upgrade, it seems the problem was because of boot disk/partition got rename/re-numbered, but I’m not quite sure.

I’ve re-installed VM, weird thing is that there was some free space on the harddisk so I can leave original partition untouched, after installation’s done, I found that I installed to /dev/sda6, while /dev/sda1 still has a bootable Ubuntu 12.04 which I just upgraded. I didn’t pay much attention on what I have done as I was thinking I’m gonna lose everything. I’m working on the bridge host now and will post details here if I find anything.

Apr 202012
 

I’ve been spending time on various projects in the past several weeks and “context switch” took me way too much time than I was expecting.

So I decided to get things a little bit more sorted, say, consolidate technical platforms to some level so that I can share knowledge among all projects so to reduce the time spending on thinking and searching for solutions.

I’m going to stick on C/C++ for components development and PHP for web site, and use HBase as my backend storage solution. I still need to spend time on mobile platforms (yes, there is a “s” there since I need to cover Windows Phone, Android, and iOS), plus desktop include MacOS and Windows. So overall I will be working on C++/PHP over Linux, Object C on MacOS/iOS, and C# on Windows Phone/Windows. The last unsettled issue is I still have some applications written in Visual C++ (pure native code) and I’m not sure if I should migrate them, but so far just leave it there as I don’t have time dealing with Windows desktop yet.

Apr 182012
 

Here’s the whole command, with IP address masked:


ssh -A -t 111.111.111.111 "LD_PRELOAD= ssh -A -p 58422 222.222.222.222 -t \"SSH_AUTH_SOCK=\\\$(find /tmp -user xiehang -a -type s 2>/dev/null | xargs ls -tr | tail -1) ssh -p 58422 -l root $@\""

where 111.111.111.111 is jump host in office, and 222.222.222.222 is jump host in the IDC.

Tricks here: jump host in office is running tsocks, so I have to reset LD_PRELOAD to disable it, and jump host in IDC set default shell to eash (for audit) so I have to setup the ssh agent manually.

It took me 20 minutes to figure out all quotes and backslashes ๐Ÿ™ .

Apr 182012
 

I installed tsocks on OSX through macport and it kept reporting “Segmentation fault: 11” for whatever command I issue, later on turned out I need to put “tordns_enable = false” in tsocks.conf to solve the problem.

Don’t know why, and I told myself – don’t dig into things that don’t matter your core business, hehe.

Apr 172012
 

I’m talking about performance here, same program, same compiler options, gcc on CentOS6 generate much better executable than gcc on CentOS5, the gap is 10~15%.

I think gcc makes the most difference, as changing glibc etc. does not make too many difference. It seems gcc did pretty good job from 4.1 to 4.4, I will dig into details whenever I have time.

Apr 172012
 

I’m a strong supporter to STL since ideally you can get rid of new/delete and malloc/free so not worry about memory leakage, sure you still need to think about resource leak but that’s much easier to debug to me.

However, I’m stuck in performance issue not with STL, I know STL does a lot of copy operation but I never imagine the performance is this bad, I think the main reason is that I use too many std::string and that kind of copy takes time, but what else can I do, move to char *? That will get back to new/delete again.

I’m running oprofile now to see if there is anything else to me optimized – the goal is 400K bytes/second, and I’m at 310K, while old pointer-rich implementation was no less than 500K. If there is nothing to to tuned I will just drop this branch and keep previous ugly but efficient codes.