This evening I've mostly been using Sinatra to build a little file storage service which uses a REST API.
That means I can upload a file:
skx@birthday:~/hg/sinatra$ curl -X PUT -F file=@/etc/fstab http://localhost:4567/
Download that same file:
skx@birthday:~/hg/sinatra$ curl -X GET -F id=dbd1bdc11b5a1a8e80588a135648b4c2edffb49a \
# /etc/fstab: static file system information.
/dev/cdrom /media/cdrom0 udf,iso9660 user,noauto 0 0
Get an index of files:
skx@birthday:~/hg/sinatra$ curl http://localhost:4567/
And finally we can delete a file:
skx@birthday:~/hg/sinatra$ curl -X DELETE -F "id=dbd1bdc11b5a1a8e80588a135648b4c2edffb49a" \
We can also upload to different paths so we can replicate a
file-system if we wanted to. (I added in "type" to hold either "file"
or "directory", though I guess if we were to code up a FUSE client we'd
want to store things like ctime, UID, GID, etc. THe list operation will
show both files and sub-directories)
The code was trivial once I got the hang of Sinatra, and I'm pretty
pleased with it so far. I don't yet need to use it for anything, but
I'm thinking of unifying the way that I store images on a couple of
this was an experiment in that direction. (Though I'd probably want to
hook in rsync so we replicated the eventual upload location for safety.)
In other news I've been all organized and upgraded the kernel on my guest:
22:00:28 up 4:18, 1 user, load average: 0.14, 0.05, 0.05
steve@steve:~$ uname -r
So for once I'm up to date with a cutting edge kernel. Happy times.
ObQuote: "How you expect to run with the wolves come night when you spend all day sparring with the puppies? " - The Wire (Omar)
Tags: json, kvm, kvm-hosting, ruby
22 July 2012 21:50
Tonight I upgraded my personal machine to run the recently released 3.5[.0]
On my personal machine(s) I'm usually loathe to change a running
kernel, but this one was a good step forward because it allows me to
experiment with seccomp
I've tested the trivial
"no new privileges" pctl and I followed along with the
nice seccomp tutorial
On top of that I upgraded node.js,
which meant I had to clean up a little depreciated code in my node reverse
proxy - which is the public face of the websites I run upon my box.
(The proxy tunnels to about 10 different thttpd instances, each running
Happily however my weekend was not full of code, it was brightened by
the opportunity to take pictures of Aurora
and her long hair - more to come
as I've still got about 350 images to wade through..
ObQuote: "Don't you think I make a remarkable queen? " - St.
Tags: kernels, kvm, kvm-hosting, seccomp
5 May 2014 21:50
Yesterday I received an automated alert from my kvm-hosting host-machine, informing me that one of the drives in the RAID-pair had failed.
This particular machine has been up and running since 2009, and according to my outage log this is the first downtime in three years. (The uptime was over 1000 days, which seems to confirm that pretty nicely.)
I like reliable systems, and sometimes it's worth remembering just how well they can work.
In other news I'm currently continuing to chase a new job. The companies I've approached, or which have approached me, are being a little slow in replying which is a shame, but I'm not hugely concerned .. yet.
I'm going to give things another week, or so, and then add a banner to the Debian-Administration website, and see if that results in anything interesting.
In the meantime I've got some wood, and a new mitre saw, and I will be spending the remainder of today working on my new desk. Doing physical things is always fun, and right now especially.
Tags: jobs, kvm-hosting
10 September 2014 21:50
Seven years ago I wanted to move on from the small virtual machine I had to a larger one. Looking at the the options available it seemed the best approach was to rent a big host, and divide it up into virtual machines myself.
Renting a machine with 8Gb of RAM and 500Gb of disk-space, then dividing that into eights would give a decent spec and assuming that I found enough users to pay for the other slots/shares it would be economically viable too.
After a few weeks I took the plunge, advertised here, and found users.
I had six users:
- 1/8th for me.
- 1/8th left empty/idle for the host machine.
- 6/8th for other users.
There were some niggles, one user seemed to suffer from connectivity problems more than the others, but on the whole the experiment worked out well.
These days, thanks to BigV, Digital Ocean, and all the new-comers there is less need for this kind of thing so last December I announced that the service would cease - and gave all current users 1 year of free service to give them time to migrate away.
The service was due to terminate in December, but triggered by some upcoming downtime where our host would have been moved, in the back of a van, from Manchester to York, I've taken the decision to stop it early.
It was a fun experiment, it provided me with low cost hosting (subsidized by the other paying users), and provided some other people with hosting of their own that was setup nicely.
The only outstanding question is what to do with the domain-names? I could let them expire, I could try to sell them, or I could donate them to other people running hosting setups.
If anybody reading this has a use for kvm-hosting.org, kvm-hosting.net, or kvm-hosting.com, then do feel free to get in touch. No promises, obviously, but it'd be a shame for them to end up hosting adverts in a year or twos time..