<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
    <title>prem.moe</title>
    
    <link rel="alternate" href="https://prem.moe/" />
    <link rel="self" href="https://prem.moe/feed.xml" type="application/atom+xml" />
    <id>https://prem.moe/</id>
    <updated>2024-07-24T15:10:31Z</updated>

    <author>
        <name>Przemysław Buczkowski</name>
        <email>prem@prem.moe</email>
        <uri>https://prem.moe/</uri>
    </author>

    
        <entry>
            <title>Japanese short-form 1 &amp;ndash; 私が生み出したスマートシティ</title>
            <link rel="alternate" href="https://prem.moe/2022/03/07/watashi-ga-umidashita-smaato-shiti/" type="text/html" />
            <id>https://prem.moe/2022/03/07/watashi-ga-umidashita-smaato-shiti/</id>
            <updated>2022-03-07T13:57:00Z</updated>

            <summary type="html">I decided to put up my mini-essays, that I write for Japanese lessons. It is to have a laugh at them in a few years, encourage myself to keep up at it, and see how they, hopefully, become longer and more coherent with time.</summary>
            <content type="html">&lt;p&gt;I decided to put up my mini-essays, that I write for Japanese lessons. It is to have a laugh at them in a few years, encourage myself to keep up at it, and see how they, hopefully, become longer and more coherent with time.&lt;/p&gt;

&lt;p&gt;This one was supposed to be a composition about my dream &amp;ldquo;smart city&amp;rdquo;, but it turned out to be more of a rant on data protection law :)&lt;/p&gt;

&lt;p&gt;私が住みたいスマートシティは、プライバシーと便利さの微妙なバランスを保っています。データ収集の一番大事な規則は、絶対に必要なデータだけを収集することです。例えば、よく例に出たスマートシティのメリットが交通の効率です。そのために使ったデータは、交通の強度だけを収集しています。データ保護がないなら、経営会社が車の登録番号や、ドライブの時間や、期限や目標などを登録するかもしれません。私のスマートシティでは、そんなことは許されません。死刑です。&lt;/p&gt;

&lt;p&gt;いい理屈だけど、取り締まりが難しいです。夢見たスマートシティには、誰しもが自分のデータを確認できます。多分、全てのデータを公開して問題がないと思います。全てが公開されたら、誰も個人のデータの収集を許さないでしょう。&lt;/p&gt;
</content>

            
                <category term="Japanese" />
            
                <category term="Tech" />
            
        </entry>
    
        <entry>
            <title>Shin Megami Tensei V &amp;ndash; pierwsze wrażenia</title>
            <link rel="alternate" href="https://prem.moe/2022/02/25/Shin-Megami-Tensei-V---pierwsze-wrazenia/" type="text/html" />
            <id>https://prem.moe/2022/02/25/Shin-Megami-Tensei-V---pierwsze-wrazenia/</id>
            <updated>2022-02-25T13:57:00Z</updated>

            <summary type="html">Pokemony dla dorosłych (nie, nie w takim znaczeniu) powracają na konsolę Nintendo. Jak Atlus poradził sobie z pierwszym od dłuższego czasu wydaniem MegaTena na konsolę (przynajmniej częściowo) domową? Moje pierwsze odczucia publikuję po 18 godzinach, czyli wedle informacji internetowych, przed połową rozgrywki.</summary>
            <content type="html">&lt;p&gt;Pokemony dla dorosłych (nie, nie w takim znaczeniu) powracają na konsolę Nintendo. Jak Atlus poradził sobie z pierwszym od dłuższego czasu wydaniem MegaTena na konsolę (przynajmniej częściowo) domową? Moje pierwsze odczucia publikuję po 18 godzinach, czyli wedle informacji internetowych, przed połową rozgrywki.&lt;/p&gt;

&lt;p&gt;Zacznijmy od pozytywów. Role-playowanie długo-niebieskowłosego femboya to najlepsza rzecz na świecie od czasu mleka w tubce, i nie ma nawet o czym dyskutować.&lt;/p&gt;

&lt;p&gt;Łączenie (ang. fusion) demonów sprawia ogromną radość i jest wciągające. Ponieważ demony mogą dziedziczyć umiejętności, trzeba do fuzji podchodzić z głową. Jeśli bawiliście się kiedyś w ewolucje Pokemonów, to bierzcie w ciemno! Nie bez powodu mamy aż cztery poziomy trudności, gdzie już drugi potrafi skopać zad - wyższe polecam fanom MegaTena i masochistom.&lt;/p&gt;

&lt;figure&gt;
    &lt;img src=&#34;/assets/images/blog/smt5/2.jpg&#34; /&gt;
    &lt;figcaption&gt;Demony należy traktować z szacunkiem. Na pewno nie wejdą do Pokeballa.&lt;/figcaption&gt;
&lt;/figure&gt;

&lt;p&gt;Każdy demon jest pięknie zanimowany. Wiele ma unikalne ataki ze specjalną, rozbudowaną sekwencją. Żal było mi rozstawać się z niektórymi demonami o świetnej aparycji, gdy był już czas przeznaczyć je na fuzję, ale szybko znajdowałem sobie nowych faworytów.&lt;/p&gt;

