Category Archives: Tech

Fixing the ruby ‘CoreFoundation/CFString.h’ file not found install error

I hit this error installing the latest Ruby using rbenv:

$ rbenv install 2.6.3
ruby-build: use openssl from homebrew
Downloading ruby-2.6.3.tar.bz2...
-> https://cache.ruby-lang.org/pub/ruby/2.6/ruby-2.6.3.tar.bz2
Installing ruby-2.6.3...
ruby-build: use readline from homebrew

BUILD FAILED (OS X 10.14.4 using ruby-build 20190423)

Inspect or clean up the working tree at /var/folders/r7/kjzbwmx533b20hcf1_s9kc9c0000gn/T/ruby-build.20190501131413.33977
Results logged to /var/folders/r7/kjzbwmx533b20hcf1_s9kc9c0000gn/T/ruby-build.20190501131413.33977.log

Last 10 log lines:
compiling error.c
compiling eval.c
compiling file.c
compiling gc.c
file.c:23:10: fatal error: 'CoreFoundation/CFString.h' file not found
#include
^~~~~~~~~~~~~~~~~~~~~~~~~~~
1 error generated.
make: *** [file.o] Error 1
make: *** Waiting for unfinished jobs....

The problem is missing headers. To re-install just run this command:

open /Library/Developer/CommandLineTools/Packages/macOS_SDK_headers_for_macOS_10.14.pkg

Now, Ruby should install just fine:

$ rbenv install 2.6.3
ruby-build: use openssl from homebrew
Downloading ruby-2.6.3.tar.bz2…
-> https://cache.ruby-lang.org/pub/ruby/2.6/ruby-2.6.3.tar.bz2
Installing ruby-2.6.3…
ruby-build: use readline from homebrew
Installed ruby-2.6.3 to /Users/will/.rbenv/versions/2.6.3

Fixing errors installing the charlock_holmes ruby gem

This gem can be a PITA to install on a mac, this is what worked for me. If you get this error:

First, make sure you have installed the required dependencies:

brew install xz icu4c

Now, install charlock_holmes:

gem install charlock_holmes -v=0.7.6 -- --with-opt-dir=/usr/local/opt --with-opt-include=/usr/local/opt/icu4c/include --with-opt-lib=/usr/local/opt/icu4c/lib --with-cxxflags=-std=c++11

Secret project

Tiny motor

One of my new motors. It’s about 10mm in diameter

I’ve started work on a top-secret project. I can’t really hide the fact that it’s going to be a robot, but I’m not going to say what it is, at least not just yet.

So, last night I was designing a 3d printed mount for the tiny 3-6V motors I bought and I started to wonder if I could cobble something together using my old technic lego. I dug out the lego, but on top of that was my dusty old meccano set, even better!

WIthin a short amount of time I had some motor mounts and a frame made, including tensioning springs for the caterpillar tracks. All that was left was to take it for a spin. I hooked it up to my Raspberry Pi via my Custard Pi breakout board, a ULN2803A and a custom voltage regulator circuit.

Meccano wheel mount

Motor mount

Seeing if it drives in a straight line:

Hooked up to the Raspberry Pi, controlled by microswitches. You can see the top of the Custard Pi poking out over the mess of wires that is my breadboard and the cheap wireless dongle/antenna I got from eBay. The voltage regulator circuit makes an appearance being dragged along behind:

MotorPiTX

MotorPiTX kit

Right now it only goes forwards because I didn’t have the circuitry for anything else, but I got my MotorPiTX in the mail this morning so that will change soon.

Tagged ,

Adding a SATA II SSD to an old Macbook & Creating a Snow Leopard bootable USB drive

The hard-disk in my sisters Macbook laptop finally emitted it’s last death rattle and shuffled off to silicon heaven so I found myself needing to install Snow Leopard (it’s too old for Lion) on a new disk drive. This was complicated by two factors.

  1. The Macbook is old, it only has a SATA (not SATA II) disk controller.
  2. The DVD drive had also died a long time ago.

I had read that SATA II disks sometimes worked on SATA controllers, but also a number of reports that the Macbook didn’t recognise some SATA II disks. I took a risk and bought an OCZ Vertex 2 60GB SSD from Amazon. So far the Macbook has recognised it. This was the easy bit.

Next I needed to install Snow Leopard. This was going to be harder (I thought) because the DVD drive in the machine was broken. I checked a bunch of tutorials on the Internet on how to create a Snow Leopard install USB drive but most assumed the USB drive would be created on Snow Leopard itself (I’m using Lion) and included a fairly large number of steps.

I gave up on these guides and decided to do it freestyle and it turned out to be incredibly simple. Here’s how in-case someone ever needs to do this in the future.

  1. First, I inserted my Snow Leopard DVD into my Mac and the USB drive into a USB port.
  2. Next I formatted the USB key as Mac OS Extended (Journaled) using Disk Utility ensuring it had a Master Boot Record.
  3. Finally I restored the Snow Leopard DVD to the USB key again using Disk Utility.

That was it. I tried it out on my sisters Macbook and it booted from it just fine and is now installing Snow Leopard on the OCZ SSD.

Introducing sendcat.com

