In previous article I presented bash script to split large audiobook file into smaller parts. It worked well for me, but has one limitation – if chapters information was not available in the metadata, then file was split into parts of exact size, which was clearly sub-optimal, as split can fall into middle of a word. So I created new script (this time in Python as logic was bit more complicated, more then I’m conformant to implement in bash), which first detects silent spots in the audiobook and splits file there. Additionally you can also supply external CSV file, which defines mapping to chapters (It’s easy to create this file, just require a bit of patience and good tool like audacity to capture the exact positions of chapter ends). I tested my tool on tens of large single file audiobooks and it seems to work fine. You can check this script in its github repo.
Many Android applications communicate with severs using some form of REST API secured with TLS/SSL (so it’s “https” protocol). If it is your application or an open source application you know what’s going on from the source, but for third party application you still may be wondering (hopefully for legit reasons:-), what is this application sending to the server and what it gets back. With help of few free tools it’s fairly easy to monitor encrypted traffic on your local computer (linux, but it will work on other systems too). Continue reading Intercept https communication from an Android application
I’ve used free account on Heroku to load there audioserve live demo (with few of my favorite audio books from librivox). It’s fairly easy to implement a docker image on Heroku (just needed to assure that it uses PORT env. variable to bind HTTP listener to this port and to assure that container can run under arbitrary non-root user). See links below if you want to test. Continue reading Audioserve demo on Heroku
As I’m using audioserve for almost a year, I’m becoming quite keen about it – it’s exactly what I wanted – simple, lightweight and works as I needed. With it listening to audiobooks is just a simple pleasure. Recently I updated audioserve server with couple more features, which might not be essential, but can be useful: multiple transcoding formats ( meaning target formats) and transcoding cache. Continue reading Next Audioserve Version
Sqlite3 is lightweight relational database, mainly focused on smaller local systems. Being used in Android it’s now probably most spread relational database in world with billions of instances running. Lite in the name means that it is not client-server architecture and it’s intended for lower data volumes – ideal usage profile is read mostly, with occasional writes. Sqlite3 is often used as an embedded data store in various applications (Firefox and Chrome are most prominent ones). Recently I’ve been playing a bit with sqlite3 interface in Rust and had run couple of simple tests especially focused on writes. So how does sqlite3 performs and how it compares with other more typical client-server RDBMS like PostgreSQL? It’s not any serious benchmark, just couple of toy tests to highlight few things. Continue reading Sqlite3 – How Slow Is Write?
Recently I’ve been reading this book: “Network Programming with Rust” by Abhishek Chanda. I found this book bit problematic. It’s just collection of many unrelated examples (often taken from crates documentation), with just little of background and concepts explanation and in some parts this book is just wrong, in other parts it’s using too much simplifications, so the result does not make much sense or worst it introduces some dangerous ideas. One of these places is part about futures and streams – let’s look at one example: Continue reading Future Never Sleeps
Although Rust is mostly noted for it’s memory safety and thus most prominent feature is borrow checker, it has also very decent type system, which was inspired by modern functional languages like OCAML or Haskel. In this article I’ll look into very simple example, which will however show some nice features of Rust type system – especially generics. Continue reading Tiny Etude in Generics
I have been playing with tokio already in couple of small projects (ptunnel-rust and indirectly (via hyper) in audioserve), but I cannot say that I’m proficient. Also tokio is very much moving target – what I used couple month ago is already bit outdated now(old version is tokio_core crate – where default executor was on current thread, now it’s work stealing thread pool). So I decided to refresh and deepen my knowledge and created a toy project – stupid jokes server – it’s a TCP sever, which sends a random joke to client after it connects and then closes connection. Jokes are stored in text file, separated by dashed lines. My main interest was to test how to use local file system I/Os, which are blocking by nature, with tokio asynchronous approach (so I initially skipped easiest and probably most efficient implementation, where all jokes would be cached in memory). Usually in a real project you’ll have some blocking code, so I need to know how to handle it. This article is history of my attempts (and failures) recorded in a hope that it might help others in learning tokio (and also writing it down helped me to absorb gained knowledge). Continue reading From Ignorance to Enlightenment – Playing with Tokio