&lt;figure&gt;
    &lt;iframe width=&#34;560&#34; height=&#34;315&#34; src=&#34;https://www.youtube.com/embed/r_gHm8vYA_I&#34; title=&#34;YouTube video player&#34; frameborder=&#34;0&#34; allow=&#34;accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture&#34; allowfullscreen&gt;&lt;/iframe&gt;
    &lt;figcaption&gt;To uczucie, kiedy musisz przeznaczyć swoją ulubioną, drącą japę laskę na przemiał.&lt;/figcaption&gt;
&lt;/figure&gt;

&lt;p&gt;I tutaj niestety zaczyna się problem. Mam wrażenie, że ktoś wpakował cały budżet w demony, a na resztę świata przedstawionego już zabrakło. Każda lokacja Da&amp;#39;at, czyli postapokaliptycznego Tokio jest z grubsza do siebie podobna i mogłoby to być każde miasto na świecie - parę budynków przysypane piaskiem.&lt;/p&gt;

&lt;p&gt;W Shin Megami Tensei IV uwielbiałem to, że faktycznie można było się tam poczuć jak mieszkaniec Tokio. Każda dzielnica wygląda jak z rzeczywistości i faktycznie odwiedzamy prawdziwe lokacje - a to mimo bardzo ograniczonej grafiki konsol Nintendo 3DS. W SMT5 ta tradycja została niestety zaprzepaszczona. Co więcej, jak na razie odnoszę wrażenie, że im dalej, tym gorzej. Przez to nie ma też zbytniej różnicy między graniem przenośnym a na telewizorze.&lt;/p&gt;

&lt;figure&gt;
    &lt;img src=&#34;/assets/images/blog/smt5/4.jpg&#34; /&gt;
    &lt;figcaption&gt;Tak wygląda w zasadzie całe Da&#39;at &amp;ndash; ewentualnie zamień pociąg na samochodziki.&lt;/figcaption&gt;
&lt;/figure&gt;

&lt;p&gt;Historia też, że pozwolę sobie tak się wyrazić, dupy nie urywa. Większość bossów cuchnie mi przedłużaniem rozgrywki na siłę i nie ma żadnego znaczenia w historii. Zobaczymy, jak dalej. Muzyka jest monotonna i przez pierwsze 18 godzin niewiele się zmieniła.&lt;/p&gt;

&lt;p&gt;Podsumowując, mamy to co zawsze silne w MegaTenie, czyli system mechanik. Niestety jednak, jeżeli nie należy on do Twoich ulubionych, to 60 godzin rozgrywki zmęczy Cię pożądnie.&lt;/p&gt;

&lt;p&gt;6/10&lt;/p&gt;
</content>

            
                <category term="Gaming" />
            
                <category term="Polski" />
            
        </entry>
    
        <entry>
            <title>Polish names&#39; pronunciation guide for English speakers</title>
            <link rel="alternate" href="https://prem.moe/2021/11/12/Polish-names-pronunciation-guide-for-English-speakers/" type="text/html" />
            <id>https://prem.moe/2021/11/12/Polish-names-pronunciation-guide-for-English-speakers/</id>
            <updated>2021-11-12T18:43:00Z</updated>

            <summary type="html">&lt;em&gt;Originally published on &lt;a href=&#34;https://github.com/SteveMCarroll/PronouncingNamesForEnglishSpeakers/blob/main/README.md&#34;&gt;GitHub&lt;/a&gt; as a part of a guide of pronouncing names in various languages. It was published there on July 27th, 2021.&lt;/em&gt;</summary>
            <content type="html">&lt;p&gt;&lt;em&gt;Originally published on &lt;a href=&#34;https://github.com/SteveMCarroll/PronouncingNamesForEnglishSpeakers/blob/main/README.md&#34;&gt;GitHub&lt;/a&gt; as a part of a guide of pronouncing names in various languages. It was published there on July 27th, 2021.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Polish looks to an English speaker like a complicated mess of consonants. The consonants are a powerful &lt;a href=&#34;https://www.youtube.com/watch?v=AfKZclMWS1U&#34;&gt;weapon&lt;/a&gt; of special grade.&lt;/p&gt;

&lt;p&gt;But even in the exaggerated example from the film (Grzegorz Brzęczyszczykiewicz), once we learn that Z modifies sounds in Polish just like H in English sh, ch, zh, it gets much easier. So:&lt;/p&gt;

&lt;table&gt;&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Polish&lt;/th&gt;
&lt;th&gt;English approximate&lt;/th&gt;
&lt;th&gt;Example first name&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;cz&lt;/td&gt;
&lt;td&gt;ch as in cheese&lt;/td&gt;
&lt;td&gt;&lt;a href=&#34;https://upload.wikimedia.org/wikipedia/commons/5/5a/Pl-Czes%C5%82aw.ogg&#34;&gt;Czesław&lt;/a&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;sz&lt;/td&gt;
&lt;td&gt;sh as in fresh&lt;/td&gt;
&lt;td&gt;&lt;a href=&#34;https://upload.wikimedia.org/wikipedia/commons/3/3e/Pl-Bartosz.ogg&#34;&gt;Bartosz&lt;/a&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;rz&lt;/td&gt;
&lt;td&gt;z  as in azure&lt;/td&gt;
&lt;td&gt;&lt;a href=&#34;https://upload.wikimedia.org/wikipedia/commons/2/20/Pl-Marzena.ogg&#34;&gt;Marzena&lt;/a&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;szcz&lt;/td&gt;
&lt;td&gt;sh ch as in fresh cheese&lt;/td&gt;
&lt;td&gt;Mszczuj (relax, it&amp;rsquo;s very uncommon!)&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;

