Bulk upload for Music Magpie and Ziffit

I’ve got a stack of CDs, but it occurred to me that I no longer even have a CD player. I decided to move them on using Music Magpie or one of those we-buy-your-old-stuff services. I didn’t expect to make a pile of cash out of it, but wanted to clear the space, dematerialise a bit, and didn’t want to just throw perfectly good CDs away.


I used barcode2file on my android phone to zap all the barcodes. About 300 items, including a few DVDs.

I looked at:

  • Music Magpie (http://www.musicmagpie.co.uk)
  • Ziffit (http://www.ziffit.com)
  • We Buy Books (http://webuybooks.co.uk)

And wanted to compare the prices I’d get from each. Of those, only We Buy Books has a bulk upload option that can take 50 item codes at a time. Even with hundreds of items, that’s easy enough to do manually.

Music Magpie and Ziffit only have a slow one-by-one interface that you wouldn’t ever want to use twice, so I recorded a little selenium script in the Selenium IDE (Firefox), and embellished the Python that came out with the ability to loop through my list of barcodes and record the results.


The code I used is in this gist: https://gist.github.com/euphy/d413e754a69c964661b7

The scripts are probably pretty fragile, and is “just enough” to work. It’s slow too. Successful submissions are written into a tab-separated file.

  1. Upload the entire barcodes list into each service
  2. Tabulate the results in a spreadsheet to give the highest price for each item, and which service will pay it
  3. For each service, produce a list of it’s “winning” items
  4. Upload the sublist into the service, saving the results
  5. Manually, log into each service and complete the trade


We Buy Books give the best prices on average, per item, but also rejected the most items. We Buy Books also gave the widest range of prices; for the items that they did not win, their price was often very low (2p vs 20p from other services for a particular item).

Service Total value Items accepted Average value Bids won Winning bids value Highest bidder
webuybooks £151.00 200 £0.75 74 £73.04 27%
music magpie £184.34 270 £0.68 138 £108.23 49%
ziffit £134.73 246 £0.55 67 £37.22 24%
combined £218.74 £0.66

Comparable items that received bids from all three services:

Where all three services offered bids (178 fairly comparable items), the prices are much higher, which might indicate an element of competition, but given that these things are so hard to compare, I’m not sure this is a factor.

Service Total value Items accepted Average value Bids won Winning bids value Highest bidder
webuybooks £66.97 62 £1.08 62 £66.97 35%
music magpie £71.28 79 £0.90 79 £71.28 44%
ziffit £31.40 37 £0.85 37 £31.40 21%

Average prices are higher. Music Magpie was still the highest bidder most often, but the margin between We Buy Books and Music Magpie has narrowed quite a bit.


Pretty inconclusive. I can’t see a particular pattern that would make me say “Use service xyz always”. If I had less time to do these, and then sort through all the items a second time putting them into different boxes, I’d go with Music Magpie, because although they don’t always give the best prices, they accept a wider selection of items.

With time, a combination approach is most thrifty, and that’s what I did, and it resulted in about 16% extra cash.

What I didn’t do was any kind of breakdown of the types of items: DVDs, CDs, genres etc.

300 items x £10 original price = £3,000.

(Incidentally, £3000 / 20 years of buying media = £150 per year, and I’m paying £95.88 per year to google to host my records now. I suppose the difference is that I have no piles of plastic to show for my money any more. That makes me a bit sad, but also a bit happy.)

Sold for £218.74. That’s about a 7% return of cash value. Over a couple of weekends, it took me about four or five hours to scan, process and box the items. 5 hours x £20 per hour wage = £100 wage for that time, and £118.74 money back.

Well, at least they aren’t just going in landfill.


Delete a bunch of mongo databases at once

I know this is knucklehead stuff, but I never trust myself to do it without 10 minutes of practice beforehand:

var dbs = db.getMongo().getDBNames()
var prefix_to_drop = 'testdb_';

for (var i in dbs) {
  db = db.getMongo().getDB(dbs[i]);
  if (db._name.lastIndexOf(prefix_to_drop,0) === 0) {
  print("Dropping " + db._name);

I use this when I’ve been breaking tests, and the database cleanup is getting skipped. And I end up with 150 test databases lying around.

Calibrating e-steps

Every time I have to do this, I forget what to do, and have a frustrating time. Because it’s simple.

G91 – Sets the printer into relative mode. This is so that issuing:

G1 E10 – actually moves 10mm. I do this twice in row for each measurement. The first one compensates for the inaccuracy of the previous measurement.

I could issue a G92 to zero everything instead of doing the G1 twice, but I don’t.

Then M92 E800 to set esteps per mm to 800. Mark on the filament 10mm on the ruler, then send G1 E10, and see how far the mark is from the 0mm mark on the ruler. Once it’s as accurate as can be at 10mm, do a couple at 50mm or 100mm to check the accuracy better.

I just got a new extruder.


  • Mini extruder with NEMA14, E3D hotend: e-steps per mm: 700
  • Bulldog Lite with bowden, E3D hotend: e-steps per mm: 114


New 3D printer

I’m building up a new 3D printer, a Mendel Prusa i3.  I ordered a mechanical pack from Greg Colbourn on the eMaker site that included all of the hardware, rods, nuts and bolts, bearings, motors and a set of flat parts in 6mm plywood.  I got a RAMPS electronics pack from the now-ubiquitous reprapdiscount, and was impressed by it.  It included hall-effect endstops and a neat LCD display, and a MK2A PCB heatbed.  I also got a 30A, 12V power supply.

I sanded down the plywood and finished it with some oil (and very handsome it is too) and printed off a set of Prusa i3 parts on my little eMaker Huxley in some nice silver ABS.  I think perhaps the Huxley has detected that it is fabricating the parts for its replacement, and is acting up a bit so a couple of the parts are a bit curled, but fortunately the design of the i3 parts is such that the squareness or flatness does not rely on a good bond to the bed.  Good work.

The mechanical parts went together with a minimum of fettling but I had to print some holders for the LM8UU bearings on the y axis.  These are designed to be simply zip-tied into some slots on the y-carriage, but I found that y-carriage itself collides with the y-axis motor at the far end of it’s travel.  Not by much, but a little, and enough to raise the bed a touch, so I modified the Y bearing holders from the i3-mini variant of the machine and that raises it a mm or so.  Bit of a pain because the hole spacing is so tight, but it works.

I like the three-point heatbed fixing / suspension system on my eMaker Huxley, so I went for the same thing on  this machine.  RepRapPro sell parts separately, so I got the aluminium heat spreader and the MDF insulator from them, along with the spring mounting hardware to go with it.  Of course, this system doesn’t use the four outer corner bolts like the i3 is set up, so I printed some extra pieces that bolt onto the y-carriage.  I lose some z build height, but it’ll do until I get an adapted y-carriage cut.

One of the most troublesome points of failure in my eMaker machine is the termination of the power electronics.  The Sanguinololu board isn’t great for the heatbed because the traces are pretty slim and I think the power handling is close to its rated limits.  That, together with _just slightly too little wire_ for the moving parts has meant that the cable to the heat bed has burnt out a couple of times.  I was determined to make a better job of the wiring this time around to avoid the froth of cabling that surrounds the Huxley.

To this end, I finally got some bootlace ferrules and made up a high-power wiring loom with with ferrules on one end (for screwing into the screw terminals on the RAMPS board), and fork or ring terminals crimped on the other end.  The fork terminals go into the screw-down terminals on the power supply, and the ring terminals are bolted into holes on the PCB heatbed.  I had to drill the holes out a little for that, but there is plenty of contact between the washers on the bolts and the traces on the bed, so it’ll be ok, and it has the benefit of being completely solder-free, and everything is disassembleable and replaceable.  This will make it less brittle, and more reliable.  I don’t know why more people don’t do this.  Soldering trailing wires onto moving PCBs is a really bad idea but this seems to be accepted practice on repraps.

Hot end is a lovely E3D, all-metal device.  Haven’t used it in anger yet, but it builds easily, heats up fast and squirts hot plastic out, and that’s what I look for in a hot end.  It came with a cartridge heater rather than a resistor.  I like it.

Finally is an extruder.  After being used to a bowden extruder on the Huxley, it seems weird to expect to fit a massive NEMA-17-toting extruder on the x-carriage itself, so I’m planning to eventually go with a bowden arrangement again.  It just seems more civilised.  However, E3D are out of stock of the bowden kit, so that’ll have to be a later development.  In the meantime, I’ve got the hardware for an MGS (metal gear system) extruder, and am printing up the RP parts for it right now.  The small gear on my old eMaker, Wade’s-style extruder has always worried me, and has always been deformed.  I just don’t like it, so I was pleased to see a metal system around.  I wonder if a direct-drive is better again, but I’m happy to wait to try that.



JMyron – unsatisfied link is now satisfied

I was putting JMyron on a new machine, to use in Processing on Windows 8, and kept getting this:

Exception in thread "Animation Thread" java.lang.UnsatisfiedLinkError: C:\Program Files\processing-1.0.4\libraries\JMyron\library\JMyron.dll: Can't find dependent libraries
     at java.lang.ClassLoader$NativeLibrary.load(Native Method)

Well, I used Process Monitor to see what was going on, and spotted a load of failed attempts to open MSVCP71.dll during sketch startup.  I tracked down a copy of that C library (msvcp71.dll and msvcr.dll), dropped them into my system32 dir and hay bingo, works.  Process monitor is ace.

I had already installed the C++ 2010 redist.  I guess JMyron needs some extra sugar.


Installing OS over PXE on machine without USB/optical drive

I got a little second-hand Dell D430 laptop to use for my upcoming polargraph show. I’m actually really impressed, it’s a dinky little thing.  No optical drive however, and installing an OS from a USB memory stick didn’t seem to work.  So I’ve done it over the network, and it even seems to work.

PXE (Pre execution environment) is the method, and this is a way of booting over LAN.  Hit F12 on the POST screen and then boot from NIC.  There needs to be a server on the network with TFTP running on it, to dish up the necessary files.  This is hard, but there is a nice little app called SERVA that handles the TFTP/DHCP stuff, because I don’t know how to.  Anyway, I followed the instructions on this site and windows 8 is winging it’s way onto my new old machine.


I initially tried putting the windows 8 disk in and symlinking to it instead of copying the files into the TFTP source folder.  That worked up to a point, but the installation failed.  I think it is because SERVA needs to add some files to the windows installation to customise it for this method, and obviously that can’t work if it’s read-only (on a CD).   So actually copy them over, or at least make sure they are somewhere that is writable.

CV on Raspberry Pi

OpenCV is a pain.  I guess I’m just being a dolt, but I can’t get it working.

I want to run a piece of software on my pi that will run my slow photo booth at the upcoming Edinburgh mini maker faire.

SimpleCV – http://www.raspberrypi.org/phpBB3/viewtopic.php?t=36348&p=305689

Issue with getting lots of VIDIOC_QUERYMENU: Invalid argument and then a bunch of “Select Timeout” messages:

from http://www.raspberrypi.org/phpBB3/viewtopic.php?f=37&t=11745:

You can not edit the binary uvcvideo.ko file directly. I advise not trying to compile it yourself. It’s not worth the struggle. You can try various options temporarily on the fly. Attach your webcam, the driver module should be loaded and shown by


. Then you unload the module using

rmmod uvcvideo

. Afterwards you can reload the module with something like

modprobe uvcvideo nodrop=1 timeout=5000

. Fiddle around with the settings.
You can make a set of parameters permanent by editing the file /etc/modprobe.d/modprobe.conf . For the above settings, simply add a line saying

[code]uvcvideo nodrop=1 timeout=5000[/code]



Accessing raspberry pi by name rather than by IP address

I’m using a virgin media superhub that does DHCP, but doesn’t have any kind of DNS stuff in it.  So I can ssh to my pi using it’s IP address, which is inconvenient because it makes me go and look the address up in the router.  For my application (the alarm clock), both devices (the pi and the kobo) need to be able to find each other, or at least the kobo needs to be able to find the pi to register itself.

I’m guessing there’s smarter ways of doing this, but until I am schooled, I’m working on these lines:



So the pi is samba-able now.  I guess samba uses netbios, and that’s the enabler for hostname resolution.

So now I can hit raspberrypi from my windows machine.  However, I suspect, I also need to netbiosify the kobo, and I guess that won’t be as easy.

Put Pronterface on pi.

Get VNC working: http://gettingstartedwithraspberrypi.tumblr.com/post/24142374137/setting-up-a-vnc-server

Install pronterface: http://entropyprojects.blogspot.co.uk/2012/07/reprap-printing-from-raspberry-pi.html

Instead of copying the files from github manually, install GIT with sudo apt-get install git then do git clone https://github.com/kliment/Printrun.git to get the files.  Skills.


Cheating on Windows 8

I really like Windows 8. I think it looks neat, and works well. And while the fullscreen/windowed duality often seems slightly embarrassing (control panel etc), I applaud Microsoft for being bold. And I love whizzing through the start page with my touchscreen laptop.

Trouble is, I’ve just realised that the start page is superfluous, and other than that, it’s entirely the same as Windows 7.

I missed jump lists from Windows 7 – these are the things in the start menu, where your applications have an arrow next to them, and that arrow expands to show recently used documents (for that application), as well as a particular pinned docs. I think these are really useful for documents that aren’t frequently used enough that they would stay top of my main “recent documents”, and because of not being frequently used, I can’t remember where they are, or which version I used last. An example is the designs for my Up To Much jewellery boxes. I don’t often print off a batch, but when I do I have to go into the main ring box folder and try and wade through the dozens of versions to remember which exact variation on the filename I used last. Not difficult, perhaps. But it’s easier to just choose it from a list without even opening the application.  Jump lists are a feature I didn’t even realise I wanted.

So anyway, to get jump lists on Windows 8, it is necessary to pin the application to the taskbar and then it pops up on a right-click. But I prefer to keep a pruned taskbar, particularly since I am now more used to using windows-key->start typing to launch apps and don’t need icons floating around everywhere. I really expected jump lists to be present on the start page, so a application tile would spawn some little tiles with it in.

So rambling on, I put StartIsBack on my machine, and instantly forgot I was even using Windows 8. It boots to the desktop, and gives me my jump lists. The start menu is a bit untidy, and not as beautiful as the start page. I haven’t even seen the start page for the last week. Which begs the question – why did I upgrade to Windows 8? And I don’t know either.