Hi Guys, so i’ve been working on a new app recently for a client of mine, currently there is no API… so in the meantime I decided to knock up a quick few lines of ruby to get a mocking api up and running… to explain this better, I need not do more than paste my README.md here.. Enjoy 🙂
A very simple and easy to use MOCK API server that serves static JSON written in ruby/sinatra.
NOTE: This is a super simple, super fragile MOCKING SERVER Intended so you can test routes and mock an API with static jso whilst you’re still building the real production API. DO NOT EVER use this in production… Seriously. It breaks a lot and will if you try… DONT. Absolutely 0 effort went into it, therefor 0 Warranty. Use if you dare.
Folder structure defines API calls…. return.json is what gets served.
[ http method ] ->; [ api call route ] ->; [ json response contents of call return.json ]
GET ->; users ->; return.json
POST ->; users ->; create ->; return.json
If you have static assets you wanna reference in the json, plonk them in the ASSETS folder
site_root ->; file.jpg
You can call http://yourhost:port/ASSETS/file.jpg
Here’s the directory structure of the sample project included here
Which supports calls like…
And gives responses from the static result.json file like…
"name": "Dolly Two",
gem install sinatra
There are a lot of guides that do exactly the same as what i’m about to write about… the reason for this quick blog post is mostly a brain dump for myself.. but also because I always struggle to find up to date info for all of this in one place… and there are always gaps… So here goes! by the end of this short tutorial, you should have not only a working rails and ruby installation, running as a user, but also a ruby on rails hello world! whaaaaaat. …
I have a collection of both Mac OS X and Linux servers dotted around the place… Sometimes I need to read ext4 formatted drives on my Mac’s… this always proves an annoying problem where I have to mount them inside a Virtual Machine and copy things across…. Pain and Slow!
I searched the interweb for a solution to this… and most guides are about 3 years out of date, so here’s one from 2013 that works on Lion / Mountain Lion and even Mavericks DP1/2.
Download and Install : OSXFUSE-2.5.4.dmg (this took off where MacFuse left off and even has compatibility for old MacFuse plugins).
Download and Install : fuse-ext2-0.0.7.dmg
Plug in your ext fs formatted drive… Voila! I wouldn’t rely on this in a production environment mind you… but its decent if you just need to grab some files from a USB drive quickly for example.
EDIT: Tonight i’ll be picking up one of my Mac Mini’s from the Datacenter to get Ubuntu 13.04 up and running! expect a full guide with drivers here shortly 🙂
So Ubuntu 13.04 LTS recently was released, It comes with the new 3.8.0-19 upstream of the Linux Kernel so I thought I’d check it out!
Although our patched 12.04 and 12.10 Ubuntu’s use version 3.124c of the tg3 NeXtreme drivers from Broadcom which have Mac Mini support… The version in Ubuntu 13.04 (3.128c) seems to have had this removed!
A simple run of
modinfo tg3 | grep 1686 reveals sadly that support for detection of the Mac Mini Ethernet hardware seems to have been removed during 3.124 and 3.128 of the Broadcom tg3 drivers.
I’m likely to install 13.04 on a Mac Mini sometime soon so will update this post with a proper howto and any good news I encounter but I don’t think its good news…
lsmod | grep Ethernet returns
01:00.0 Ethernet controller: Broadcom Corporation Device 1686 (rev 01)
modinfo tg3 | grep 1686 on our modified 12.04/12.10 machines using the NeXtreme driver from this blog returns:
however on 13.04 returns nothing.
Recently I began experimenting with KVM virtualisation in the Linux Kernel. Its a great technology that if your CPU supports VT-x / AMDV offers almost (really, almost) bare metal level performance inside Virtual Machines. It works on most Linux flavours and has a couple of handy management tools such as virsh and virt-manager. However, one thing I thought was always lacking and annoying me was of course, the ability to manage my Hypervisor from my iPhone / iPad when on the move! Time for an experiment I thought; then out came “KVM Remote”
KVM Remote on the iPad and 3 Different Remote Hypervisors
Its universal so works on both the iPhone and iPad and is extremely bleeding edge right now, but works! and is incidentally the first App i’ve made that doesn’t have selfish fiscal intentions, so theres another great reason to download it from the AppStore now!
P.S. i’ll be updating it regularly adding more features as requests come in.
My Raspberry PI
Out the box the Raspberry PI comes with a ARM1176JZFS Core (armv6 with hard float aka armhf arch) running at 700 Mhz as part of the Broadcom SoC. Additionally the memory frequency is also limited. In recent firmwares however… tinkerers have had the ability to “overclock” the Raspberry PI to squeeze some extra juice out of it. Mine’s currently running at 1Ghz at a solid 48C temperature when under load. So the first question that springs to mind is… why doesn’t everyone overclock their Raspberry PI? Well… there have been (well founded) reports of SD card corruption, heat/power issues and instability. The idea of this post is to show the user how to safety squeeze every last bit, cycle and IOP out of their PI safely’ish and without being an astrophysicist. Read on for the know-how. …
So in the last post I discussed why the Mac Mini is the perfect machine for Linux and for Datacenters in general! One frustration some readers may be finding is that the networking chipset used by Ivy Bridge platform in Late 2012 Mac Mini’s doesn’t have native support in the Linux Kernel (as of now anyway). So its required to install a kernel module from the manufacturer/vendor (broadcom).
On their website they provide the “tg3” drivers for Linux kernels, however these are only good if you are running a Linux kernel < 3.5.x. If you take Ubuntu for example, 12.04 uses the 3.2.x stream, whereas 12.10 uses the 3.5.x stream and isn’t immediately compatible with the drivers on the broadcom page. This is due to the deprecation in 3.x and removal in 3.5.x of the
Read on for the fix, more and downloads. …
It’s a bit of a random thing you’d think, but recently I had an issue where one of my servers would keep dieing when under abnormal load… So I thought, how can i replicate this in a lab environment… So I wrote a tiny bash script (that you can just paste into a terminal) that will max out each “thread” of the CPU until you kill the processes or reboot… Useful for stress-testing or burning in a CPU…
I’ve been playing around with some IDN’s and TLD’s and DNS etc…. i’ve realised you can create IDN (punycode) subdomains to any existing domain, in addition, i’ve created my own TLD, and setup a DNS server that works for this purpose. If anyone would like an IDN or a custom TLD, get in touch!
From anywhere in the WWW:
Set your DNS to: 220.127.116.11 in order to take advantage of the new ком TLD. (note: this is just a bit of fun, and is not official).
Following on from my previous post regarding AFP and iSCSI benchmarks i’ve decided (after many requests) to post a few raw benchmarks of the system gathered by bonnie++, the environment is as follows:
CPU: Athlon 64 3700+
RAM: 2gb DDR400
Controllers: 2x SATA-II and 1x SATA-I
Hard Drives: 7x Samsung 2tb Spinpoint F3 5600 RPM
OS: NexentaStor 3
ZFS Config: Standard raidz1 with dedup=off and compression=off
So I gathered a few results… after some annoying results I found a bottleneck in my system on 1 of the drives that seemed to bring the benchmark result down greatly, however once this was worked out I acheived the following: …