&lt;p&gt;Now you&amp;rsquo;re ready to pronounce &lt;a href=&#34;https://youtu.be/AfKZclMWS1U?t=1&#34;&gt;Grzegorz Brzęczyszczykiewicz&lt;/a&gt; correctly enough to earn beers from your Polish friends down at the pub. You may as well stop here but the further you go the better you will pronounce!&lt;/p&gt;

&lt;p&gt;The natural next step are some Polish-only letters and letters pronounced differently than in English:&lt;/p&gt;

&lt;table&gt;&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Polish&lt;/th&gt;
&lt;th&gt;English approximate&lt;/th&gt;
&lt;th&gt;Example name&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;ą&lt;/td&gt;
&lt;td&gt;Nasal &lt;strong&gt;o&lt;/strong&gt;, as in French sont&lt;/td&gt;
&lt;td&gt;surname Bąk&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;ć, ci&lt;/td&gt;
&lt;td&gt;As cz, but softer&lt;/td&gt;
&lt;td&gt;surname Cichy&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;ę&lt;/td&gt;
&lt;td&gt;Nasal e, as in French vin&lt;/td&gt;
&lt;td&gt;surname Sęk&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;j&lt;/td&gt;
&lt;td&gt;y as in yes&lt;/td&gt;
&lt;td&gt;&lt;a href=&#34;https://upload.wikimedia.org/wikipedia/commons/0/05/Pl-Jan.ogg&#34;&gt;Jan&lt;/a&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;ł&lt;/td&gt;
&lt;td&gt;w as in window&lt;/td&gt;
&lt;td&gt;&lt;a href=&#34;https://upload.wikimedia.org/wikipedia/commons/e/e9/Pl-S%C5%82awomira.ogg&#34;&gt;Sławomira&lt;/a&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;ń, ni&lt;/td&gt;
&lt;td&gt;ny in canyon&lt;/td&gt;
&lt;td&gt;&lt;a href=&#34;https://upload.wikimedia.org/wikipedia/commons/d/d4/Pl-Stanis%C5%82aw.ogg&#34;&gt;Stanisław&lt;/a&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;ś, si&lt;/td&gt;
&lt;td&gt;As sz, but softer&lt;/td&gt;
&lt;td&gt;Jaś (nickname of Jan)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;w&lt;/td&gt;
&lt;td&gt;v as in very&lt;/td&gt;
&lt;td&gt;&lt;a href=&#34;https://upload.wikimedia.org/wikipedia/commons/d/d5/Pl-W%C5%82adys%C5%82aw.ogg&#34;&gt;Władysław&lt;/a&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;y&lt;/td&gt;
&lt;td&gt;approx. i as in bin&lt;/td&gt;
&lt;td&gt;&lt;a href=&#34;https://upload.wikimedia.org/wikipedia/commons/8/8c/Pl-Tytus.ogg&#34;&gt;Tytus&lt;/a&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;ź, zi&lt;/td&gt;
&lt;td&gt;As rz, but softer&lt;/td&gt;
&lt;td&gt;surname Ziarno&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;ż&lt;/td&gt;
&lt;td&gt;Same as rz&lt;/td&gt;
&lt;td&gt;&lt;a href=&#34;https://upload.wikimedia.org/wikipedia/commons/a/a6/Pl-B%C5%82a%C5%BCej.ogg&#34;&gt;Błażej&lt;/a&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;

&lt;p&gt;The ones with surnames as exmaple are very uncommon in first names - the reason is that while surnames are usually Slavic in origin, first names usually have Latin, Greek, Hebrew and otherwise Biblical roots, with a few common Slavic first names - so they do not have typical Polish/Slavic sounds. ś, ć, ń, being soft, unvoiced and therefore cute usually occur in nicknames (Sławomir -&amp;gt; Sławuś, Przemysław -&amp;gt; Przemuś, etc.) but rarely in full names. This function is nearly identical to Japanese -chan.&lt;/p&gt;

