Somewhat recently I reduced the size of the virtual machine in which I host this blog. It is quite short on memory, but for the price I pay, can’t really complain.
Just now I was looking on memory usage on the machine, and noticed ps reporting over 100MB being help by npm:
andre@webserver ~]$ ps aux --sort -rss USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND ghost 247 0.
In the process of trying to get Linux to boot on my Surface, I wanted to first get a kernel to boot on QEMU as to reduce as much of the work and investigation on the actual device.
Clearly that was a wise choice, as I obviously have no idea what I am doing. This post is to document it and hopefully save others time that might come here with the same questions I initially had.
On last post I got Windows Boot Manager to load GRUB (or what seems like it) on QEMU. Since then I was trying to cross-compile a newer version of GRUB for ARM and then load this newer version, instead of the original EFI partition I used when writing that post. That was harder than I first thought.
I didn’t get it to work. For now I’ll stick with that original GRUB imagine, knowing that the though of it will bug for a while - I got really curious to know how that image was made.
On my quest for Linux on Surface, I got too tiring of rebooting the tablet, tweaking some changes on the bcd store or efi partition, rebooting, failing and redoing the whole cycle again.
Surface has a ARM processor with a UEFI implemented. So I started looking whether I could emulate that setup to iterate more quickly over the changes I wanted to test, and only if they worked on the emulate system, I would go over the trouble of doing them on the actual tablet.
The other day I came across this interesting ebook by 0xAX, which got me interested into the whole x68 boot process.
On the same week, when cleaning up my office, I found my very old Surface tablet that runs Windows RT. My first thought was “can I boot something else in here? Maybe it will boot Linux?” and that was what I set to find out.
The prospect wasn’t promising. Surface ships with UEFI’s secure boot enabled, having the boot loader signed by Microsoft.
The other day I wanted to use Newtonsoft JSON serializer to convert objects to JSON strings, with the twist that if some property of the object was null it should be defaulted to a specific value in the JSON string.
There is the DefaultValueAttribute but that seems to work only for deserialization (or so it seemed when I gave up searching for an out of the box behavior).
It turns out you can implement a ContractResolver.
I’ve been working on this Visual Studio extension, called Commerce Runtime Handyman.
From time to time I spend a significant amount of time writing code on top of the Microsoft Dynamics Commerce Runtime framework, so I am hoping the time spent on this extension pays off, eventually ;)
The basic idea on this first release is that you don’t need to write up manually the request and response contract classes yourself, the tool can derive and create those out of a method definition.
Ghost’s out of the box import/export backup mechanism works well, but doesn’t backup images.
I wanted a simple command line I could call to backup my blog and move the backup file out of the server’s file system. Also, I didn’t want to stop Ghost’s node process to create the backup.
By default, Ghost uses sqlite as a database, which provides an easy way to perform online backups.
Below is a Gist of a small Bash script I put together to login to the blog’s server, perform the online backup of the database, gzip that together with the image folder and then copy over to the local machine.
A fundamental reason to use a framework to write a chat bot is so you don’t need to do it all yourself, specially, do it all over again if you want your bot running on a new channel.
However, once in a while, you might find yourself needing to do something very specific to a particular channel, maybe you want to get that receipt template rendered just the way you want to, or maybe you want to use a native functionality of Skype - whatever it might be, here’s how you could do it, when using Bot Framework.
Microsoft’s Bot Framework is a set of libraries (you can choose between C# and JavaScript) and services that let you author chat bots for different platforms, like Facebook’s Messenger, Skype, What’sApp and others - based on the premise that most the code you write can be shared between those different targets.
On the C# side, one limitation, until recently, was that you could only run it on ASP.NET. That’s in the past now.