Nikita Tokarchuk

hello! my name is
Nikita Tokarchuk

I'm a Hacker on its true meaning. Simply saying a computer technology enthusiast.
I focus my interests on backend engineering in all ones kind.
From 2017 and continuing nowadays I use Golang at most.

I started to grow as a professional in 2012 and since that time I've solved a huge amount of business problems by using several technologies:

  • by using JavaScript and NodeJS I used to make highload backends and fancy web apps;
  • used a lot of C++ for making highload backends as well as efficient apps for embedded projects;
  • configured tons of GNU/Linux based servers together with OSsoftware with the help of ansible;
  • helped to store incredible amount of data in different databases such as MongoDB and *SQL;
  • collected millions of metrics and clicks in ClickHouse what were proceed through either Kafka or RabbitMQ;
  • run and used a variety of kubernetes setups from bare-metal to EKS;
  • deployed some amount of helm charts with the help of tiller and then without one;
  • saved a lot of money with the well planned configuration in GCP and AWS;
  • automated boring routine with the help of Jenkins and GH Actions;
  • and more...

See some myown OSS projects on my git:

… … …

stream coding process to discord using OBS

Nowadays code streaming become more popular. There is even Twitch channel with software developing.

Usually for the streaming people use OBS software. Basically it allows you to combine several video/audio/etc sources into the one scene that is being streamed to the service.

Discord is another super popular app. The app let people be connected inside some community. For example the group of graphic illustrators can share their works and discuss in voice chats.

Discord live streaming is not very popular but sometimes can be increadibly useful. But Discord doesn't support custom streaming at the moment and the only choice you have is to stream window or entire screen.

a couple of tiny tricks

I use OBS Studio from the website https://obsproject.com. It is free and open-source!

Let's take a look!

image capture

First I move all controls into floating windows by using «windowed» button at the left of the control:

Now all your controls are separated and floating under the main window. You may want to adust its properties and size to fill the window with the scene:

That's all! The main OBS window can be a source for the discord live stream:

Go live!

sound

Using window source Discord takes sound from the window as well.
By enabling sound monitoring we make the window emit sound that will be captured.
The tricky part here is to avoid loops in the sound. But this part is hardly depends on your requirements and hardware.

As the simple solution to capture everything I can hardly recommend VB-Cable app that is basically a pipe source-sink. See https://vb-audio.com/Cable/ for details.

… … …

android vold for exfat

TL;DR: root is required, use exfat-fuse, patch vold, enjoy.

intro

exFAT was developed by Microsoft in 2006 and most of the time it was proprietary. On the other hand, there were exFAT-fuse implementations for linux by samsung and others. Samsung driver was also closed, but due to conflict with the community about GPL licenses they were forced to publish (keep published) sources.

Despite the fact that the filesystem was developed mostly for flash-memory, there are no restrictions to use it on HDD.

For now exFAT is the best filesystem if you use your disk with different OS. Except Android.

Android devices can use USB devices by connecting them using the OTG-USB adapter. It looks like this:

MicroUSB to USB OTG adapter

the problem

Android until «Pie» doesn't have native support for the exFAT drives. Even if exFAT driver is included in the kernel. The only possible option is Vfat.

Vfat is «almost» perfect, but has its own limitations. The biggest one is the file size limit. You can't have files bigger than 4GB on vfat partition. That is pretty sad when you want to save 30GB mp4 video file to the portable HDD.

And there is another issue with exFAT: if you want to play this 30GB mp4 video file from the portable HDD using android tv stick! Android can't mount exFAT natively.

On your device you can use up to two methods to mount exFAT:
- using fuse exFAT;
- using linux kernel module (v5.7 and above).

I'll describe both, but the former is for manual process and the latter is as the vold patch.

mount it manually

For this method we assume we have exfat-fuse tools.
Before you start, ensure your exFAT helpers exist by using the ADB shell:

android-device$ which mkfs.exfat fsck.exfat mount.exfat
/system/bin/mkfs.exfat
/system/bin/fsck.exfat
/system/bin/mount.exfat

Then you can mount them by using mount.exfat tool. This tool uses fuse driver and you don't need exFAT support in your kernel:

android-device# t=`mktemp -d`; mount.exfat /dev/block/sdxX $t && echo $t
FUSE exfat 1.2.7
/data/local/tmp/tmp.PRpALtvJ7f

clever solution

To make this persistent and automatic it is possible to easily patch Vold.
Simply, Vold is the daemon that automatically mount them to make it available through GUI apps.

Here I describe the process as if I have exFAT kernel support.
I will do it according to my own changes in the repository https://github.com/mainnika/vold-exfat.

You can follow steps using this commit diff https://github.com/mainnika/vold-exfat/commit/ca9e34ec92425b416f3f250e2b7d7122782c3f23.

As the easiest way I'll just change vfat mount code to use exfat.

First, I'll remove some unnecessary stuff to simplify the whole process:
- filesystem check;
- disk format.

Then, change fstype for the mount call:

@@ -140,117 +75,16 @@ int Fat::doMount(const char *fsPath, const char *mountPoint,
     }
 
     sprintf(mountData,
-            "utf8,uid=%d,gid=%d,fmask=%o,dmask=%o,shortname=mixed",
+            "utf8,uid=%d,gid=%d,fmask=%o,dmask=%o",
             ownerUid, ownerGid, permMask, permMask);
 
-    rc = mount(fsPath, mountPoint, "vfat", flags, mountData);
+    rc = mount(fsPath, mountPoint, "exfat", flags, mountData);

Build the vold normally and then replace your binary in the system (do not forget about backup!):

android-device# cp /system/bin/vold /system/bin/vold.orig
android-device# cat /sdcard/vold.exfat-patched > /system/bin/vold
android-device# reboot

After the reboot you should see your exFAT disk in the android GUI.

ready-to-use binaries

this is just for Amazon FireTV stick only!

Since I did this work for the FireOS 5.2.7.2 (Amazon FireTV stick), I've prepared some binaries for this system, see the release https://github.com/mainnika/vold-exfat/releases/tag/lollipop-armv7l.
Just replace your vold in the stick.

If you have AOSP-like system you can use this repository https://github.com/null4n/vold-posix to fetch fuse binaries. The repository containes also vold binary for Android 8.1 (aarch64).

Also, feel free to compile your own vold and exfat binaries:
- https://github.com/null4n/system_vold
- https://github.com/LineageOS/android_external_exfat

… … …