&lt;p&gt;Now, the two final rules which will make you sound as a native. The second-last syllable is accented (pronounced louder). Examples: &lt;a href=&#34;https://upload.wikimedia.org/wikipedia/commons/7/77/Pl-Barbara.ogg&#34;&gt;barBAra&lt;/a&gt;, &lt;a href=&#34;https://upload.wikimedia.org/wikipedia/commons/4/4c/Pl-Ada.ogg&#34;&gt;Ada&lt;/a&gt;, &lt;a href=&#34;https://upload.wikimedia.org/wikipedia/commons/2/20/Pl-Marzena.ogg&#34;&gt;maRZEna&lt;/a&gt;, &lt;a href=&#34;https://upload.wikimedia.org/wikipedia/commons/0/05/Pl-Jan.ogg&#34;&gt;jan&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;In clusters of unvoiced (p, k, t, s, w, sz) + voiced (b, g, d, z, f, rz/ż) consonants, and when the voiced phoneme is at the end of the word, the voiced consonant becomes unvoiced. Examples: Krzysztof -&amp;gt; &lt;a href=&#34;https://upload.wikimedia.org/wikipedia/commons/c/c1/Pl-Krzysztof.ogg&#34;&gt;Kszysztof&lt;/a&gt;, Przemysław -&amp;gt; &lt;a href=&#34;https://upload.wikimedia.org/wikipedia/commons/b/be/Pl-Przemys%C5%82aw.ogg&#34;&gt;Pszemysłaf&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;This concludes all but the most rare rules of Polish pronunciation. Now go and train on your colleagues names, and earn their neverending respect.&lt;/p&gt;

