Sunday, September 4, 2016

HTTP chunked encoding using C++ and libcurl

HTTP chunked encoding is the way to transfer large amounts of data via HTTP. It is pretty easy to use with libcurl, if you have all the data in advance. In case you don't have all the data available when uploading, things get a bit tricky. This latter scenario is what this post will be focused on.



Saturday, September 3, 2016

Replacing legacy C-style buffers

Since I've been working lately on legacy projects, filled with C-style buffer containers like void*, char*, byte*, I've started replacing these types of buffers with something a bit more safe and modern, if I might say so.



Sunday, June 12, 2016

iOS push notifications with sound from Amazon SNS

When sending push notifications from Amazon SNS, to iOS endpoints, with the default JSON format, they are received without sound.
The default format would look like this:
{
  "default" : "Message"
}

In order to get sound for push notifications on iOS, the JSON payload should look like this:
{
  "default" : "Message",
  { "APNS":"{\"aps\":{\"alert\":{\"loc-key\":\"%@\", \"loc-args\":[\"Message\"]}, \"sound\":\"default\"} }" }
}

Why does the payload look like this? I have no idea. The point is that it works at the moment this article was written. I've found it somewhere on stackoverflow, but I can't find it again, so I'm just posting it here for whomever needs this information.

Saturday, January 23, 2016

Creating thumbnails for remote videos

You have some video files stored on some remote storage (dropbox, google drive) and you want to create thumbnails without downloading the whole file.



Tuesday, January 12, 2016

Configuring ssh keys for git access on Ubuntu

To be able to connect to a git repository with ssh access (ssh://) use the following steps:
  • copy your private key file to ~/.ssh
  • create (if it doesn't exist) the file ~/.ssh/config and add the following content:
Host my_githost.com
    HostName my_githost.com
    User my_username
    IdentityFile ~/.ssh/my_private_key_file
  • change the permissions to the private key file:
chmod 400 ~/.ssh/my_private_key_file
Now you can clone your repository.

Monday, January 11, 2016

Migrating a svn repository to git

I realize there are a ton of articles about migrating from svn to git, but this is mostly a note so I don't forget the steps. My situation is a bit particular since I need to import an svn folder to git.