Skip to main content

Posts

Strange problem on KVM VPS

This one for the X-Files. I have been helping a client migrate his web server from one VPS to another because he needed more disk space. His previous VPS is based on Xen, and the migration is to a KVM-based VPS. Everything was smooth-going at first. I installed Debian 7 x64, all the usual packages: nginx, php, mariadb etc. Easy. Configured and tested the setup. Easy. Then I migrated his database and web server over and asked him to do some business-side testing. That was when we hit an unusual snag. His PayPal IPN wouldn't work. At first, I traced the logs, thinking it was some kind of PHP code incompatibility. Nothing. The code will break at this point:    $fp = fsockopen('ssl://www.paypal.com', 443, $eno, $estr, 30); and never return. I was stumped. So I wrote a simple test program that retrieves the HTTP and the HTTPS version of google.com . Lo and behold, the HTTPS fetch breaks right at that point with:     Illegal instruction I looked up w...

Bluetooth headsets: Samsung HM1700 vs Plantonics M25

I had been using a Samsung HM1700 headset for over a year now. Recently, the Plantonics M25 was on sale. It looks a lot smaller, lighter and sleeker than the Samsung HM1700, it supports A2DP, it has long battery life, so I bought one to have a try. The thing about Bluetooth headset is that you can never tell how well it works for you from the specs. You have to live with it for a week or two before you can tell if the two of you are compatible, sorta like a roommate or girlfriend. So I lived with the M25 for a week. Samsung HM1700 Pros: Long battery life Great reception Cons: Bigger and heavier Ear loop is not as comfortable Plantonics M25 Pros: Long battery life Sleeker, smaller and lighter Ear loop is fitting and comfortable Cons: Too many A2DP dropouts for my liking. By that, I mean the A2DP stream will drop out for a second or two being picking up again. This happens when I turn or bend my body, pick up a tool etc. It happens with the HM1700 too, but muc...

Bitcoin - Figures on transaction cost

Here are some figures on transaction costs in cross-border transactions. Currently the de-facto reference currency in cross-border transactions is the USD. A recent purchase of USD186 using the credit card resulted in the following line items in AUD: AUD (from USD) - $202.00 Currency conversion assessment fee: $0.40 International transaction fee: $3.00 Cross border assessment fee: $1.60 Ignoring the spread used in the currency conversion, the transaction cost is about 2.5%. The actual transaction cost taking the spread into account is probably about 3+% A recent purchase of USD700 using PayPal incurred a fee of $23 (buyer or seller pays). The transaction cost is a whooping 3.3%. I happened to have some USD in my account, so I didn't need to perform currency conversion. PayPal's spread in forex rate is notoriously poor compared to other avenues. A purchase of 1.45BTC (approximately USD1085 at that time) incurred a transaction fee of 0.0002BTC, which is negligible....

Bitcoin - Micropayment system for the Internet?

I have been dabbling with crypto-currencies, specifically Bitcoin and Litecoin, over the past 12 months. Everything from mining to e-commerce to currency exchange. I think I "get" the magic of the whole idea now. For better or for worse, crypto-currencies drastically reduces the friction of money flow. You probably won't be able to find another means of moving money at a lower transaction cost, especially when small amounts are involved. In addition, the speed of transfer is excellent for a distributed system. With Bitcoin, it takes a few minutes. With Litecoin, it takes a couple of seconds. The low transaction fee and fast transfer speed respect no geographical boundaries. It applies whether you are moving money within the same country, or between two countries on opposite ends of the Earth. Which probably freaked more than a few legislators out . Plus this is a distributed system with no central authority to slow things down or screw things up. PayPal is fast, but...

110GB+ worth of photos/videos on a microSD memory card #2

In my previous post, I talked about wanting to write a script to see how far I can squeeze 110GB worth of media (photos and videos). I wrote the script the quick-and-dirty way, in PHP. When people think of PHP, they think of web pages, but PHP can equally be used for writing your everyday scripts, just like Perl or Python. The script resizes all photos to a maximum width/height of 1024. I found this provides maximum size reduction for the photos without sacrificing the viewing quality in full photo mode on my tablet (screen resolution: 1280x800). Obviously it will affect the quality when zooming in, but I rarely do that when flipping through the photos. Since I haven't got a tablet with retina display yet, I am not sure how that will fare, but for this exercise, I am sacrificing quality for size. For videos, I use handbrake-cli to transcode all of them to MP4 with a maximum width of 640. Again, this reduces the size drastically, improves compatibility (since all Android tabl...

110GB+ worth of photos/videos on a microSD memory card #1

We have a family NAS where we keep all kinds of stuff. Well, actually it's an old laptop that functions as a server, with 3 x 3TB external USB HDDs attached. I run all the standard mirroring and backup on the laptop, and one of the HDD is shared over the network for everyone to dump their stuff into. Like most family these days, we take photos and videos on a number of different devices. The smart phones, digital camera, DSLR etc. Even the kids have their own cheap digital compacts. And the devices have evolved over the years. The photos have mostly stayed JPEG, with the resolution increasing steadily. The videos, however, are a different story. Starting from the V8 (which we converted to XVID AVIs) to a Sony (which produced MPEG-1 files) to a Casio (which gave us H264/MOV files) to the current-gen Sony (MTS format), there's an incredible number of video formats we have to deal with. On top of that, we do scans of old photos and slides, the kids' artwork etc. These are al...

Fast Diet - Hunger Pangs

When I am doing the Fast Diet , I frequently experience long periods of calm after a brief period of hunger pangs. It is as if the body has gone into hibernation, and I am left well alone to carry on with my daily routine. This is most apparent the morning after the diet day, when I could usually skip breakfast and have a late lunch. I am reminded of what my diving instructor told me during training many years ago, that feelings of suffocation after a brief period under water is not due to lack of oxygen, but due to the buildup of carbon dioxide in the blood stream. This means you are not going to die (yet), and with knowledge you should  try to suppress the panic, remain calm and find a way out of the current situation to surface. Hunger is mostly the same thing. It makes us uncomfortable and compels us to eat to rid ourselves of the discomfort. Worse, we have come to associate a lot of other feelings (both positive and negative) with eating. So we eat to make ourselves feel b...