&lt;p&gt;Contributed by: Przemysław Buczkowski (&lt;a href=&#34;mailto:prem@prem.moe&#34;&gt;prem@prem.moe&lt;/a&gt;) (Use my name to train, I don&amp;rsquo;t mind!)&lt;/p&gt;

&lt;p&gt;Links:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href=&#34;https://pl.wikipedia.org/wiki/Wikipedysta:Pawe%C5%82_Ziemian/imiona&#34;&gt;https://pl.wikipedia.org/wiki/Wikipedysta:Pawe%C5%82_Ziemian/imiona&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;https://en.wikipedia.org/wiki/Help:IPA/Polish&#34;&gt;https://en.wikipedia.org/wiki/Help:IPA/Polish&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;https://en.wikipedia.org/wiki/Polish_phonology&#34;&gt;https://en.wikipedia.org/wiki/Polish_phonology&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;https://en.wikipedia.org/wiki/Polish_name&#34;&gt;https://en.wikipedia.org/wiki/Polish_name&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
</content>

            
                <category term="Languages" />
            
        </entry>
    
        <entry>
            <title>Enforcing work-life balance with bash scripting, or targeted ways to kill Linux programs</title>
            <link rel="alternate" href="https://prem.moe/2021/02/04/Enforcing-work-life-balance-with-bash/" type="text/html" />
            <id>https://prem.moe/2021/02/04/Enforcing-work-life-balance-with-bash/</id>
            <updated>2021-02-04T01:00:00Z</updated>

            <summary type="html">In the days of the pandemic (let it be damned) we more often than ever work from home
and, somewhat naturally, use one device both for work and out of it &amp;mdash; for relax, hobbies, whatever.</summary>
            <content type="html">&lt;p&gt;In the days of the pandemic (let it be damned) we more often than ever work from home
and, somewhat naturally, use one device both for work and out of it &amp;mdash; for relax, hobbies, whatever.&lt;/p&gt;

&lt;p&gt;If you are one of these people, you for sure noticed an interesting phenomenon &amp;mdash; working hours
are no more, and you find yourself answering e-mails from your work mailbox late at night, for
a simple reason that you use the same e-mail client for your work, personal, and university accounts, 
so you do not close it. Ever. And it would linger at your mind if you did not respond.&lt;/p&gt;

&lt;p&gt;Living 24/7 between the keyboard and the chair is something what many of us find acceptable.&lt;/p&gt;

&lt;p&gt;Working 24/7 not so much and it is sometimes hard to notice that we are in fact doing that.&lt;/p&gt;

&lt;p&gt;Yes, I am a work-a-holic, and I need some help to forget about all this.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Let me show you some Unix command-line tools which will butcher the shit out of these pesky work programs.&lt;/em&gt;
Manual pages conveniently linked.&lt;/p&gt;
&lt;h2&gt;Solutions?&lt;/h2&gt;
&lt;p&gt;One solution would be to keep two accounts and switch between them, or even have two computers.&lt;/p&gt;

&lt;p&gt;This really works only when you do nothing but work during work hours. I like being able to check
my personal e-mail, order something or check my uni assignments during breaks or when the code is compiling.&lt;sup id=&#34;fnref1&#34; class=&#34;footnotes-ref&#34;&gt;&lt;a href=&#34;#fn1&#34; rel=&#34;footnote&#34;&gt;1&lt;/a&gt;&lt;/sup&gt;&lt;/p&gt;

&lt;p&gt;&lt;img src=&#34;https://imgs.xkcd.com/comics/compiling.png&#34; alt=&#34;Compiling&#34;&gt;&lt;/p&gt;

&lt;p&gt;I naturally drifted back to using one account.&lt;/p&gt;
&lt;h2&gt;Then what?&lt;/h2&gt;
&lt;p&gt;What I usually did is that when I was done I closed all the windows pertaining to my job. Sounds trivial, but
as I mentioned above, my email client still shouted notifications at me. I used to forget to close my Slack client, and it reminded me of its existence sooner or later.
I had multiple PyCharm windows open and the forgotten
work repo would get my attention it should not get.&lt;/p&gt;
&lt;h2&gt;Let&amp;rsquo;s script it, or killing processes by their name&lt;/h2&gt;
&lt;p&gt;In the end, I made a &lt;a href=&#34;https://www.gnu.org/software/bash/manual/bash.html#Introduction&#34;&gt;bash&lt;/a&gt; script which starts all I need for work and another that makes it all fuck off.&lt;/p&gt;
&lt;pre&gt;&lt;code data-lang=&#34;shell&#34;&gt;#!&amp;#x2F;bin&amp;#x2F;bash
# nohup makes the program not quit when the script finishes.
# &amp;amp; makes the program run in the background.
nohup thunderbird &amp;amp;
nohup ripcord &amp;amp;
nohup pycharm-professional &amp;amp;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;The latter is named &lt;code&gt;dość&lt;/code&gt; (Polish for &lt;code&gt;enough&lt;/code&gt;) and it ruthlessly murders all this shit with &lt;a href=&#34;https://man.archlinux.org/man/killall.1.en&#34;&gt;killall&lt;/a&gt;:&lt;/p&gt;
&lt;pre&gt;&lt;code data-lang=&#34;shell&#34;&gt;killall thunderbird
killall ripcord  # Slack client I use
killall pycharm.sh
systemctl stop docker
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Wait, what about your other e-mail boxes? Or personal PyCharm projects? Or these Docker containers you play around with?&lt;/p&gt;
&lt;h3&gt;Thunderbird, or killing processes by their launch command&lt;/h3&gt;
&lt;p&gt;What we need here are Thunderbird profiles. I run two Thunderbird instances, one for
the work e-mail and one for everything else. To create them, you need to run &lt;code&gt;thunderbird --ProfileManager&lt;/code&gt;,
create profiles and from now on it will ask you at each startup which one you want to run.&lt;/p&gt;

&lt;p&gt;Conveniently you can select a profile with a run-time argument, so put &lt;code&gt;thunderbird -P Work&lt;/code&gt; in your &lt;code&gt;work&lt;/code&gt; script.&lt;/p&gt;

&lt;p&gt;&lt;img src=&#34;/assets/images/blog/thunderbird_profiles.png&#34; alt=&#34;Thunderbird profile manager.&#34;&gt;&lt;/p&gt;

&lt;p&gt;The next step is to make &lt;code&gt;enough&lt;/code&gt; kill only the instance running the work profile. Behold:&lt;/p&gt;
&lt;pre&gt;&lt;code data-lang=&#34;shell&#34;&gt;# Slaughtering the work mailbox.
THUNDERBIRD_PID=$(pgrep -a thunderbird | grep Work | cut -f1 -d&amp;quot; &amp;quot;)
if [ $THUNDERBIRD_PID ] 
then
        echo &amp;quot;&amp;#x27;Only one more mail&amp;#x27;? Fuck off with this non-sense.&amp;quot;
        kill $THUNDERBIRD_PID
fi
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;a href=&#34;https://man.archlinux.org/man/pgrep.1&#34;&gt;&lt;code&gt;pgrep&lt;/code&gt;&lt;/a&gt; &lt;code&gt;-a&lt;/code&gt; prints &lt;abbr title=&#34;Process identifier&#34;&gt;PID&lt;/abbr&gt;s of all Thunderbird instances along with the command
used to launch them. We filter (&lt;a href=&#34;https://man.archlinux.org/man/grep.1&#34;&gt;&lt;code&gt;grep&lt;/code&gt;&lt;/a&gt;) the instances by the ones launched with &lt;code&gt;Work&lt;/code&gt; in command line and then use
&lt;a href=&#34;https://man.archlinux.org/man/core/coreutils/cut.1.en&#34;&gt;&lt;code&gt;cut&lt;/code&gt;&lt;/a&gt; to get the first field (PID) and discard the others (launch command).&lt;/p&gt;

&lt;p&gt;If there is one, we print out, ekhm, &lt;em&gt;celebratory&lt;/em&gt; message and kill it. Easy.&lt;/p&gt;
&lt;h3&gt;PyCharm, or closing windows by their title&lt;/h3&gt;
&lt;p&gt;For PyCharm, we would like to close our work projects but leave our pet projects open. For this we will use
&lt;a href=&#34;https://man.archlinux.org/man/community/wmctrl/wmctrl.1.en&#34;&gt;&lt;code&gt;wmctrl&lt;/code&gt;&lt;/a&gt; command.&lt;/p&gt;
&lt;pre&gt;&lt;code data-lang=&#34;shell&#34;&gt;# Murdering the work project window

PYCHARM_PROJECT_NAME=&amp;quot;work-project&amp;quot;
PYCHARM_WINDOW_ID=$(wmctrl -l | grep $PYCHARM_PROJECT_NAME | cut -f1 -d&amp;quot; &amp;quot;)
if [ $PYCHARM_WINDOW_ID ]
then
        echo &amp;quot;Time to code something you do not have to.&amp;quot;
        echo &amp;quot;Closing the work project.&amp;quot;
        wmctrl -ic $PYCHARM_WINDOW_ID
fi
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;code&gt;wmctrl -l&lt;/code&gt; prints all windows. &lt;code&gt;grep&lt;/code&gt; gets the window with the project name in title. &lt;code&gt;cut&lt;/code&gt; gets the window ID.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;wmctrl -ic&lt;/code&gt; sends the close signal to the window. Since it works exactly as if you pressed &lt;code&gt;Alt-F4&lt;/code&gt;, PyCharm will ask you to confirm.&lt;/p&gt;
&lt;h3&gt;Docker Compose, or stopping unneeded containers&lt;/h3&gt;
&lt;p&gt;The last step is to step the containers started by the work project. In my case, they are hopelessly heavy and make me forget that my laptop is rather new and fast.&lt;/p&gt;

&lt;p&gt;So instead of running &lt;a href=&#34;https://docs.docker.com/compose/&#34;&gt;&lt;code&gt;docker-compose&lt;/code&gt;&lt;/a&gt; &lt;code&gt;stop&lt;/code&gt;, let&amp;rsquo;s check if any containers are running, print a snarky message and kill &amp;lsquo;em.&lt;/p&gt;
&lt;pre&gt;&lt;code data-lang=&#34;shell&#34;&gt;DOCKER_COMPOSE_FILE=&amp;quot;~&amp;#x2F;work-project&amp;#x2F;docker-compose.yml&amp;quot;
if docker-compose -f $DOCKER_COMPOSE_FILE ps | grep Up
then
        echo Stopping voluptuous containers.
        docker-compose -f $DOCKER_COMPOSE_FILE stop
fi
&lt;/code&gt;&lt;/pre&gt;&lt;h2&gt;Enough is enough&lt;/h2&gt;
&lt;p&gt;The next step is to say enough and run the script. Every day.&lt;/p&gt;

&lt;p&gt;Are you too much of a work-a-holic and are staying late anyway?
Make your computer slaughter that shite when you should not be working.
Your mental health will thank you.&lt;/p&gt;

&lt;p&gt;The standard Linux tool to run commands at given time is &lt;a href=&#34;https://wiki.archlinux.org/index.php/cron&#34;&gt;&lt;code&gt;cron&lt;/code&gt;&lt;/a&gt;.
To add a new task, run &lt;a href=&#34;https://wiki.archlinux.org/index.php/Cron#Basic_commands&#34;&gt;&lt;code&gt;crontab -e&lt;/code&gt;&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;In there you can define a task:&lt;/p&gt;
&lt;pre&gt;&lt;code data-lang=&#34;shell&#34;&gt;# Numbers are minute, hour, day, month, day of week
0 19 * * * &amp;#x2F;usr&amp;#x2F;local&amp;#x2F;bin&amp;#x2F;enough
&lt;/code&gt;&lt;/pre&gt;&lt;h2&gt;Let&amp;rsquo;s have time for stupid things&lt;/h2&gt;
&lt;p&gt;Hopefully this post showed you at least one new command to play with.
Even if it did not, and you find my method asinine, 
maybe the post convinced you to make sure that you do not stay working longer than you should.&lt;/p&gt;

&lt;p&gt;Take care of yourselves! And let me know what methods you have to deal with the problem.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Final version of &lt;code&gt;dość&lt;/code&gt; with some healthy Polish swearing and waiting for the command to exit is &lt;a href=&#34;https://gist.github.com/przemub/30ff4c376dd2469ad4ad63322ccc8291&#34;&gt;here&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;Final version of &lt;code&gt;work&lt;/code&gt; with checking if the program is already running and starting them in different &lt;a href=&#34;https://i3wm.org/&#34;&gt;i3&lt;/a&gt; workspaces is &lt;a href=&#34;https://gist.github.com/przemub/0c9648d0deacc2ec7a4af63a2aaa9182&#34;&gt;here&lt;/a&gt;.&lt;/li&gt;
&lt;/ul&gt;
&lt;div class=&#34;footnotes&#34;&gt;&lt;ol&gt;&lt;li id=&#34;fn1&#34; class=&#34;footnotes-def&#34;&gt;&lt;p&gt;Nowadays it may be more appropriate to say &amp;ldquo;My Docker containers are rebuilding.&amp;rdquo;&amp;nbsp;&lt;a href=&#34;#fnref1&#34; rev=&#34;footnote&#34;&gt;↩&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;&lt;/ol&gt;&lt;/div&gt;</content>

            
                <category term="Linux" />
            
                <category term="Tech" />
            
        </entry>
    
        <entry>
            <title>Adding templates to your static website with mynt and jinja2</title>
            <link rel="alternate" href="https://prem.moe/2020/05/29/Adding-templates-to-your-static-website-with-mynt-and-jinja2/" type="text/html" />
            <id>https://prem.moe/2020/05/29/Adding-templates-to-your-static-website-with-mynt-and-jinja2/</id>
            <updated>2020-05-29T19:39:00Z</updated>

            <summary type="html">&amp;hellip;is what this page is a result of and this post documents my progress!</summary>
            <content type="html">&lt;p&gt;&amp;hellip;is what this page is a result of and this post documents my progress!&lt;/p&gt;
&lt;h3&gt;Introduction&lt;/h3&gt;
&lt;p&gt;I&amp;rsquo;m working with Django all day so naturally I often use it for side-projects.
Have you ever had a situation like this, though:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;This teeny-weeny website I want to make does not warrant a full-blown framework, let&amp;rsquo;s just write some HTML!&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Having taken this perfectly reasonable decision, you make the website and everything is fine. That&amp;rsquo;s how it was with this very website.&lt;/p&gt;

&lt;p&gt;For some time, that is. Then you add pages, make changes in the menu, change the footer, etc. and you end up having to copy markup between all files. Horrid, unmaintable mess!&lt;/p&gt;

&lt;p&gt;Django, Flask or whatever is hip now is still far too much, so you think:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;I could simply separate content from structure if I just had templates&amp;hellip;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Static site generators are supposed to come to help. Having never used them, I landed on &lt;a href=&#34;https://www.fullstackpython.com/static%E2%80%94site%E2%80%94generator.html&#34;&gt;this list by Full Stack Python&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;While browsing through these, I had one thought — this is all so complex! I just wanted to quickly add some templates to my website, not to convert my stuff to a CMS.&lt;/p&gt;

&lt;p&gt;I checked a few and finally found that &lt;a href=&#34;https://mynt.uhnomoli.com/&#34;&gt;mynt&lt;/a&gt; fits my criteria and allows me to build on the top of my HTML. So let&amp;rsquo;s have a try!&lt;/p&gt;
&lt;h3&gt;Conversion&lt;/h3&gt;
&lt;p&gt;Install mynt globally or in a &lt;a href=&#34;https://docs.python.org/3/tutorial/venv.html&#34;&gt;virtual environment&lt;/a&gt; on your system using command &lt;code&gt;pip install mynt&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;All you need to do for mynt to recognise your site is to create a configuration file named &lt;code&gt;mynt.yml&lt;/code&gt;. For now all we need to set is the URL to your assets directory &amp;ndash; add &lt;code&gt;assets_url: /assets&lt;/code&gt;. Adjust the URL if you want to serve them from somewhere else. See &lt;a href=&#34;https://mynt.uhnomoli.com/docs/configuration/&#34;&gt;here&lt;/a&gt; for all the options.&lt;/p&gt;

&lt;p&gt;You need to move your assets to a folder &lt;code&gt;\_assets&lt;/code&gt; for them to be copied to &lt;code&gt;/assets&lt;/code&gt; directory when the website is generated.&lt;/p&gt;

&lt;p&gt;You can then generate a website: &lt;code&gt;mynt generate \_build&lt;/code&gt;, or generate on every file change &lt;code&gt;mynt watch —f . \_destination&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;\_build&lt;/code&gt; will be just a raw copy of what you had earlier — the great thing about mynt is that you can consecutively use both your newly written, templated pages and the old stuff. let&amp;rsquo;s use the new abilities!&lt;/p&gt;
&lt;h3&gt;Templates&lt;/h3&gt;
&lt;p&gt;All directories beginning with an underscore are either special or ignored.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;_templates&lt;/code&gt; is a directory where &lt;a href=&#34;https://jinja.palletsprojects.com/en/2.11.x/&#34;&gt;jinja2&lt;/a&gt; — templating engine similar to the one used by Django — searches for templates to extend from.&lt;/p&gt;

&lt;p&gt;Let&amp;rsquo;s say you already have an &lt;code&gt;index.html&lt;/code&gt; just like this one:&lt;/p&gt;
&lt;pre&gt;&lt;code data-lang=&#34;html&#34;&gt;&amp;lt;!doctype html&amp;gt;
&amp;lt;html&amp;gt;
&amp;lt;head&amp;gt;
    &amp;lt;title&amp;gt;Home page — prem.moe&amp;lt;&amp;#x2F;title&amp;gt;
&amp;lt;&amp;#x2F;head&amp;gt;
&amp;lt;body&amp;gt;
    &amp;lt;nav&amp;gt;&amp;lt;a href=&amp;quot;&amp;#x2F;&amp;quot;&amp;gt;Home page&amp;lt;&amp;#x2F;a&amp;gt;&amp;lt;&amp;#x2F;nav&amp;gt;
    &amp;lt;main&amp;gt;
        Hello world!
    &amp;lt;&amp;#x2F;main&amp;gt;
&amp;lt;&amp;#x2F;body&amp;gt;
&amp;lt;&amp;#x2F;html&amp;gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Since the reason to do templating is to re-use common structure, we&amp;rsquo;ll split this file into &lt;code&gt;_templates/main.html&lt;/code&gt; and &lt;code&gt;index.html&lt;/code&gt;. The template will look like this:&lt;/p&gt;
&lt;pre&gt;&lt;code data-lang=&#34;html&#34;&gt;&amp;lt;!doctype html&amp;gt;
&amp;lt;html&amp;gt;
&amp;lt;head&amp;gt;
    &amp;lt;title&amp;gt;{{ title }} — prem.moe&amp;lt;&amp;#x2F;title&amp;gt;
&amp;lt;&amp;#x2F;head&amp;gt;
&amp;lt;body&amp;gt;
    &amp;lt;nav&amp;gt;&amp;lt;a href=&amp;quot;&amp;#x2F;&amp;quot;&amp;gt;Home page&amp;lt;&amp;#x2F;a&amp;gt;&amp;lt;&amp;#x2F;nav&amp;gt;
    &amp;lt;main&amp;gt;
        {% block content %}
        {% endblock %}
    &amp;lt;&amp;#x2F;main&amp;gt;
&amp;lt;&amp;#x2F;body&amp;gt;
&amp;lt;&amp;#x2F;html&amp;gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;And your new &lt;code&gt;index.html&lt;/code&gt;:&lt;/p&gt;
&lt;pre&gt;&lt;code data-lang=&#34;html&#34;&gt;{% extends &amp;#x27;main.html&amp;#x27; %}
{% set title = &amp;#x27;Home page&amp;#x27; %}

{% block content %}
Hello world!
{% endblock %}
&lt;/code&gt;&lt;/pre&gt;&lt;h3&gt;Conclusion&lt;/h3&gt;
&lt;p&gt;And thus we have achieved separation of content from the structure — and adding new pages or changing common elements is trivial.&lt;/p&gt;

&lt;p&gt;Since the page is static, all you need to do to publish it is to copy &lt;code&gt;_build&lt;/code&gt; contents to your hosting which may be something as simple (and free) as &lt;a href=&#34;https://pages.github.com/&#34;&gt;GitHub Pages&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;The next step to take is to take advantage of all the other features mynt provides — I in particular like &lt;a href=&#34;https://mynt.uhnomoli.com/docs/quickstart/#posts&#34;&gt;posts&lt;/a&gt; and &lt;a href=&#34;https://mynt.uhnomoli.com/docs/quickstart/#tagging&#34;&gt;their tagging&lt;/a&gt; which can generate categories and archives based on your templates — this is such a post and you can click on the categories at the top to see what a category archive looks like.&lt;/p&gt;

&lt;p&gt;Having a trivial template generate an Atom feed struck me as genius and showing the flexibility of the system. Have I mentioned &lt;a href=&#34;https://mynt.uhnomoli.com/docs/configuration/#pygmentize&#34;&gt;syntax highlighting&lt;/a&gt;? For now that&amp;rsquo;s all I need!&lt;/p&gt;

&lt;p&gt;Adding these will probably be a subject of the next entry. In the meantime — happy hacking!&lt;/p&gt;
</content>

            
                <category term="Python" />
            
                <category term="Tech" />
            
        </entry>
    
        <entry>
            <title>HPE Proliant MicroServer Gen10 review</title>
            <link rel="alternate" href="/machines.html#hpe" type="text/html">
            <updated>2021-11-04T22:01:00Z</updated>
            <content type="html">
    <p>I absolutely adore this little thing. If I wanted, I could change nearly any part (except the CPU) in the next 30 seconds, with no tools. It is a marvel of design, even though HP, and its enterprise arm, are not particularly known for their design. In such a tiny box, they fitted four disk bays, an optical disk bay, two RAM slots, two low-profile PCI-E slots, two Gigabit Ethernet cards, two USB in the front and two in the back. There is also a HPE-branded pen-drive stuck in an internal USB port if you want to use it and/or the port for whatever reason &ndash; like sticking a USB TV tuner inside! Oh, and there is a VGA and HDMI output if you want to make it a home entertainment centre.</p>
    <p>Now, the downside. <a href="https://www.cpubenchmark.net/cpu.php?cpu=AMD+Opteron+X3421+APU&id=3026">AMD Opteron X3421</a>, which I have in my SKU, is not particularly powerful, but I found it more than enough to run two virtual machines and 10-20 Docker containers with some spare. There is 8 GB or 16 GB of RAM by default, but you can easily expand it to 32 GB &ndash; I promptly did that. On the other hand, the power consumption is incredibly low. It is around 33 W/h (<a href="https://www.servethehome.com/hpe-proliant-microserver-gen10-review/5/">source</a>). It is important in the times when electricity prices in the UK went absolutely crazy, lol! Unless the CPU usage is maxed out, it is also very quiet, what is great considering it runs from my windowsill.</p>
    <p>Overall, I recommend the server wholeheartedly. I bought it when it had been on the market only for one year but I imagine you will be able to get some amazing deals on this little machine in the coming years. It also can give you a warm, fuzzy feeling of having your e-mails stored next to you instead of on the secret Google/Microsoft/Apple/whatever servers. 9/10.</p>
            </content>
        </entry>

        <entry>
            <title>Lenovo ThinkPad T495s review</title>
            <link rel="alternate" href="/machines.html#t495s" type="text/html">
            <updated>2021-09-13T22:15:00Z</updated>
            <content type="html">
    <p>Oh God, that has been a catastrophe. The great keyboard is there, so is the touchpad and the signature <a href="https://xkcd.com/243/">nipple mouse</a>. Despite all that, it is simply unreliable&nbsp;&ndash;&nbsp;it overheats so much, with the fan not turning its speed up when needed. The battery life after a couple of months fell below 2 hours. The USB controller is… funky, with Plug and Play failing from time to time on all kinds of Linux distros.</p>
    <p>On the plus side, the performance of Ryzen 7 3400U is awesome &ndash; as long as you use external peripherals as not to fry your hands and lap. I even created <a href="https://github.com/przemub/thinkindicator">this tiny widget</a> to relieve my organs. I have learnt some GTK in the progress, so that's a plus, I guess?</p>
    <p>I will be re-selling this one once I find a suitable replacement, and it is probably the end of buying ThinkPads for me. 3/10.</p>
            </content>
        </entry>
</feed>
