Sunday, July 14, 2024

Часи української мови, про які не говорять у школі

     Всі ми ще, мабуть, з дитинства вміємо висловлювати думки, описувати події, розповідати факти у трьох базових формах:

  • минулому — те, що вже відбулося (або відбувалося, якщо не враховувати види (граматичні аспекти) дієслів);
  • теперішньому — те, що відбувається зараз;
  • та майбутньому — те, що буде відбуватися (або відбудеться) —
часах. Що таке взагалі час — це питання як фізики, так і філософії, та й навіть інших наук. У мовознавстві (лінгвістиці) ж слід сприймати події, що описуються дієсловом, немов би у відносному часі — відносно деякої точки відліку. Зазвичай такою точкою відліку у більшості речень є момент мовлення, тобто коли ми говоримо це речення. Щоб краще зрозуміти, можна порівняти такі висловлювання:
Він хоче пити.

Він сказав, що хоче пити.

     У першому реченні існує пряме ствердження, що хтось ("він") у даний момент часу хоче пити. Це речення "відбувається" в той час, коли його кажуть, тому ми розуміємо, що ця людина «прямо зараз» має спрагу. У другому ж випадку не все так однозначно: "він" сказав — тобто в минулому, раніше, ніж це кажуть, — що на той час хотів пити. Ми не можемо знати, чи досі дана особа має спрагу, чи можливо за цей час, поки нам це передали, вже, можливо, щось випив або перехотів. Тобто фактично у другому випадку одна подія ("казати") відбувається відносно моменту мовлення, а друга ("пити") — відносно першої. Це все можна порівняти з тим, як кажуть, «завтра сьогодні стане вчора».

    Так от, ті три базові часи, до яких ми звикли, мають (повʼязані з) власні форми, що виражаються закінченнями. Майбутній час має навіть дві форми: просту ("писатиму") та складену ("буду писати"), остання з яких є допоміжним дієсловом "бути" в цьому ж часі та інфінітивом (початковою формою).

Monday, June 3, 2024

A short Debian live-build guide

    Debian's live-build is a powerful tool to build customized OS images that can be used to install pre-configured Debian from a USB/CD drive. This post is kind of old and I'd started writing it back in January. Keep in mind this is not a complete "guide", but rather collection of good resources + some things I couldn't find anywhere that I discovered myself.

    First of all, make sure to read the official Debian Live Manual — it has almost everything to get started, as well as covering more advanced features. Don't be afraid of big texts: read and study a lot to accomplish what you want. Also it's worth checking out the manpages.

    Ian LeCorbeau has got some useful tips on config options and hooks, especially boot time hooks that allow you to perform some customization concerning the live user. Also check the note regarding backing up your config.

 

    auto/config:

If you want more software, you should add contrib and non-free archive areas — --archive-areas "main contrib non-free non-free-firmware"; for minimalism you may add --debootstrap-options "--variant=minbase".

    config/archives (my example):

Put your APT repository lines into .list. files and .asc keys into .key. files. Those files that end in .chroot will be available at build time, but won't be present on the installed system. For repositories to be present in the target installation use .binary instead.

    config/bootloaders (my example):

    Bootloader customization seems to be poorly documented and usually not covered in tutorials, so I'll try to describe some of my findings in details here. On (legacy) BIOS systems you need isolinux; on UEFI you need grub-pc.

    Take a look at the example I provided. IsoLinux is configured in .cfg files with isolinux.cfg being the primary one. Instead of using hardcoded paths to kernels and other things, you should use substitutions like @LINUX@, @INITRD@, @APPEND_LIVE@, @APPEND_LIVE_FAILSAFE@, @FLAVOUR@.

    You may include splash.png, of course, but it's usually better to provide splash.svg that will be automatically preprocessed and converted. This allows you to use nice substitutions, such as @DISTRIBUTION@ or @MONTH@.

    In order to use characters other than default English ASCII in IsoLinux you need to include your own .psf font file. In my example I used koi8u_8x16.psf that contains KOI-8 Ukrainian codepage. Make sure all other config files are encoded in the appropriate encoding (I don't remember exactly, perhaps CP1258)!

    GRUB is much easier to customize and doesn't require such quirks, so I'm not going to explain it here.

    config/hooks:

    "Normal" hooks are executed only on the installed system (not on the live system). Hooks ending in .chroot are executed as chroot, duh. The only thing to mind here is you WON'T be able to install Flatpaks in them! For that, apparently, you need to use .container hooks that are run under a systemd-nspawn container.

    config/includes.*:

    Files in .binary are copied onto the ISO image directly and can be used, for example, to provide documentation. There are many other types of includes, but you may mostly need .chroot_after_packages — these are files (and folders) copied to the system after all packages are installed. It is typically used to provide /etc/skel — base configuration for users. In my example these config files change default KDE themes and settings.

    .chroot_after_packages/etc/live/config.conf may contain some variables to change hostname, live user name, locales, etc. It's documented in manpages for live-boot.

    Boot time hooks can be provided under .chroot_after_packages/lib/live/config-hooks/.


    The rest of config/ should be pretty straightforward. Remember to use a virtual machine to test your images before proceeding to install them onto a real machine. I hope you found at least some use in this "guide"; thank your for reading, good luck! :)

Wednesday, January 3, 2024

How to use the Motorman in Real Train Mod

    Well, hi there! Obviously, this is my first blog post, but I'm not going to introduce myself, since you either already know, or, uhh, can read it on the About Me page. Back in the days of Minecraft 1.7.10 I had been playing it with RealTrainMod, and there had been no tutorials on how to use many items from it in any of the languages I know. The one that had gotten me interested particularly had been the Motorman. It's an NPC that lets you automate your trains. Let me mention what I'm using in this post:

    When you have set up your railway, you should place down a train at the starting point of your route, mount it and use the command /trec to start recording the route. Whenever you move "the handle" (press W/S) or open/close the doors (and perhaps play announcements, but I haven't checked it), it's being recorded to a macro file. In order to finish recording, run /trec again.

    Now return to the starting point, spawn a new train, and then put a motorman in the front driver's seat by right-clicking on the bogey as you would usually mount it. Right-clicking the motorman will open a menu with all your recorded macros. Double-click to set one. The NPC driver will then proceed with your route.

    Unfortunately, I haven't found a way to rename and delete macros in Minecraft itself. Although, you can go to .minecraft/mods/rtm/macros directory and examine them here — macros are basically text files with instructions in them. It also seems like there's no way to make the motorman loop (repeat the route).

    A rather important note: on Minecraft 1.12.2 the motorman doesn't work without fixRTM. Also, since RTM is somewhat "abandoned", or well, outdated, and you want to build an automated railway/tramway/subway or even other kinds of public transportation, it may be worth to check out Minecraft Transit Railway mod.