I send files to people, you send files to people. People who have computers need to send files, it’s something we have needed to do since computers were first invented. It could be easier.

Sending files is laborious. You have to open an email, address it, click ‘attach’, choose the file, put something in the subject line, put something in the body and send it. Hassle. I’m tired of doing this.

Sendcat logo

That’s why I created sendcat.com. It’s a web service that makes it *really* simple to send files. There are services out there that promise two-step sending, I’m aiming for one-step file sending.

I want to make it simple to send files, but most developers are heavy terminal users. I’m planning on providing a CLI (Command Line Interface) client as a first-class interface to the Sendcat service.

Join the beta team, get a discount

If you’re interested in the beta head over to sendcat.com and put in your email address, I’ll let you know when it’s in beta and you can sign up. I’ll make sure there is some sort of discount for people who want to keep using the service when the beta period is up, sign up to make sure you’re eligible.

Alpha

Right now Sendcat is in alpha. I’m looking for people to use the service (for free) while I work on features and bug fixes. It works though, I’m using it to send files to people daily.

If you want to try out the service for free email me. You will need a Mac OS X or Linux machine, RubyGems installed and a knowledge of the command line. The GUI client is coming soon.

Happy sharing!

Tagged ,

Really Small Monitor

I recently got an iPad to ease my imminent travels, the (alleged) 10 hours of video and the ability to store a load of books will make the long plane journeys and layovers much more tolerable. The other big benefit is that when I get to where I am going I will be able to use it as a second monitor for my laptop.

Caius had previously suggested AirDisplay, an app that as it’s name suggests lets you use it as a wireless display for your computer (Mac and Windows) as long as they are both on the same wireless network. I bought it almost as soon as I got my iPad and tried it out in a coffee-shop. Throughout the day I used it for terminals and my Limechat IRC client and it worked well, staying connected almost continuously. The display updates fast enough for those simple uses, but stutters on web-page scrolling (though it’s still usable) and would be useless for video. Here’s a picture of it with a Textmate window dragged onto it:

AirDisplay is definitely worth a go if you travel with a laptop and like to have a second monitor. It seems to be a bit fussy with wireless networks though, I had no problems with a mifi wireless network and my 802.11n home network, but it wasn’t happy with my dad’s wireless network, it took ages to get it to connect and it got disconnected a fair few times. It also works on an iPhone if you’re really desperate:

Tagged ,

Call of Duty: World at War isn’t worth £29.99

Don’t get me wrong, it was a really good game. It was beautifully done with really well thought out levels and an excellent story.

It was just rather short.

I was kind of hoping for it to be about twice as long. It cost more than renting a film for the same amount of gameplay time. What happened to games taking 40 hours to complete? *mutter* *grumble* it were all fields etc. It was the only thing that let down an otherwise excellent game, and a fairer price would have been £15 to £20 in my opinion, especially considering the tiny distribution cost as I downloaded the game using Steam.

Maybe I’ll buy it off eBay next time.

Tagged

Protecting yourself against the WordPress login page exploit

Anyone that runs a wordpress blog will hopefully be aware of the recent exploit against the login page:

“You can abuse the password reset function, and bypass the first step and
then reset the admin password…”

and

“An attacker could exploit this vulnerability to compromise the admin
account of any wordpress/wordpress-mu <= 2.8.3”

There’s no fix in any released version yet but you can protect yourself with a bit of Apache config until one is released. Just add this to your wordpress virtualhost replacing “you.re.ip.add” with the IP address you want to access the login page from:

<Location /wp-login.php>
Order deny,allow
Deny from all
Allow from you.re.ip.add
</Location>

This will present any user not accessing your login page form that IP with a 403 Forbidden error. If you want to block all IPs until a fix comes out just miss out the Allow line:

<Location /wp-login.php>
Order deny,allow
Deny from all
</Location>

Tagged , ,

NWRUG Code Surgery and an introduction to Zsh – Tonight

the June NWRUG is tonight. There will be a code surgery and introduction to Zsh. Plus free pizza!

Email me or leave a comment to sign up.

NWRUG February 2009 – Nanite talk

For the first time in quite a while we had a talk at NWRUG, it seemed to go well and the free Pizzas and Beer provided by Engine Yard were very popular. About 12 people turned up. I was the only speaker and did a 45 minute talk on Nanite with a brief introduction to cloud-computing as that’s the environment I see Nanite being most useful.

Thanks to everyone who turned up and Engine Yard for the sponsorship. I promised a blog post with links to some of the resources from the talk, and here it is!

Useful links from the talk

Nanite (of course)

Kestrel (a starling replacement)

Delayed Job

Warren (A wrapper around AMQP from brightbox)

Engine Yard Solo

As I mentioned in the talk you can probably get away with using third-party APIs and calling it ‘cloud-computing’, this set of slides is really interesting:

Web Hooks and the Programmable World of Tomorrow

Lastly the slides on SlideShare, though they don’t make as much sense as they do with the talk & my notes.

*update*

Pastie: control rabbitMQ using Nanite, controlling god using Nanite.

Next Month

More talks! Asa Calow has agreed to do a talk on Solr and I rather foolishley agreed to do another talk on Sphinx.

Tagged , , , , ,