Autarchy of the Private Cave

Tiny bits of bioinformatics, [web-]programming etc

    • Archives

    • Recent comments

    How to: convert your VPS root filesystem to btrfs (using rescue boot)

    15th February 2016

    I’m moving from (a kind of…) a dedicated server to a VPS, to decrease my frightful anticipation of hardware failures.
    Honestly though, that server had been freezing up and restarting spontaneously for several months now, causing sometimes really long down-times…
    That server is now about 6-7 years old, built with off-the-shelf components, some of which (the HDD :) ) had weird noises from the very start.
    Definitely time to move!

    I’ve purchased a fairly cheap VPS with an easy, one-click upgrade option for after I’m done configuring it.
    It comes with a wide selection of OSes to pre-install; I’ve chosen Debian Jessie, version 8.3 as of this writing.

    I wanted to use btrfs from the beginning, so could have installed Debian myself, but… VPS provider does some initial configuration (like their Debian mirror and some other things), so I’ve felt that converting to btrfs after the fact would be easier. Now that I’ve done this – I guess it was fairly easy, although preparation did take some time.

    Below, I’m providing step-by-step instructions on how to convert your root filesystem from (most likely) ext4 to btrfs.
    Read the rest of this entry »

    Posted in *nix, how-to | No Comments »

    How to fix: mod_proxy’s ProxyPass directive does not work

    10th February 2016

    So… You had finally built a nice LXC container for your web-facing application, and even configured Apache (Debian package version 2.14.18-1 in my case) to serve some static/web-only components.
    From your client-side JavaScript UI you talk (in JSON) to the API, which is implemented as a separate node.js/Python/etc server – say, on port 8000 in the same LXC container.

    The simplest solution to forward requests from the web-frontend to your API is by using mod_proxy.
    If you want to forward any requests to /api/* to your custom back-end server on port 8000, you just add the following lines to your VirtualHost configuration:

    ProxyPass “/api” “http://localhost:8000″
    ProxyPassReverse “/api” “http://localhost:8000″

    I’d suggest not wrapping this fragment with the classical IfModule: as your application will not really work without its API back-end, you actually want Apache to fail as soon as possible if mod_proxy is missing.

    That was easy, right? What, it doesn’t work? Can’t be! It’s dead simple! No way you could make a mistake in 2 lines of configuration!!! :mad_rage: :)

    Oh wait… I remember I had this problem before… Read the rest of this entry »

    Posted in *nix, how-to, Web | No Comments »

    Recommended: “Parasyte: The Maxim”

    30th January 2016

    Parasyte: The Maxim (2014) on IMDb

    This anime is the best that I have watched since (all seasons/full features of) Ghost in the Shell. In fact, I like this one more than Steins;Gate – which I can also recommend, but it takes patience to watch the first 3-4 episodes. With Parasyte, no patience is necessary: it is a very smooth flow from the very start until the very end. Luckily, season 1 is all there is. Just like with the legendary single season of Firefly :)

    Posted in Links, Movies | No Comments »

    Smiling Amsterdam: under surveillance

    27th January 2016

    Coat of Arms of Amsterdam

    Coat of Arms of Amsterdam by Ssolbergj

    I had recently undertaken a spontaneous trip to Amsterdam, the Netherlands. There were a few strong first-time impressions, which I want to document before they fade.

    The strongest first impression is from the check in and check out system in trams (and, likely, other public transportation nets). Tickets are all NFC-based, and you must swipe/touch special verifying devices upon entering and exiting a tram. If your ticket is valid, green light and a sound tone will notify you (and everyone around you) about this. If your ticket is no longer valid, you’ll get red light and a different (louder also? not sure) sound.

    These chipcards come in a variety of forms: non-reloadable cards for 1/24/48/etc hours (from the moment of the 1st check in), anonymous reloadable cards, and other card types.

    Upon entering a tram with an invalid (train :) ) ticket, we were greeted by… a woman in a cage! :) She was selling tickets to those who didn’t have them. It was already late evening, but she was smiling a lot and also tried to figure out if we really need just a 1h ticket, or if a multi-day ticket would be better for us.

    I am not entirely sure why checking out is necessary, other than for collecting loads of data on passenger flows (oh, sweet sweet data to analyze!). I also haven’t checked what happens if your ticket runs out while you are in a tram: will it fail to check out, forcing you to buy another one? Most likely not: should still let you out (there are actual tourniquets at tram exit doors).
    Read the rest of this entry »

    Posted in Life | No Comments »

    What is in 2016 for you and me and everyone?

    26th December 2015

    There will be 366 days in 2016 (yes, a leap year). 366 steps towards your goal. That’s a lot! With the right goal and persistence, a lot can be done and achieved.

    There are lots of good, real, helpful self-development/self-improvement techniques. These can often be practiced non-stop in one’s everyday life. These can often also be practiced in parallel, for a likely synergy.

    There are lots of success books and biographies of successful self-made people. Some stories are quite well-known, while some remain hidden gems. Likely enough reading for several months, non-stop!

    There are many good books on business, data analysis, engineering, software development, and other fields. Likely many years of reading non-stop!

    Some people say that in 5 years one can master a common subject of choice good enough to become an expert. Others point out that many activities (and their co-activities) can be monetized or turned into profitable versions of said activities.

    All in all, the only thing required is action.

    Which books do you have on your 2016 reading list?
    What is the field you will be an expert in by 2021, assuming you start in 2016?
    Information consumption aside, what will you produce in 2016? What will be your actions?

    Posted in Books, Life | No Comments »

    Midnight Commander (mc): convenient hard links creation from user menu

    3rd December 2015

    Midnight Commander is a convenient two-panel file manager with tons of features.

    You can create hard links and symbolic links using C-x l and C-x s keyboard shortcuts. However, these two shortcuts invoke two completely different dialogs.

    While for C-x s you get 2 pre-populated fields (path to the existing file, and path to the link – which is pre-populated with your opposite file panel path plus the name of the file under cursor; simply try it to see what I mean), for C-x l you only get 1 empty field: path of the hard link to create for a file under cursor. Symlink’s behaviour would be much more convenient…

    Fortunately, a good man called Wiseman1024 created a feature request in the MC’s bug tracker 6 years ago. Not only had he done so, but he had also uploaded a sample mc user menu script (local copy), which works wonderfully! You can select multiple files, then F2 l (lower-case L), and hard-links to your selected files (or a file under cursor) will be created in the opposite file panel. Great, thank you Wiseman1024!

    Word of warning: you must know what hard links are and what their limitations are before using this menu script. You also must check and understand the user menu code before adding it to your mc (by F9 C m u, and then pasting the script from the file).

    Word of hope: 4 years ago Wiseman’s feature request was assigned to Future Releases version, so a more convenient C-x l will (sooner or later) become the part of mc. Hopefully.

    Posted in *nix, how-to, Notepad | No Comments »

    How to fix: Xiaomi Mi Band stopped tracking steps and sleep

    26th July 2015

    Mi BandA few days ago, my Mi Band (version 1) stopped properly tracking sleep and counting steps. Here is a full list of symptoms:

    • synchronization appears to work correctly;
    • total count of steps is updated, but when you click it – there are no per-hour details;
    • in the older app version: after sync completes, there is no green message “Updated X items”;
    • night sleep tracker does not update at all: neither total hours slept, nor per-hour details;
    • the band is otherwise functional, e.g. “Find the band” works – it vibrates and flashes diodes.

    Warangelo00 found a solution, which worked for me (and no, you do not need to hard reset the device):
    note: the fix below will most probably not work for Mi Band 2, see comments; iPhone owners may try switching iPhone from AM/PM (12-hour clock) to 24-hour clock to fix the non-synchronization problems with MiBand2 – please write in the comments if this method works for you.

    1. enable Bluetooth, if it is disabled;
    2. start Mi Fit, go to Play –> Incoming call (or, in older app version, SettingsIncoming calls);
    3. enable it – set to On;
    4. now call your mobile phone from a different one – wait for the band to vibrate and flash lights;
    5. you should now be able to refresh Mi Fit main page, and see both current day and previous night per-hour details; in the older app version, it should also show the green “Updated X items” message after syncing;
    6. you can now disable incoming calls notification if you don’t need it.

    According to Holly, the trick may also work for Mi Pulse.

    Not sure if this fix will last, but it did help me – thanks, Warangelo00!

    Posted in Hardware, how-to | 48 Comments »