<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Derrick Gee on Medium]]></title>
        <description><![CDATA[Stories by Derrick Gee on Medium]]></description>
        <link>https://medium.com/@antisyllogism?source=rss-43a6fe57b83c------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*aO1DKW4S6Z2PtfGYxh6r2w.jpeg</url>
            <title>Stories by Derrick Gee on Medium</title>
            <link>https://medium.com/@antisyllogism?source=rss-43a6fe57b83c------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Wed, 02 Dec 2026 08:07:05 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@antisyllogism/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[How To Vim — Beginner Basics]]></title>
            <link>https://antisyllogism.medium.com/how-to-vim-beginner-basics-fbfc1fd44c6d?source=rss-43a6fe57b83c------2</link>
            <guid isPermaLink="false">https://medium.com/p/fbfc1fd44c6d</guid>
            <category><![CDATA[technology]]></category>
            <category><![CDATA[coding]]></category>
            <category><![CDATA[vim]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[software-development]]></category>
            <dc:creator><![CDATA[Derrick Gee]]></dc:creator>
            <pubDate>Wed, 19 May 2021 14:27:51 GMT</pubDate>
            <atom:updated>2021-05-19T16:25:12.105Z</atom:updated>
            <content:encoded><![CDATA[<h3>How To — Vim Beginner Basics</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5PYHbL_I9O-riAzxsjsgkA.png" /></figure><p>Here are some vim tips that should get you up and running starting from zero knowledge of Vim. Why vim? I personally like it because it’s fast to spawn several vim instances within milliseconds, easy to customize your settings and save it to a single config file use on other computers or even servers, it’s highly extensible, and since most keystrokes are a shortcut; you can become very fast at editing text.</p><p>The goal of after reading this is to be able to know how to edit in vim at a slightly faster pace than <em>traditional</em> methods. Hopefully the lists and gifs will be a good reference to learn from, since I’d like to think a majority of people learn better with those than reading a block of text. Assuming familiarity of the terminal, we can open vim with typing in vim in the terminal. If you don’t have vim , then you can search up on how to install it easily with the OS that you currently have. For Windows users, I highly recommend using WSL so that you can use one of the Linux package managers.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*mWK_39YyPxF9DEBYR_Hv0g.gif" /></figure><p>Immediately, we see how to exit. Type :q to exit. Here are some common ways to exit:</p><ul><li>:q — Just quit</li><li>:q! — Quit without saving</li><li>:wq — Save and quit</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5n_U_QcE4hZ1BmRHklxhKA.gif" /><figcaption>Vim cool</figcaption></figure><h3>Movement</h3><p>Okay, so this might be a highly an controversial thing to say, but I think arrow keys are okay to use on a very small keyboard. My current keyboard is a 60%, and the arrow keys are only 2.5 keys away from hjkl. I also have macros on fn+arrow to do specific things because it is easier to do fn+arrow than fn+hjkl . Maybe back in the days of full keyboards, it would have been slow to use arrows over hjkl due to them being several keys apart. I think it’s fine due to the advancement of peripherals in today’s age though. Also, some people in the generation of gamers might feel more comfortable with having their hands more spread apart. With that out of the way, movement in vim can be done with hjkl or up down left right . There will be more movement shortcuts in the modes section below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*u_V-gam-nIklHJWTGnhgZg.gif" /><figcaption>Quitting</figcaption></figure><h3>Modes</h3><p>Vim has modes you need to enter in order to do specific things. This is the very first concept you need to grasp before using Vim. For the most part, you will normally be in insert or normal mode. My gifs will have a plugin called vim-airline that shows which mode you are in with color codes.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*UQto9t5mFVKjk_heQSjYqw.gif" /><figcaption>Vim modes</figcaption></figure><h4>Normal Mode</h4><p>You can get into this mode by pressing esc , you will also start out in this mode when entering a file. Normal mode makes you not able to edit text directly, and makes your keyboard keys into shortcuts for movement and utility. Some common normal mode shortcuts:</p><p><strong>Normal Mode Movement</strong></p><ul><li>o : Create a newline down, go to that line, and go into insert mode</li><li>A : Go to end of line and go into insert mode ($ not going into insert mode)</li><li>I : Go to start of text of line and go into insert mode</li><li>0 : Go to start of line</li><li>w : Move forward a word</li><li>b : Move back a word</li><li>W : Move forward a word separated by whitespace</li><li>B : Move back a word separated by whitespace</li><li>G : Go to end of file</li><li>gg : Go to top of file</li><li>? : Go to command mode and search for a word in file</li><li>shift+up/down : Go one page up or down. PgUp/PgDown also does the same. Defaults are ctrl+f/b , but I recommend keybinding these if you are using arrows.</li><li>11up/down : Go up or down 11 lines. Can replace 11 with any number, I just find 11 to be the easiest to type. Without arrows: 11j/k .</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*dAl9_JzD0v9KKWS-2L1zNQ.gif" /><figcaption>Moving around quickly</figcaption></figure><p><strong>Normal Mode Utility</strong></p><ul><li>u : Undo once</li><li>ctrl+r : Redo once</li><li>dd : Delete (Cut) line</li><li>yy : Yank (Copy) line</li><li>p : Paste</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*AxwXHIvoqp2t-IyC5L9Dww.gif" /><figcaption>Quick utility</figcaption></figure><h4>Insert Mode</h4><p>Hit i while in normal mode to get into insert mode. This mode lets you type in the file, and hit esc to return to normal mode. There are a few shortcuts you can use this in this mode, but I like to keep shortcuts to normal mode only as much as possible.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*r8fOpah9muUlgkHKwovpcQ.gif" /><figcaption>Insert mode</figcaption></figure><h4>Visual Mode</h4><p>This mode is like highlighting text on a browser or any highlightable text on an app. Start out in normal mode, and you can enter one of these 3 sub modes (move around with arrows or hjkl):</p><ul><li>v : Regular visual mode, this is probably the most familiar to most people. It is a similar highlight method to mac or windows, where you can highlight from the cursor forward or backwards.</li><li>V : Visual Line mode, lets you highlight line by line</li><li>ctrl+v : Visual block mode, lets you highlight in a block</li></ul><p>We can perform normal mode shortcuts once we highlight the text we want:</p><ul><li>d : Delete (cut) the highlight</li><li>y : Yank (copy) the highlight</li></ul><p>Now we can start to combine some shortcuts we learned in normal mode with visual mode:</p><ul><li>VG : Highlight from current line to end of file, Vgg to highlight from current line to top of file</li><li>V11down : Highlight from current line to 10 lines down</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*oxyq3UzCdRLgqwA_kTWZ0Q.gif" /><figcaption>Visual Mode</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*cO7EB6OH-_XNdm5fcJIFhA.gif" /><figcaption>Visual Line Mode</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8oa932IUq5p5X4AEMYDIIg.gif" /><figcaption>Visual Block Mode</figcaption></figure><h3>Tips</h3><p>Normal mode shortcuts have a combination feature that is somewhat intuitive. So a will literally mean ‘a’, as in ‘delete a word’, which is actually a shortcut:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8cSZIQ-ZyKR1J1QFrZzsSA.gif" /></figure><p>i in a combination stands for ‘in’, so here is ‘deleting in )’:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xRo5_LfrBZEgj85FdFEPFw.gif" /><figcaption>di” di)</figcaption></figure><p>The shortcut combos kind of have a pythonic psuedocode feel to it where you <em>think </em>it might work, and it actually does work when you try it. I think knowing these shortcut combos will greatly boost the speed of your editing, as it is a lot faster the type daw with one hand rather than move your mouse to the word, double click to highlight the word, and then press backspace to delete.</p><p>Don’t get discouraged if you are slow at first, that’s just life. The learning curve at first might be a little steep, but it plateaus pretty fast after you get used to it. It is true that the more you learn vim, the less you will know about it. However, thinking and gauging whether you should learn this new editing shortcut/method or not is what will make you competent in vim. In the end, everyone has their own preference on how they like to do things, which is arguably the most important factor when deciding on a text editor. More advanced vim topics might come at a later date.</p><p><em>Like my content? </em><a href="https://github.com/kai-dg"><em>Github</em></a><em> — </em><a href="https://twitter.com/the_haru_kai"><em>Twitter</em></a><em> — </em><a href="https://medium.com/@antisyllogism"><em>Medium</em></a><em> — </em><a href="https://ko-fi.com/harukai"><em>Support Me</em></a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=fbfc1fd44c6d" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Tenchijin Tech Talk #2 — Python Speed Optimizations]]></title>
            <link>https://medium.com/tenchijinblog/tenchijin-tech-talk-2-python-speed-optimizations-77dceee0bac1?source=rss-43a6fe57b83c------2</link>
            <guid isPermaLink="false">https://medium.com/p/77dceee0bac1</guid>
            <category><![CDATA[tcj-tech-talk]]></category>
            <category><![CDATA[python]]></category>
            <dc:creator><![CDATA[Derrick Gee]]></dc:creator>
            <pubDate>Wed, 19 May 2021 05:07:21 GMT</pubDate>
            <atom:updated>2021-05-19T05:07:21.372Z</atom:updated>
            <content:encoded><![CDATA[<h3>Tenchijin Tech Talk #2 — Python Optimizations</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*H0SEuH8Ji07Bbcwr.jpg" /></figure><p>I will go over some Python optimization tips in today’s tech talk for Tenchijin. These tips are primarily for computation cases, and does not reflect a general use of Python. <strong>Note</strong>: Each function run are in separate files to reduce amount of benchmark errors, but I will put them all in 1 code section for each topic for this article.</p><h4>Utils</h4><p>There are some packages required to run this demo:</p><pre># requirements<br>import numpy<br>import pympler</pre><pre># utils.py #<br>get_size(obj):<br>    return asizeof.asizeof(obj)</pre><pre>to_sec(result):<br>    &quot;&quot;&quot;convert time result to seconds or milliseconds&quot;&quot;&quot;<br>    convert = result / 1.0<br>    if convert &lt; 0.001:<br>        convert = result / 1e-3<br>        return f&quot;{convert:.8f}ms&quot;<br>    return f&quot;{convert:.4f}&quot;</pre><pre># globals.py<br>N = 50000000 # make this whatever you want</pre><h4>Loop Speed</h4><p><strong>Remember to separate each function into different files</strong>. Use for loops over while loops in general, since while loops are slower. They are generally good for waiting for something instead of iterating through something.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/612/1*hgNjAQjwl_3cKuj-j8QR0g.png" /></figure><pre>import timeit<br>from myglobals import N<br>from utils import to_sec</pre><pre>def for_is_fast():<br>    a = 0<br>    #b = 0<br>    for i in range(N):<br>        a += i<br>    #    b += i<br>    print(f&quot;for result: {a}&quot;)<br>    return a</pre><pre>print(f&quot; &gt; for loop: {to_sec(timeit.timeit(for_is_fast, number=1))}&quot;)</pre><pre>def while_is_slow():<br>    idx = 0<br>    a = 0<br>    while idx &lt; N:<br>        a += idx<br>        idx += 1<br>    print(f&quot;while result: {a}&quot;)<br>    return a</pre><pre>print(f&quot; &gt; while loop: {to_sec(timeit.timeit(while_is_slow, number=1))}&quot;)</pre><h4>Generators</h4><p>Generators can replace some iterators that you will usually encounter. Here is a link to a good example on when and how to use generators: <a href="https://wiki.python.org/moin/Generators">docs</a>.</p><h4>Conditional Returns</h4><p>I have seen some people use the if something; return this; return that format before. More times then not, they are using this format thinking that skipping else statement would make it return earlier than with the else statement. After testing it myself, I can conclude that the margin of error is big enough to say that there is really no difference in performance to do any of these types of returns.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/498/1*UkDfAK4B8y7pFDjUMFIE-Q.png" /></figure><pre>import timeit<br>from utils import to_sec</pre><pre>def earlyreturn():<br>    a = 0<br>    if a != 0:<br>        return 1<br>    return a</pre><pre>def latereturn():<br>    a = 0<br>    if a != 0:<br>        return 1<br>    else:<br>        return a</pre><pre>def ternaryreturn():<br>    a = 0<br>    return 1 if a != 0 else a</pre><pre># copy the timeit print from first example, remember to separate each function into it&#39;s own file</pre><h4>Python Raw vs Builtins</h4><p>Making a sum function in Python is slower than the built-in sum function, as the built-ins themselves are written in C.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/560/1*p2ApvRil59Jgna_7L6hlWw.png" /></figure><pre>import timeit<br>from myglobals import N<br>from utils import to_sec</pre><pre>def pythonsumloop():<br>    res = 0<br>    for i in range(N):<br>        res += i<br>    return res</pre><pre>print(f&quot; &gt; python loop:\t{to_sec(timeit.timeit(pythonsumloop, number=1))}&quot;)</pre><pre>def pythonsumrange():<br>    res = sum(range(0, N))<br>    return res</pre><pre>print(f&quot; &gt; python sum:\t{to_sec(timeit.timeit(pythonsumrange, number=1))}&quot;)</pre><h4>Python Builtin vs Numpy</h4><p>When it comes to arithmetic, numpy will generally be faster than the builtins in Python.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/552/1*Nefvh-sydJHxoioaXyAS_Q.png" /></figure><pre>import timeit<br>import numpy<br>from myglobals import N<br>from utils import to_sec</pre><pre>def numpysum():<br>    res = numpy.sum(numpy.arange(N))<br>    return res</pre><pre>print(f&quot; &gt; numpy sum:\t{to_sec(timeit.timeit(numpysum, number=1))}&quot;)</pre><p>Note that the numpy’s arange function is actually slower at building a list than python’s (3.9.1) built-in range , and this is due to the type of objects that are being made.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/557/1*b6lcUAFHJh3Npdww9KNNsQ.png" /></figure><p>However, using the arange function in numpy’s sum function will outperform the built-in’s range sum combo.</p><p><strong>Recap</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/545/1*7A3I4ZBsJfUGwhILv2G0fQ.png" /></figure><h4>Threading</h4><p>You can take advantage of python’s threading capabilities to run functions in parallel with each other. This can either speed up certain calculations by splitting the load up, and or by splitting up the work of several different functions that are required for the result. I would assume that this is worth it at a big scale, but smaller functions would be better off as simple code.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/556/1*gKAEl-1Q28Q1hP9T1Hkb8w.png" /></figure><pre>import timeit<br>from myglobals import N<br>from utils import to_sec<br>import numpy<br>from threading import Thread</pre><pre>class SumMe:<br>    def __init__(self):<br>        self.res = 0<br>        self.threads = []</pre><pre>def _sum(self, arr):<br>        a = numpy.sum(arr)<br>        self.res += numpy.sum(a)</pre><pre>def _threading(self):<br>        for thread in self.threads:<br>            thread.start()<br>        for thread in self.threads:<br>            thread.join()</pre><pre>def _create_sections(self, amt):<br>        return [int(N/amt) for _ in range(amt)]</pre><pre>def start(self):<br>        arr = numpy.arange(N)<br>        sections = self._create_sections(4) # 4 threads<br>        first = 0<br>        second = sections[0]<br>        for sect in sections:<br>            self.threads.append(Thread(target=self._sum, args=(arr[first:second],)))<br>            second += sect<br>            first += sect<br>        self._threading()</pre><pre>def main():<br>    s = SumMe()<br>    s.start()<br>    return s</pre><pre>print(f&quot; &gt; np thread:\t{to_sec(timeit.timeit(main, number=1))}&quot;)</pre><h4>Python Version Impact</h4><p>Python versions will have certain speed differences in some builtin functions, thus creating a difference in most of your code. You can check out the <a href="https://speed.python.org/comparison/">official benchmark website</a> by Python to see the differences of the major process intensive functions there.</p><h4>Memory Optimization</h4><p>Usually memory isn’t too big of an issue nowadays, but sometimes when dealing with something like cache; a small optimization can lead to a huge change.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/552/1*ClvaAk4LjO4m7oK6hFN09w.png" /></figure><pre>from utils import get_size</pre><pre>class RegularNumbers:<br>    def __init__(self, a, b, c, d):<br>        self.a = a<br>        self.b = b<br>        self.c = c<br>        self.d = d</pre><pre># class<br>    regularclass = RegularNumbers(1, 1, &quot;1&quot;, &quot;1&quot;)<br>    regulardict = {&quot;a&quot;: 1, &quot;b&quot;: 1, &quot;c&quot;: &quot;1&quot;, &quot;d&quot;: &quot;1&quot;}<br>    regularlist = [(&quot;a&quot;, 1), (&quot;b&quot;, 1), (&quot;c&quot;, &quot;1&quot;), (&quot;d&quot;, &quot;1&quot;)]</pre><pre>print(f&quot;class mem:{get_size(regularclass)}b&quot;)<br>    print(f&quot;dict mem: {get_size(regulardict)}b&quot;)<br>    print(f&quot;list mem: {get_size(regularlist)}b&quot;)</pre><p>Enter dataclass with dunder slots, this will be one of the most memory efficient data structure you can use. What __slots__ applies to a class is a list of attributes that can only be in a class, and nothing less or more. My example shows mutable attributes with dunder slots:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/543/1*3WEyDQGVT7Teuz9j9IFH2A.png" /></figure><pre>from utils import get_size<br>from dataclasses import dataclass</pre><pre><a href="http://twitter.com/dataclass">@dataclass</a><br>class DataNumbers:<br>    a: int<br>    b: int<br>    c: str<br>    d: str</pre><pre><a href="http://twitter.com/dataclass">@dataclass</a><br>class DataSlotsNumbers:<br>    __slots__ = [&quot;a&quot;, &quot;b&quot;, &quot;c&quot;, &quot;d&quot;]<br>    a: int<br>    b: int<br>    c: str<br>    d: str</pre><pre>if __name__ == &quot;__main__&quot;:<br>    dc = DataNumbers(1, 1, &quot;1&quot;, &quot;1&quot;)<br>    dcslots = DataSlotsNumbers(1, 1, &quot;1&quot;, &quot;1&quot;)<br>    print(f&quot;dc mem:\t\t{get_size(dc)}b&quot;)<br>    print(f&quot;dc slots mem:\t{get_size(dcslots)}b&quot;)</pre><p>You might notice that the dataclass and regular class have the same memory size. The difference between these 2 is that dataclasses have a few perks, these include: less boilerplate, faster attribute access speed, and other parameters as seen in the <a href="https://docs.python.org/3/library/dataclasses.html">docs</a>.</p><h4>Testing/Benchmarking Traps</h4><p>I have mostly shown examples by running a single file with a single function, this is because function order in python has an effect on it’s speed. Your own PC can also affect the speed, since everyone’s PC runs different processes. If you are doing some intensive process in the background while running a python program, it will be slower than someone else’s PC where they are running almost nothing in the background.</p><h4>Trade-offs: Speed vs Readability</h4><p>This might be somewhat subjective, but Python is supposed to be a language of zen. You can even import the zen of Python by using import this . Python can do some crazy one-liners, but sometimes that is not the best choice as it is not readable. I think this language is already sparse enough in it’s syntax by having short worded syntax and less clutter with no brackets and semicolons. It is pretty sparse that being very explicit with your code is fine to do, because it is usually the case that the code you are writing does not need to be optimized by 5 milliseconds (at least it is less common for a web dev). The usual case is that it is more important to worry about who is going to be reading and maintaining your code next, and if they can pick it up easily or not.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/523/1*YfWKaYS_JNVGr8bTIV4Mbw.png" /><figcaption>Not really readable?</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/468/1*q3VDjRhTeIlTsJUZdDHQjA.png" /><figcaption>More readable than the above?</figcaption></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=77dceee0bac1" width="1" height="1" alt=""><hr><p><a href="https://medium.com/tenchijinblog/tenchijin-tech-talk-2-python-speed-optimizations-77dceee0bac1">Tenchijin Tech Talk #2 — Python Speed Optimizations</a> was originally published in <a href="https://medium.com/tenchijinblog">tenchijinblog</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Essential Plugins For Coding On Vim]]></title>
            <link>https://antisyllogism.medium.com/essential-plugins-for-coding-on-vim-f51dbd927286?source=rss-43a6fe57b83c------2</link>
            <guid isPermaLink="false">https://medium.com/p/f51dbd927286</guid>
            <category><![CDATA[linux]]></category>
            <category><![CDATA[vim]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[coding]]></category>
            <dc:creator><![CDATA[Derrick Gee]]></dc:creator>
            <pubDate>Thu, 06 May 2021 22:25:03 GMT</pubDate>
            <atom:updated>2021-05-06T22:25:03.428Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*cO8JHfowy0zBvUsxOj4N_A.png" /></figure><p>What are the minimum features do you need to code with ease? These are my base plugins I use in order to make Vim/Neovim usable for my development workflow. Feel free to add onto this if you have other plugins in mind, I just think these are good starting plugins. I won’t be going over my config file, but that might write about that in the near future. Read the docs of the plugin if you are having trouble setting it up, they are linked in each plugin section below.</p><h4>Colorscheme</h4><p><a href="https://github.com/ghifarit53/tokyonight-vim">ghifarit53/tokyonight-vim</a></p><p>We stare at our code for long periods of time, so I think it should look nice. You can search for another one that would suit your taste better, or you can make your own custom theme with .Xresources for a uniform color look throughout your system.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/936/1*PEpnUtdRGwbz3aD3rWZUZA.png" /></figure><h4>Search String and File (Fzf + Fzfvim + ProjectRoot)</h4><pre><a href="https://github.com/junegunn/fzf">junegunn/fzf</a><br><a href="https://github.com/junegunn/fzf.vim">junegunn/fzf.vim</a><br><a href="https://github.com/dbakker/vim-projectroot">dbakker/vim-projectroot</a></pre><p>String and file search is one of the best tools you can learn to use while developing. This is because it helps with not losing your train of thought while needing to find something from another file, whether you know the filename or not. ProjectRoot is just fast way to get the project’s root folder to feed to fzf’s command.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/913/1*eo685vFAdwvmbNeqio9opA.png" /><figcaption>File Search</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/905/1*6zN0p6R6znmWs1H2k_fHSg.png" /><figcaption>String Search</figcaption></figure><h4>File Explorer Tree</h4><p><a href="https://github.com/scrooloose/nerdtree">scrooloose/nerdtree</a></p><p>I don’t find myself using this that often when I have file and string search with fzf. Though it is handy at times when you need to keep track of all your files in the same folder while developing.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*hZ5NAO95Kcfdz5KFLvIa7w.png" /></figure><h4>Auto completion/Language Server/Renaming</h4><p><a href="https://github.com/neoclide/coc.nvim">neoclide/coc.nvim</a></p><p>This plugin is good enough for now, but I do want to swap it out later. Coc comes with a lot of useful features. 3 primary ones that I use often are it’s ability to download language servers, auto complete, and renaming.</p><p>I would recommend installing coc-pairs for auto bracket completion, as a base extension for coc.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/497/1*qXZGmQ_DUtQ6UK-XoXEMbw.gif" /><figcaption>coc-pairs</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/748/1*ztx1ey2ix9vNKghhjdNMKQ.png" /><figcaption>Useful print() info, yes</figcaption></figure><h4>Indentation Lines</h4><p><a href="https://github.com/Yggdroot/indentLine">Yggdroot/indentLine</a></p><p>Very good for frontend files, as there are usually a lot more nesting involved with those types of files.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/404/1*TZJ8b08dl_VW_Cru5Dl9yQ.png" /></figure><h4>Block Commenter</h4><p><a href="https://github.com/preservim/nerdcommenter">preservim/nerdcommenter</a></p><p>Sometimes we just want to save a piece of code, but don’t want it to run. Sometimes we just want to talk to ourselves through TODO comments.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/567/1*-bY4aTy1hwycBJf7u9lwbQ.gif" /><figcaption>Block commenting</figcaption></figure><p>These plugins aren’t all that I use on my vim setup, but these are the plugins I would use if I had to make a minimal setup. I know that some of the plugins listed can be scripted within vim, but I am really lazy to figure that out for now. Maybe in the future I will try that out though.</p><p><em>Like my content? </em><a href="https://github.com/kai-dg"><em>Github</em></a><em> — </em><a href="https://twitter.com/the_haru_kai"><em>Twitter</em></a><em> — </em><a href="https://medium.com/@antisyllogism"><em>Medium</em></a><em> — </em><a href="https://ko-fi.com/harukai"><em>Support Me</em></a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f51dbd927286" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Password Manager “pass” — Importing and Exporting]]></title>
            <link>https://antisyllogism.medium.com/password-manager-pass-importing-and-exporting-b206a7eaaa70?source=rss-43a6fe57b83c------2</link>
            <guid isPermaLink="false">https://medium.com/p/b206a7eaaa70</guid>
            <category><![CDATA[tech]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[security]]></category>
            <category><![CDATA[technology]]></category>
            <category><![CDATA[linux]]></category>
            <dc:creator><![CDATA[Derrick Gee]]></dc:creator>
            <pubDate>Sun, 02 May 2021 12:08:19 GMT</pubDate>
            <atom:updated>2021-05-02T22:56:48.932Z</atom:updated>
            <content:encoded><![CDATA[<h3>Password Manager “pass” — Importing and Exporting</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*mfR2ls1FEYfece1vc2zWzA.png" /><figcaption>Photo by <a href="https://unsplash.com/@mattartz?utm_source=medium&amp;utm_medium=referral">Matt Artz</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a> — Edited by me</figcaption></figure><p>I have been using <a href="https://www.passwordstore.org/">pass</a> ever since the day I switched to Linux, because it is simple, lightweight, and scriptable. Recently, I have needed to move this password manager over to another PC and forgot how to do it. So this will be my documentation on importing and exporting pass . If you don’t know what pass is, I recommend checking out my <a href="https://antisyllogism.medium.com/linux-windows-password-manager-pass-e3ad2681ecf3">article</a> on how to set it up. Call me old school, but when it comes to handling passwords; I prefer having an offline password manager rather than it being stored in the cloud where I cannot see the code that is handling that kind of data.</p><h3>gpg</h3><p>Before importing<strong> </strong>your gpg key, we need to know which key is being used on your password manager. <strong>Exporting </strong>our gpg keys require 2 commands:</p><pre>gpg --output MY_FILENAME_public.gpg --armor --export GPG_PUB_KEY<br>gpg --output MY_FILENAME_secret.gpg --armor --export-secret-key GPG_PUB_KEY</pre><p>This will create 2 gpg key files in our current directory. To transfer these keys to a new machine, you can use a USB stick or my personal preferred way is good old scp . If you’re on windows, use WSL to access this command.</p><p>If you want to try to use scp , both PCs will need to be on the same wifi network. Make sure sshd service is enabled on your destination PC, and then check your destination’s PC’s IP address with ip , ifconfig , etc.. the command name will depend on which OS or distro you are on. Once you have your IP, all you need to do is to use this command to send your gpg keys:</p><pre>scp mykey_public.gpg mykey_secret.gpg username@IP_ADDRESS:~/</pre><p>This will send your keys to the home directory of your destination PC. <strong>Importing</strong> it requires 2 commands on your new machine:</p><pre>gpg --import MY_FILENAME_pub.gpg<br>gpg --allow-secret-key-import --import MY_FILENAME_sec.gpg</pre><p>The 2nd command will require the secret key to be in the same directory, so make sure both keys are in the same folder in the above commands you run it with. Note that only importing the public key will allow access to only read the pass folders. Importing the secret key will allow full access, which includes editing with that key.</p><h3>pass</h3><p>pass is just a folder system in your home directory with the name .password-store/ . So the most convenient way to manage this is with the built-in git integration with pass , which automatically pushes to the repo if any changes were made. You can also manually manage git if you wanted to as well. So <strong>exporting</strong> your passwords is just uploading .password-store/ and downloading them on your destination PC. If you prefer to be completely manual, you can also use the above scp method to transfer the entire .password-store/ folder to your destination PC. You could also just keep it on a flash drive as well.</p><p>While pass may not have some fancy features that other password manager apps have, pass is probably one of the most secure password managers out there. The entire point of using a password manager is for security, so I would rather use an open source tool that is publicly available to be audited by anyone, compared to a proprietary tool where we don’t even know what actually happens when we press “Add Password”.</p><p><em>Like my content? </em><a href="https://github.com/kai-dg"><em>Github</em></a><em> — </em><a href="https://twitter.com/the_haru_kai"><em>Twitter</em></a><em> — </em><a href="https://medium.com/@antisyllogism"><em>Medium</em></a><em> — </em><a href="https://ko-fi.com/harukai"><em>Support Me</em></a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b206a7eaaa70" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How To Install Arch Linux (Windows Dualboot)]]></title>
            <link>https://antisyllogism.medium.com/how-to-install-arch-linux-windows-dualboot-fe7e394161bb?source=rss-43a6fe57b83c------2</link>
            <guid isPermaLink="false">https://medium.com/p/fe7e394161bb</guid>
            <category><![CDATA[coding]]></category>
            <category><![CDATA[tech]]></category>
            <category><![CDATA[linux]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[technology]]></category>
            <dc:creator><![CDATA[Derrick Gee]]></dc:creator>
            <pubDate>Tue, 16 Mar 2021 02:56:50 GMT</pubDate>
            <atom:updated>2021-03-18T15:06:11.346Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*glP4IkiSiFv9YRXO" /></figure><p>We are going to be dualbooting Arch Linux on a Windows laptop today. Despite what others say, Arch is relatively easy to setup in comparison to other distros in my opinion. The fact that it is minimal just means that you have minimal things to setup. Sometimes you will run into issues when installing on hardware compared to a VM, so I will also be covering some of my troubleshooting problems at the end.</p><h3>Requirements</h3><p>I recommend having WSL installed on Windows in order to verify the ISO easily in a later step. You will also need an empty USB stick to make a bootable drive. I suggest reading through the <a href="https://wiki.archlinux.org/index.php/Installation_Guide">Arch Installation Guide</a> to get familiar with the steps. While I couldn’t follow the guide fully because of hardware specific errors, it is useful for getting familiar with what Arch needs in order to work. I’ll be trying my best to use layman terms so that hopefully beginners can follow along too.</p><h3>Configuring Window’s Side</h3><p>There are a few steps we need to do on Windows before going into the Arch setup. First we will need to disable fastboot from the battery’s options.</p><h4>Battery</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/873/1*OVTdhiOeXqB9tGtw0WUMAA.png" /></figure><p>This can be found by right-clicking your battery icon from taskbar &gt; power options &gt; (left side) choose what the power button does &gt; (at the top) change settings that are currently unavailable.</p><h4>Partitions</h4><p>Next we will make an empty partition space by going to start menu and searching for “partition”, it should bring up an application that allows you to shrink your storage space.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/750/1*tfLk819yn17RlIg6doUWOQ.png" /></figure><p>Usually it will be disk 0, which is your main drive. You want to shrink the main space (normally C drive) by however much space you want to give your Linux OS.</p><h4>BIOS</h4><p>Next you will want to make sure your bios firmware is up to date. The method to update it will depend on your manufacturer, but typically you will have some kind of program preinstalled to be able to do it. If not, then check their official site for their latest bios firmware. With the bios updated, restart the PC and go into bios (usually F2 or del, depending on your laptop). In the bios, you want to do 2 things:</p><ul><li>Disable Secure Boot</li><li>Change the storage to UEFI mode</li></ul><p>Every bios is a little different, so the method to change these options will vary. Do not worry if you cannot find the UEFI mode option, we can fix that during our Arch install.</p><h4>Download Arch ISO</h4><p>We will download the Arch Linux ISO through torrent from <a href="https://archlinux.org/download/">Arch’s wiki site</a>. After getting the ISO, scroll down a bit and we will verify it with a PGP signature. Download the PGP signature and go to the fingerprint’s link.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/422/1*1q5WF_LHJmNGjAL4J2grkg.png" /></figure><p>At the fingerprint’s link, you should see something like the image below. You want to go to “pub” link and copy the URL address.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/559/1*saXt0m8NWBJ_cPpxUziinQ.png" /></figure><p>After getting the URL address, you want to run gpg --fetch-key &#39;URL_ADDRESS&#39; in your WSL terminal, like in the image below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/879/1*7k6FDK1ZNEL1hj4sNnjSZA.png" /></figure><p>Before running gpg --keyserver-options auto-key-retrive --verify archlinux-*.iso.sig , you want to make sure the .sig and .iso files are in the same directory. Good signature means that it’s good to go, ignore the warning.</p><h4>Bootable Arch Linux ISO</h4><p>Create the bootable usb with rufus, etcher, or whichever you prefer. I’m using rufus. To verify your partition scheme, you will need to look into the drive’s properties from the partition menu from before. If you don’t know how to do that, then I suggest taking a look at my <a href="https://antisyllogism.medium.com/how-to-dual-boot-linux-on-windows-ubuntu-18-04-gnome-e272dd65ac49">Ubuntu dualboot article</a>. Once everything looks good, just hit START to flash Arch onto your USB drive.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/471/1*oCfh1UhfenTT5vDmr8D3kw.png" /></figure><p>Once you have your USB bootable drive, you are all set to work on installing Arch Linux.</p><h3>Installing Arch Linux</h3><p>With the USB still plugged in, go into your BIOS and put the USB drive on the top of the list in your boot list. Save and exit, and it should boot into the Arch bootable loader. If you get an invalid signature/secure boot error when trying to boot into the arch USB, go into your bios and make sure you’ve disable secure boot + fast boot in Window’s battery settings.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/583/1*k0jLoG34DSVFg0ZwZWG5SA.png" /><figcaption>Bootable USB’s loader after changing boot order from BIOS</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/601/1*NLxKQlV1LE_vqlxv5w6l8Q.png" /><figcaption>Replicating my hardware install on a VM</figcaption></figure><h4>Connecting to the internet</h4><p>I will be showing how to connect to wifi, since I figure most people won’t have ethernet readily available.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/649/1*Ms3l01ywGfEU4g1K5mXTlw.png" /><figcaption>It should show something like wlan0 under Name</figcaption></figure><p>We will be using iwctl to connect, so type iwctl to go into it’s interface. Use device list to see the name of our wifi device. Then station device_name scan . If your device_name is wlan0, it is station wlan0 scan . Next is station device_name get-networks to get the name of the wifi to connect to. With the name/SSID, use station device_name connect wifi_name , a password prompt should show up if the name/SSID is correct. Now we can check if we’re connected to the internet with station device_name show and the ‘State’ should show ‘connected’. Type quit to quit.</p><h4>Setting our time and date</h4><p>Run timedatectl set-ntp true and if it doesn&#39;t show any errors, then that means it worked. You can run timedatectl status to check the time and date.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/439/1*hQmEoG27HW-l6V7g1iKcyQ.png" /></figure><h4>Partitoning</h4><p>Run lsblk to see all of our storage device names.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/472/1*0J1P--0mmKeWQZQ5dKZjqA.png" /><figcaption>This should be totally different on a Windows laptop.</figcaption></figure><p>The image above should look totally different from what would be on hardware. It might be ‘sda’ or ‘nvme0n1’ depending on what storage device you have:</p><pre>nvme0n1         disk<br>|--nvme0n1p1    part<br>|--nvme0n1p2    part<br>|--nvme0n1p3    part<br>|--nvme0n1p4    part</pre><p>You will want to run lsblk -f or fdisk -l to see which part is labeled the EFI System. This should be your Window’s EFI partition, remember these commands as we will need to reference these parts throughout partitioning our system.</p><p>Run cgdisk /dev/block_device, where block_device should be your storage’s partition system name. Note: If your storage is GPT, you will run cgdisk. Otherwise, you will run fdisk. You will get an error telling you it’s not GPT if you’re mismatching your storage type. Reference <a href="https://wiki.archlinux.org/index.php/Device_file#Block_devices">here</a> for more info on block device names.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/709/1*ykH46bq-hss4ImaFKn9k7w.png" /><figcaption>Arrow keys to move around the bottom menu</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/446/1*eMOR4bI8NVCZQl6T8bCxrw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/458/1*pkkbBkesE5FVFL4-kYYWFw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/506/1*2c6virpMmnIrqEv4JlKDeQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/551/1*oQ3olScJZM1JaT3LdEvK2w.png" /></figure><p>The images above show how to partition 1 section for EFI. I will be going with 3 sections:</p><ul><li>Linux EFI Partition</li><li>Linux Root Partition (your main folder/drive essentially)</li><li>Linux Swap</li></ul><p>Usually people just go with Boot and Root, but I chose this setup for my laptop because I might use hibernate sometimes, so I need swap and a separate EFI from Windows to avoid any corruption during hibernation. You can check out the partition codes for cgdisk <a href="https://wiki.archlinux.org/index.php/GPT_fdisk#Partition_type">here</a>. You will want to go through these 3 setups:</p><ul><li>EFI: first sector: blank, size: 512M, guid: ef00 , name: Linux EFI</li><li>Swap: first sector: blank, size: 8G (or your ram size), guid: 8200, name: Linux Swap</li><li>Root: first sector: blank, size: blank (fills all the way), guid: blank, name: Linux Root</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/526/1*zrY_KnAzVcTWe3gVHxxSHw.png" /></figure><p>Just imagine having extra partitions on the top of these, which should be your Windows partition. So our Linux partitions should be EFI system, Linux swap, and Linux filesystem.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/463/1*LYQdKFdRudPfQlndrccltw.png" /><figcaption>Use fdisk -l to check your partitions types</figcaption></figure><p>Be sure to triple check that everything is correct, because if you write over a windows partition, you will need to recover the disk as there will be no working OS on the drive anymore. Once you have those 3 partitions with the correct settings, select [Write], ‘yes’, then [Quit]. Congrats for making this far, the hardest part is over.</p><h4>Formatting</h4><p>Next we will want to format our EFI partition. Run mkfs.fat -F32 /dev/YOUR_EFI_PARTITION. It is at 5 for me on an nvme, So I will run mkfs.fat -F32 /dev/nvme0n1p5, but it might be /dev/sda# for you.</p><p>Next we will format our filesystem with mkfs.ext4 /dev/YOUR_FILESYSTEM_PARTITION , and hit the default for when creating the journal.</p><p>If you have swap, formatting it, we will run mkswap /dev/YOUR_SWAP_PARTITION . It will be mkswap /dev/nvme0n1p7, but it might be /dev/sda# for you. Turn on the swap with swapon /dev/YOUR_SWAP_PARTITION .</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/536/1*P2yRD4QHpQ4z-_edt7xKkw.png" /><figcaption>Formatting Example from my VM for demo purposes</figcaption></figure><h4>Mounting</h4><p>Lets mount our Root filesystem with mount /dev/YOUR_FILESYSTEM_PARTITION /mnt. Then let’s make the folder for our Linux EFI with mkdir /mnt/boot and then run mount /dev/YOUR_EFI_PARTITION /mnt/boot to mount.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/349/1*zCnnaETm8eRk8i4aWIEH-g.png" /><figcaption>Mounting Example from my VM for demo purposes</figcaption></figure><p>You can run df to make sure you have both EFI and filesystem mounts with the correct partitions.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/598/1*ygyXWmffiRdWJU4T294P1Q.png" /></figure><h4>Packages</h4><p>We will run pacstrap /mnt base base-devel linux linux-firmware util-linux grub efibootmgr os-prober intel-ucode networkmanager vim . Replace intel-ucode for amd-ucode, if your CPU is AMD. You can add more packages if you want, but I like to keep things minimal for our install. Vim is optional, but not really. You can choose your favorite terminal editor in place of it though.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*ZR8vCJCJKlANFl2wpXMklw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*Im2K0mN0axjcjvvpXLNmxg.png" /></figure><h4>fstab</h4><p>The fstab is a list of drives for your PC to go through when Linux is booting up, and we will generate it with this command: genfstab -U /mnt &gt;&gt; /mnt/etc/fstab . You can vim /mnt/etc/fstab to see if everything is correct, the UUIDs should NOT be commented out. Remember to run the pacstrap above before running this, as pacstrap downloads genfstab.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/426/1*w196JSeoHmjtTAlDTOUtcA.png" /></figure><h3>Setting Up Arch</h3><p>Now let’s log into our new Arch installation, since we are currently using our USB drive’s arch. Run arch-chroot /mnt , this will log into our new Arch system as sudo pretty much.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/294/1*wlJ-DhLX17NVdUuyxS5IQw.png" /><figcaption>You can see, it changes our terminal prompt.</figcaption></figure><p>If every is mounted correctly, you should get a prompt like in the image above.</p><h4>Setting Time and Language</h4><p>Let’s set our timezone by symbolic linking it: ln -sf /usr/share/zoneinfo/Japan /etc/localtime , after /zoneinfo you might want to hit tab to see a list of countries, and then maybe another tab after selecting your country if it has multiple timezones. Sync the hardware clock with hwclock - — systohc .</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/796/1*rQ0kgthM4HWqGAKIsj_Keg.png" /></figure><p>Next, let’s set the locale by going into vim /etc/locale.gen with your favorite terminal editor.</p><p>Uncomment en_US.UTF-8 UTF-8 , and/or whichever languages you want, and save+exit the file. Then run locale-gen to generate the files.</p><p>Set our language by making a file in/etc/locale.conf and typing in this line: LANG=en_US.UTF-8 , and save+exit.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/163/1*o7xVQgsrCviKpP0oVlsN9Q.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/503/1*bmkc1FgueA7RfdU3BQfItw.png" /></figure><h4>Setting Hosts, Hostname</h4><p>Next let’s make a hostname, this will be seen after your username on terminal prompts. Make a new file /etc/hostname and type in a desired name and save+exit.</p><p>Let’s set our hosts by going into /etc/hosts and writing these 3 lines in:</p><pre>127.0.0.1    localhost<br>::1          localhost<br>127.0.1.1    YOUR_HOSTNAME.localdomain    YOUR_HOSTNAME</pre><p>Replace YOUR_HOSTNAME with your actual hostname.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/631/1*nGBv31Is9V9FaA1ElH3TVw.png" /></figure><p>Lastly let’s set our root’s password with passwd .</p><h4>Setting Wifi</h4><p>Setting up our network manager to load on boot up for whenever we boot into Arch, run systemctl enable NetworkManager . Note that it is case sensitive. You can use nmcli once you’ve finished installing Arch and booting into it, so that way you can easily access wifi instead of taking extra time setting it up manually.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/799/1*ubU9nZF83oz3YRPvERe-dQ.png" /></figure><h4>Grub</h4><p>Next let’s setup our bootloader, grub, for dualbooting. Setup grub with grub-install --target=x86_64-efi --efi-directory=/boot --bootloader-id=GRUB</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/380/1*4XRvJnsHLobnOgrqk27T2w.png" /></figure><p>Next we need to let os-prober where our Windows is. So let’s check our Window’s EFI system partition directory with fdisk -l to double check. As mentioned in the partitioning step, any partitions before the ones you’ve created are the Window’s ones. Mine is on the 1st partition, so /dev/nvme0n1p1 . It might be something like /dev/sda# for you.</p><p>Let’s make a new mount folder for Windows withmkdir /mnt/win10 , and mount our Windows EFI to it with mount /dev/nvme0n1p1 /mnt/win10 .</p><p>Lastly let’s make our grub config with this command: grub-mkconfig -o /boot/grub/grub.cfg . The last output should show “Found Windows Boot Manager …”, which means we have successfully made a dualboot.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/732/1*l5Uv6nKD34JAbZQry4QUnA.png" /><figcaption>Taken from random example</figcaption></figure><p>Now we have successfully installed and configured Arch for dualboot on a Windows PC. Last commands to run areexit to get out of arch-chroot, umount -a to unmount all drives, then reboot. After rebooting, you should be greeted at the grub interface with an option for Arch or Windows. You can log into your new Arch system with root as user and the password you made earlier.</p><h3>For NVME Users that CANNOT set to UEFI in BIOS</h3><p>If you’ve completed this tutorial and get this similar error when booting into Arch:</p><pre>Starting version 247.3-1-arch<br>ERROR: device &#39;UUID=...&#39; not found. Skipping fsck.<br>mount: /new_root: can&#39;t find UUID=...<br>You are now being dropped into an emergency shell.<br>sh: can&#39;t access tty: job control turned off</pre><p>This most likely means that you haven’t set your storage to UEFI mode through the BIOS. It seems like newer computers with shiny NVME drives have this issue a lot. The steps to solve this:</p><ol><li>Boot back into the bootable Arch USB drive, go into the installation prompt</li><li>mount /dev/linux_root_partition /mnt</li><li>mount /dev/linux_efi_partition /mnt/boot</li><li>arch-chroot /mnt</li><li>vim /etc/mkinitcpio.conf</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/500/1*ppAw5kKeNPijto-JA-Tt8A.png" /></figure><p>6. Change modules to the image above and save+quit</p><p>7. Run mkinitcpio -P linux to regenerate your kernel images</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/344/1*TbefSni19mHPjAIlUHMsbQ.png" /></figure><p>8. quit then umount -a then reboot , and your arch boot should work now.</p><p>I hope this helps out anyone trying to install Arch Linux, it is definitely a great Linux distro with a good community.</p><p><em>Like my content? — </em><a href="https://ko-fi.com/harukai"><em>Support Me</em></a><em> — </em><a href="https://github.com/kai-dg"><em>Github</em></a><em> — </em><a href="https://twitter.com/the_haru_kai"><em>Twitter</em></a><em> — </em><a href="https://medium.com/@antisyllogism"><em>Medium</em></a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=fe7e394161bb" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Working in Japan — Give Japanese Startups a Chance]]></title>
            <link>https://medium.com/swlh/working-in-japan-give-japanese-startups-a-chance-5c3a7b4de166?source=rss-43a6fe57b83c------2</link>
            <guid isPermaLink="false">https://medium.com/p/5c3a7b4de166</guid>
            <category><![CDATA[tech]]></category>
            <category><![CDATA[startup]]></category>
            <category><![CDATA[japan]]></category>
            <category><![CDATA[software-engineering]]></category>
            <category><![CDATA[careers]]></category>
            <dc:creator><![CDATA[Derrick Gee]]></dc:creator>
            <pubDate>Sun, 28 Feb 2021 06:20:55 GMT</pubDate>
            <atom:updated>2021-03-01T16:28:08.450Z</atom:updated>
            <content:encoded><![CDATA[<h3>Working in Japan — Give Japanese Startups a Chance</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*UzfNC9m2UspK0nGo" /><figcaption>Photo by <a href="https://unsplash.com/@thetalkinglens?utm_source=medium&amp;utm_medium=referral">Louie Martinez</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>Have you ever wanted to live in Japan? Have you ever wanted to work in Japan? I asked myself this a couple of years back, and have realized today that I have reached my goal of working and living in Japan. While this article will revolve around being a software engineer, the resources I mention also offer other positions like HR and sales.</p><h3>Requirements</h3><p>Before getting into any details, I will briefly go over some requirements for successfully integrating yourself into Japan as a resident:</p><ul><li>The VISA: 4 year college degree, get married, or have 10 years experience in your industry with proof. No other exceptions as of writing this.</li><li>Japanese skill: As a software engineer, speaking/listening is more important than reading/writing in my opinion. That might be backwards for any other occupation.</li></ul><p>Obviously having a high level of Japanese at all communication aspects is ideal, but having only speaking/listening skills alone has personally gotten me several interviews and offers. Which I don’t think would have happened if I were only able to read/write. You can get through an interview if you can speak/listen, but not with only reading/writing.</p><h3>Why Japanese Startups?</h3><p>If you read Japan work experiences from Reddit and other sources, you will find that the baseline for the work environment in Japan is not that great compared to other places in the world. Lots of social rules, long work hours, and even bullying at the work places might be common depending on your situation. While my reason for wanting to join a startup would be the same as if I were in the US, one of the most important reasons is to get away from the average Japanese work environment.</p><p>You will find Japanese startups to be on a spectrum of silicon valley-esque, some very similar and others less. This kind of vibe includes freely expressing your opinions, being able to change things regardless of position status, flexible hours, remote work, and 0 dress code. Which is pretty much the opposite of your standard Japanese company.</p><p>A major reason why I prefer startups in Japan is that during the application process, recruiters/engineers will actually look at your Github and analyze it to a certain point. It could have been just my luck applying to bigger companies, but I can count on my hand how many big companies asked or mentioned my projects on Github: 0. At least a few interviews I’ve had with startups in Japan has mentioned or asked me about my personal projects. This gives me a better feeling of joining the company, as I have in the back of mind that they at least put some thought into having me join their team.</p><p>Lastly, as an engineer that is just starting out, I think that Japanese startups is a great “foot in the door” path to take. From my experience of over 500 applications in Japan, startups here are more willing to take a new person who can learn fast. As widely known, large companies in Japan are very risk-adverse. This gives fresh new software engineers (especially those with non traditional backgrounds), a higher chance of an opportunity at a startup that already has a high tolerance for risk.</p><p>You also just get to meet really cool people along the way when visiting several startups.</p><h3>My Current Experience</h3><p>For context: I learned programming through a 1–2 year bootcamp in San Francisco back in end of 2018. After working for quite some time at an American company with a branch in Japan, I started targeting specifically Japanese startups. Eventually, I landed a position as a backend engineer at a startup through <a href="https://en-jp.wantedly.com/">Wantedly</a>. This Japanese startup that allows flexible work times on a monthly salary basis. Japanese law forces all companies to have their employees turn in a timesheet, and I do indeed work less than 40 hours a week. They let me work remotely starting from day 0, and also always ask for my opinions on things so that they can improve the current situation. This company is also my highest salary offer as of writing this, which is way above the average salary in Tokyo.</p><p>Does this sound like a Japanese company? <em>Does it even sound like an American company? </em>Job hunting is truly a numbers game, where luck and timing has a very huge impact on your success. I think this idea really shows when taking a look back at my own offer history.</p><h3><strong>My Past Startup Offers</strong></h3><p>After giving out a few hundred applications, all I can say that getting an offer is heavily weighed by timing and luck. I’m here to tell the truth, and not to sell a course on how to land a software engineering job. Having a good resume and application plays a great deal in your chances, but it is not the end all be all of getting hired. It is truly just a numbers game, as cliche as that sounds.</p><p>My first Japanese offer came from a startup incubator startup (I know, that sounds odd), and it was for $45k/year with no bonus coming from <a href="https://en-jp.wantedly.com/">Wantedly</a>. It took me around 100 applications to get this one. They had an “English day of the week” where they all tried to use English on that day, if I remember correctly. The CEO also gave funds for the employees to get certifications, which is actually rare for a startup in Japan.</p><p>My second Japanese offer was from actually a meetup. They were holding a party for celebrating a milestone, and also for networking. I hit it off with one of their lead engineers, as he used Gentoo Linux and I was on Arch Linux at the time. This obviously meant that he was the Chad Linux user compared to me. The offer was $38k/year including bonus and equity. Recently this company was in a bloomberg article, and actually IPO’d in 2020. So their equity became to be actually worth something.</p><p>My third offer was one I took for around $36k/year from <a href="https://en-jp.wantedly.com/">Wantedly</a>. This was an American company with a branch in Tokyo. I was a full-stack engineer for around 6 months with these guys.</p><p>Fourth was through a recruiter at a sister company of a fairly large company. This one came in at $48k/year with bonus only, but I had refused this offer in place of a stipend paid internship at a fairly known company in Japan (internship offer came from <a href="https://www.tokyodev.com/">tokyodev</a>). To my surprise, this was a good move as the things I learned at the internship landed me a position that is probably better than any offers I’ve had so far.</p><h3>Startup Hunting Resources</h3><p>My first recommendation will be to use <a href="https://en-jp.wantedly.com/">Wantedly</a>, which is <strong>not</strong> limited to software engineers only. Use their Japanese English site, not their English version. I have gotten a total of 3 offers from startups on this site, and dozens of video interviews. Note that most companies here will have their postings in all Japanese, but filter your search with the tag “foriegner friendly” and your interview will have a higher chance of being in English.</p><p>Second is <a href="https://www.tokyodev.com/">tokyodev</a>, I actually got a 6 week internship from this site. Note that this site is software engineer specific. While this site has limited postings, their postings are pretty fresh compared to other sites. The articles and forum section is pretty helpful too.</p><p>Third is recruiters. You can find them on Linkedin by searching for them or setting your “looking for a job” settings to Japan. If you are in Japan, the other way is to meet them directly at meetups. Keep in mind that from my personal experience, I have dealt with only 2 good recruiters out of dozens that I have spoken with. Your luck may vary when trying out this method. Remember to ask if they have startup clients if you’re targeting them specifically, as most of their clients will be large companies.</p><p>Fourth is <a href="https://justa.io/en">Justa</a>. I actually haven’t had much luck from this site, but my previous coworkers have told me that they’ve gotten offers from here. It is <strong>not</strong> only limited software engineers, and has good English support.</p><p>Lastly are meetups (obviously you need to be in Japan for this), a lot of startups will hold meetups at their office usually. This is a good opportunity to talk directly with specific people within the company, which will more likely let you land a not so cold interview with them.</p><h3><strong>Conclusion</strong></h3><p>For fresh new engineers like myself: I think if you’re a non traditional background software engineer, targeting startups in Japan is probably your best bet in getting your foot in the door. If you have a CS degree, prioritize large companies over startups. Large companies are obviously more stable and have better benefits, whereas startups will most likely just offer a lot more salary. The compensation will probably get reversed if you have good experience under your belt (large companies &gt; startups). Coming from San Francisco, yes the salary does look a bit low. However, it is quite reasonable in comparison to the living cost. Personally speaking, living cost in Tokyo is 5–6 times less than back in San Francisco. Some people will say to start your software engineering career in the US first, and then decide if you want to move to Japan. But I think times have changed, and starting a career here in Tokyo isn’t that bad.</p><p><em>Like my content? — </em><a href="https://ko-fi.com/harukai"><em>Support Me</em></a><em> — </em><a href="https://github.com/kai-dg"><em>Github</em></a><em> — </em><a href="https://twitter.com/the_haru_kai"><em>Twitter</em></a><em> — </em><a href="https://medium.com/@antisyllogism"><em>Medium</em></a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5c3a7b4de166" width="1" height="1" alt=""><hr><p><a href="https://medium.com/swlh/working-in-japan-give-japanese-startups-a-chance-5c3a7b4de166">Working in Japan — Give Japanese Startups a Chance</a> was originally published in <a href="https://medium.com/swlh">The Startup</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to Get Started as a Software Engineer (GIP)]]></title>
            <link>https://medium.com/henngeblog/how-to-get-started-as-a-software-engineer-gip-bf746dde3b92?source=rss-43a6fe57b83c------2</link>
            <guid isPermaLink="false">https://medium.com/p/bf746dde3b92</guid>
            <category><![CDATA[hennge]]></category>
            <category><![CDATA[japan]]></category>
            <category><![CDATA[software-engineering]]></category>
            <category><![CDATA[gip]]></category>
            <category><![CDATA[internships]]></category>
            <dc:creator><![CDATA[Derrick Gee]]></dc:creator>
            <pubDate>Wed, 17 Feb 2021 05:54:31 GMT</pubDate>
            <atom:updated>2021-02-25T06:53:37.034Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*qXP3A50q0SmzMX3KluUFjQ.png" /><figcaption>11F at Hennge</figcaption></figure><p><strong>HENNGE </strong>is a company in Tokyo, Japan that is not your average Japanese company. It is more aligned with what it’s like working in Silicon Valley, as it is a very chill environment compared to the various other Japanese startups and companies I have experienced in the past. They advocate to voice out your opinions if you think something can be improved or changed, which is a very foreign concept to most typical Japanese company. Best of all, there is no need to know Japanese to work here, as HENNGE has standardized their main language to be fully English. The culture at HENNGE is truly diverse, as you have people from pretty much all walks of background working together. They also have an internship program that in one short sentence: In my opinion, a great opportunity to start a software engineering career.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xXtb16fJDhpwZknBrL294Q.png" /><figcaption>A Day at Tokyo Skytree</figcaption></figure><p><strong>Tokyo, Japan </strong>is a very busy but beautiful place. There are a lot of nice things that can only exist here, where it would be impossible elsewhere. From complex public structures to intricate electronic fixtures laying outside, things like these would be stolen or vandalized in an instant from where I’m from (San Francisco, California). Tokyo is massive, and there is always something to do every day. Even with a great and efficient public transportation system, you can explore Tokyo for a month and not even scratch the surface. What better way to experience life and work in Japan than to do an internship at HENNGE?</p><h3>The Internship (GIP)</h3><p>HENNGE’s internship, GIP (Global Internship Program), is an all-paid expense internship in Japan for 6 weeks. Meaning you won’t get a salary, but they will fly you to Japan and help you with food, transportation, phone, and a place to stay. I already have been living in Japan before doing the internship, so I’ve skipped the flying to Japan part.</p><p>I think the internship is great for junior-mid engineers, as it’s a great way to see how you like the work culture and people there without any real strings attached. HENNGE does a great job with onboarding their interns by separating virtual work and personal assets. Software engineer interns get 3 projects to work on during their 6 weeks, and they seem to represent a good amount of what they will actually do for their daily work. You can work with other interns and there will be mentors throughout each project. Along with work, they also set you up with a good amount of social activities. Such as free lunches with random HENNGE employees, board game night every Wednesday hosted by Sean the Third, and several slack channels dedicated to some kind of hobby. So you will definitely be kept busy in a good way throughout the entire internship.</p><h3><strong>My Background</strong></h3><p>Hello world, I am a software engineer student from San Francisco, California. I did not study the traditional route of going to a university and getting a CS degree. Instead, I went to a 2-year full-stack curriculum, Holberton School, in San Francisco. They do peer-to-peer learning while having mentors if dire help was needed, which is pretty unconventional. But I think it has taught me to be more collaborative compared to if I was taught the traditional teacher and classroom method. I came to Japan in 2019 to work and live here, since I think I fit pretty well here compared to back at home. My goal is to succeed without a traditional background so that I can show others that it’s okay to learn in a different way.</p><h3>My Internship Experience as a SWE</h3><p>Because of Covid-19, most of the internship was done remotely. I was their in-Japan intern along with another fully remote intern from China. HENNGE handles remote work really well, as they seem to have had experience with remote work deployment in the past. Along with a very active slack, remote work at HENNGE was a pretty pleasant experience. Only a few times there were hiccups during the internship when setting up things like accounts/permissions, but everyone that helps you throughout the process has taken note of the problems to improve the internship program. So given the time, things will just gradually improve.</p><h4>Meetings</h4><p>There were daily short video-call meetings to see what everyone did the day before and their plan for today, along with various other meetings. One of the most interesting meetings I participated in was their Inspire Matsuri meeting, which is a company-wide meeting for in short: presenting your business ideas so that HENNGE can help you make it. HENNGE is one of the rare companies in Japan that listens to their employee’s ideas with an open mind. The CEO, Ogura-san, has an amazing story about how he started the company and the journey to what it is today. I highly recommend listening throughout the whole thing when it comes up in the internship. The lunch meetings with 2 random people were a great opportunity to ask any questions about HENNGE or life in Japan. While yes, people will be biased since they do work at HENNGE; the people I’ve talked with have told me not only the pros but also the cons.</p><h4>Code Environment and Technology</h4><p>I was given a Mac during onboarding. While not a big issue, I would have preferred the option to Windows with WSL2. If you’re #vimcrew, I have good news for you: HENNGE has mostly vim users from what I have seen. Interns are able to dive into relevant tech like AWS, Python, and Vue. So whether you join HENNGE or not, you’ll benefit from getting the experience of industry-standard tech.</p><h4>Projects</h4><p>There were 3 projects in total over the 6 weeks that covered pretty much the full stack:</p><pre># A backend + frontend project<br># A devops project using terraform<br># Working with a team on some GitHub issues</pre><p>Projects 1 and 2 were pretty challenging since the time given was just barely enough to complete the requirements. The style of these projects will be familiar to you if you’ve gone through any 1+ year reputable coding bootcamp. You will get different mentors throughout each project. They try to push you towards an answer rather than just give it to you directly, and the requirements were just vague enough to give some freedom to your structure. Project 3’s goal seemed to be a rare case at this time, as I was able to create a frontend feature pull request and merge it into production. Though I had a ton of help from the entire team to create the new feature, it was fun and challenging. Overall, I thought it was a pretty nice structure not only to evaluate the intern from their side but from your side to also see how your future coworkers interact with you while working.</p><h4>Office</h4><p>While Japan is generally safe, HENNGE’s office was pretty secured by all entries to work areas being locked by ID tag scanners. Compared to most other tech company offices I’ve been to here in Tokyo, this definitely gives a better sense of security. The offices are pretty well designed as well, as it is a very open plan with a good amount of greens and lighting. Best of all, there is a vending machine with free Dr Pepper. There are 3 floors total, so you have a wide selection range of where you want to work. Right next to Shibuya, HENNGE is located at a pretty nice spot. It is around a 10-minute walk from Shibuya Station (JR Yamanote), and around a 6 min walk from Shinsen Station (Inokashira).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*O1lyBdVwvThcUPrehK9hmQ.png" /><figcaption>￥０ (Free) Dr Pepper</figcaption></figure><h3>MTS (Monthly Technical Session)</h3><p>HENNGE has an event called MTS every month, and it’s a time where people are selected to present about anything technical. It doesn’t have to be about programming, the MTS I attended had Ogura-san talk about stocks. I thought that this was a pretty interesting event for people to share their ideas. HENNGE organized the event pretty well, despite everything being done remotely. Every intern gets to present in MTS, so it’s a good chance to show off what you’re passionate about.</p><h3>Hanging Out</h3><p>During my internship at HENNGE, I was invited to join some people to go to TeamLab during a Japanese holiday at the time. I would recommend anyone that comes to Japan to spend some time here, as I think it is a setup that could only exist in a few places in the world (one being Japan). This place is pretty much an interactive art museum where interact with your sense of touch and vision. It’s better to go in here without knowing anything, as that is the way to get the best experience in my opinion.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6Td5jAIdyT5HeCrMS3FTnQ.jpeg" /><figcaption>TeamLab Toyosu</figcaption></figure><p>Despite it being during a pandemic; My time at HENNGE has been a great experience. I think Ogura-san has a great vision for the company, and that really shows through doing this internship at HENNGE. The company is very transparent, and they really try to make you understand how the company works. I highly recommend applying to the <a href="https://hennge.com/global/gip.html">HENNGE GIP</a> for any new software engineers or even ones with a little work experience. Especially for those who have gone through a long-term coding boot camp, I think a well-designed project-based course trains you well enough to handle work-level tasks.</p><p><em>Derrick Dee interned at </em><a href="https://hennge.com/global/gip/"><em>HENNGE Global Internship Program</em></a><em> from September 7th — October 16th, 2020, and was one of GIP’s first remote interns.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=bf746dde3b92" width="1" height="1" alt=""><hr><p><a href="https://medium.com/henngeblog/how-to-get-started-as-a-software-engineer-gip-bf746dde3b92">How to Get Started as a Software Engineer (GIP)</a> was originally published in <a href="https://medium.com/henngeblog">henngeblog</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Python Flask Tutorial]]></title>
            <link>https://antisyllogism.medium.com/python-flask-tutorial-463c6b2ba1bc?source=rss-43a6fe57b83c------2</link>
            <guid isPermaLink="false">https://medium.com/p/463c6b2ba1bc</guid>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[coding]]></category>
            <category><![CDATA[flask]]></category>
            <category><![CDATA[python]]></category>
            <dc:creator><![CDATA[Derrick Gee]]></dc:creator>
            <pubDate>Sat, 06 Feb 2021 07:05:25 GMT</pubDate>
            <atom:updated>2021-02-06T07:16:27.904Z</atom:updated>
            <content:encoded><![CDATA[<h3>How To Python Flask Tutorial</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/509/1*x4f9lWzad8j1yr1Jlr5BCw.png" /></figure><p>Here is a how to setup Flask tutorial as of recent. I recommend following along in Linux/Mac/WSL, as my setup will be mostly done through the terminal. I will also assume some basic Python knowledge, as this isn’t a Python tutorial. This tutorial won’t be going over how to make a specific web app, as I think the best way to truly learn a technology is to build something for yourself. Rather than be stuck in a tutorial loop, learning the concepts and applying them to your own ideas would help you grow faster in my opinion. Use the <a href="https://flask.palletsprojects.com/en/1.1.x/">docs</a> to find things that weren’t covered in this tutorial that you need.</p><h3>Basic Setup</h3><p>Most of my setup will be coming from the <a href="https://flask.palletsprojects.com/en/1.1.x/tutorial/install/#describe-the-project">docs on making the app installable</a>. This will make flask able to run from any directory, instead of being limited to only the root directory. First we will setup the environment and install our dependencies. So in our terminal:</p><pre>mkdir myproject<br>cd myproject<br>python -m venv venv<br>source venv/bin/activate</pre><p>Make a file called .env in the directory myproject/, this is where we store our <a href="https://flask.palletsprojects.com/en/1.1.x/tutorial/factory/#run-the-application">environment variables</a>.</p><pre>FLASK_APP=flaskr<br>FLASK_ENV=development</pre><p>Make a file called setup.py in the same directory.</p><pre>from setuptools import find_packages, setup</pre><pre>setup(<br>    name=&#39;flaskr&#39;,<br>    version=&#39;1.0.0&#39;,<br>    packages=find_packages(),<br>    include_package_data=True,<br>    zip_safe=False,<br>    install_requires=[<br>        &#39;flask&#39;,<br>        &#39;python-dotenv&#39;,<br>        &#39;Flask-Migrate&#39;,<br>    ],<br>)</pre><p>python-dotenv will auto load our .env file when running the flask app. Flask-Migrate is a package that helps with setting up and migrating our database without doing any manual work.</p><p><strong>Install dependencies:</strong></p><pre>pip install -e .</pre><p>The -e flag makes the flaskr folder editable pretty much. Without the -e flag, any edits would not be reflected. As mentioned earlier, this method allows us to run flask from any subdirectories of the project. Not doing it this way would mean that flask can only be executed from the root folder.</p><h3>Getting Flask to Run</h3><p>Let’s start off by getting the app to run, and go over the concepts afterwards. <strong>Note</strong> that this is the way I organize my Flask app, feel free to change whatever you think would work better. Starting from our myproject/ folder, run the following commands to get our folder structure going:</p><pre>mkdir flaskr<br>touch flaskr/__init__.py</pre><p>Now let’s edit __init__.py . Here is a basic snippet from the documentation with some slight tweaks of mine.</p><pre>import os<br>from flask import Flask<br>from .models import db<br>from flask_migrate import Migrate</pre><pre>def create_app(test_config=None):<br>    app = Flask(__name__, instance_relative_config=True)<br>    app.config.from_mapping(<br>        SECRET_KEY=&#39;dev&#39;,<br>        DATABASE=os.path.join(app.instance_path, &#39;flaskr.sqlite&#39;),<br>        SQLALCHEMY_TRACK_MODIFICATIONS=False,<br>    )</pre><pre># Database settings<br>    app.config[&quot;SQLALCHEMY_DATABASE_URI&quot;] = &quot;sqlite:///sqlite.db&quot;<br>    db.init_app(app)<br>    migrate = Migrate(app, db)</pre><pre>if test_config is None:<br>        app.config.from_pyfile(&#39;config.py&#39;, silent=True)<br>    else:<br>        app.config.from_mapping(test_config)</pre><pre>    try:<br>        os.makedirs(app.instance_path)<br>    except OSError:<br>        pass</pre><pre># Register views<br>    from .home import views as home_views<br>    app.register_blueprint(home_views.bp)</pre><pre>    return app</pre><p>In the flaskr/ folder, we will setup the database:</p><pre>touch flaskr/models.py</pre><p>Edit models.py :</p><pre>from flask_sqlalchemy import SQLAlchemy<br>db = SQLAlchemy()</pre><pre>class MyModel(db.Model):<br>    __tablename__ = &quot;mymodel&quot;<br>    # This id is required on every model, as it is the pk<br>    id = db.Column(db.Integer, primary_key=True)<br>    name = db.Column(db.String(128))</pre><pre># This is the display name for the model when queried<br>    def __repr__(self):<br>        return f&quot;{self.name}&quot;</pre><p>In the flaskr/ folder, lets make our home app and it’s views:</p><pre>mkdir flaskr/home<br>touch flaskr/home/__init__.py<br>touch flaskr/home/views.py</pre><p>Edit the flaskr/home/views.py :</p><pre>from flask import render_template, Blueprint, request<br>from flaskr.models import db, MyModel<br>bp = Blueprint(&quot;home&quot;, __name__, url_prefix=&quot;&quot;)</pre><pre>@bp.route(&quot;/&quot;, methods=(&quot;GET&quot;,))<br>def home():<br>    q = MyModel.query.all()<br>    new = MyModel(name=f&quot;model no. {len(q)}&quot;)<br>    db.session.add(new)<br>    db.session.commit()<br>    context = {<br>        &quot;models&quot;: MyModel.query.all()<br>    }<br>    return render_template(&quot;home/index.html&quot;, context=context)</pre><pre>@bp.route(&quot;/mymodel/&lt;int:pk&gt;&quot;, methods=(&quot;GET&quot;,))<br>def func_mymodel(pk):<br>    q = MyModel.query.filter_by(id=pk).first()<br>    context = {<br>        &quot;model_query&quot;: q<br>    }<br>    return render_template(&quot;home/index.html&quot;, context=context)</pre><p>Let’s make our html we are trying to display, in the flaskr/ folder:</p><pre>mkdir -p flaskr/templates/home<br>touch flaskr/templates/home/index.html</pre><p>Edit the flaskr/templates/home/index.html:</p><pre>&lt;h1&gt;Hello Flask&lt;/h1&gt;<br>{% for model in context[&quot;models&quot;] %}<br>  &lt;p&gt;{{ model.name }}&lt;/p&gt;<br>{% endfor %}</pre><pre>{% if context[&quot;model_query&quot;] %}<br>  &lt;h1&gt;Query:&lt;/h1&gt;<br>  &lt;p&gt;{{ context[&quot;model_query&quot;].name }}&lt;/p&gt;<br>{% endif %}</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/495/1*UzPl1FyjbwP1uWtmoLjY0Q.png" /><figcaption>This is what our files and folders should look like</figcaption></figure><p>Now that we have organized our Flask app’s code, we can init the database and run the webserver:</p><pre>flask db init<br>flask db migrate<br>flask db upgrade<br>flask run</pre><p>Go to localhost:5000 on your browser, and you should see a “Hello Flask” heading. You should see that every time you go to the home url, a new model should be created. Going to the link, should bring up a single model name only.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/586/1*XI_f9Ff4Tv4laXDwPu2XjA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/402/1*Xo2Ndb1siOKbR5fqYR4FHA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/476/1*UQETMBDANYIcjzk5JaE-hw.png" /><figcaption>Going to the model no. 1 link</figcaption></figure><h3>Folder Structure</h3><p>Flask lets us have a good amount of freedom when it comes to customizing our folders and files structure. I personally like to keep things similar to Django, as that is what I use the most. Here is my layout for a single application on our flask:</p><pre>myproject/<br>|--.env<br>|--setup.py<br>|--venv/<br>|--flaskr/<br>|  |--__init__.py<br>|  |--models.py<br>|  |--home/<br>|  |  |--__init__.py<br>|  |  |--views.py<br>|  |--templates/<br>|  |--static/</pre><p><strong>__init__.py<br></strong>This file will contain our entire app settings before it gets created. Check the docs on making this <a href="https://flask.palletsprojects.com/en/1.1.x/tutorial/factory/#the-application-factory">here</a>. Some notable settings are registering views (our endpoints) with blueprints, registering custom commands, and database settings.</p><p><strong>home/ (the app directory)<br></strong>This directory is like when running manage.py createapp home in Django. If you’re not familiar with Django, it is a way to organize your app’s functionalities into folders. For example, you should make a folder called users/ if your app will have users and put related functions such as the models for users in that folder. Instead of home/ , it could be posts/ if you’re making a blog app. In the posts/ folder, you would have a views.py that has all endpoints that related to blog posts. This way it is organized, and also easier to debug since you know where to look if your posts has a problem.</p><p><strong>templates/</strong><br>This is where your HTML goes, you can reference them in views like a path with /templates as the root. So if there is a folder in /templates called /home like in our demo, it would be home/index.html .</p><p><strong>static/</strong><br>This is where your css, js, and images go for the most part. You can reference static files like this:</p><pre>&lt;link rel=&quot;stylesheet&quot; type=&quot;text/css&quot; href=&quot;{{ url_for(&#39;static&#39;, filename=&#39;css/style.css&#39;) }}&quot;&gt;</pre><h3>Database: Models, Setup, and Wiping</h3><p>Model attribute classes and parameters can be found in the <a href="https://flask-sqlalchemy.palletsprojects.com/en/2.x/models/#simple-example">docs</a>. These docs also show how to do one-to-many and many-to-many relationships. Note that the flask_sqlalchemy docs are minimal because it is built on sqlalchemy, so the original docs on sqlalchemy will give more detail on more complex functions and methods.</p><p>We are using the Flask-Migrate package, which we call in our create_app in the main flaskr/__init__.py file. This lets us manage our changes to our database very easily, in a very similar way to how Django does it. Here are the 3 main commands we use for database management:</p><p>flask db init<br> — Creates our migrations/ folder if it does not exist</p><p>flask db migrate<br> flask db upgrade <br> — Run migrate after making any changes to your model classes in models.py<br> — Run upgrade after running migrate to apply changes to the database<br>— Coming from Django: migrate is similar to makemigrations, and upgrade is similar to migrate in Django.</p><p>After running flask db migrate, it will automatically create a sqlite database file as specified in our __init__.py. Anytime we add or change a model class in our models.py file, we would run flask db migrate and flask db upgrade .</p><p><strong>Wiping the Database</strong><br>If you want to wipe the entire database: just delete the sqlite file which we named sqlite.db and run flask db migrate; flask db upgrade; .</p><p><strong>Wiping Migrations</strong><br>If you want to start the migrations over: delete the sqlite file which we named sqlite.db , and then delete everything from migrations/versions/ . Then run flask db migrate; flask db upgrade; to start with a fresh initial migration file.</p><h3>Database: Read, Write, Edit</h3><p>Now that we know how to setup our database, we need to know how to manipulate it through Flask’s ORM. I recommend using flask shell in order to go into interactive mode for learning the syntax for this ORM.</p><pre># writing<br>from flaskr.models import db, MyModel<br>new = MyModel(name=&quot;hello&quot;)<br>db.session.add(new)<br>db.session.commit()<br># querying<br>q = MyModel.query.all()<br>print(q)<br>filter = MyModel.query.filter_by(name=&quot;hello&quot;)<br>print(filter)<br># updating<br>update = q[0]<br>update.name = &quot;bye&quot;<br>db.session.add(update)<br>db.session.commit()<br># deleting<br>db.session.delete(update)<br>db.session.commit()</pre><h3>Displaying a Page: Views</h3><p>Views contain our endpoints for the web app. Below is the minimal code we need in order to get a view up.</p><pre># in flaskr/home/views.py<br>from flask import render_template, Blueprint<br>bp = Blueprint(&quot;home&quot;, __name__, url_prefix=&quot;&quot;)</pre><pre>@bp.route(&quot;/&quot;, methods=(&quot;GET&quot;,))<br>def home():<br>    return render_template(&quot;home/index.html&quot;)</pre><p><strong>Endpoint Anatomy</strong><br>The blueprint sets the view’s name, and also the url_prefix. The format for url_prefix is: localhost:5000/[URL_PREFIX]/[ROUTE]/ . So if our blueprint had url_prefix=&quot;/home&quot; , and our route had @bp.route(“/flask”) . Our endpoint would be localhost:5000/home/flask .</p><p><strong>Namespace Anatomy<br></strong>The blueprint also lets us name our view’s namespace, meaning how we reference the view when using something like url_for . The format for namespace is “blueprint_name.function_name”. So if our blueprint was like this: bp = Blueprint(“flaskhome”, __name__, url_prefix=””) , our url_for becomes url_for(&quot;flaskhome.home&quot;) .</p><p><strong>Parameters<br></strong>Using parameters just requires 2 extra variables to add to our route:</p><pre>@bp.route(&quot;/&lt;int:pk&gt;&quot;, methods=(&quot;GET&quot;,))<br>def home(pk):<br>    q = MyModel.query.get(pk)<br>    context = {<br>        &quot;mymodel&quot;: q<br>    }<br>    return render_template(&quot;home/index.html&quot;, context=context)</pre><p>You can see in this example, we take an integer parameter to use for querying the id of a model. So the endpoint localhost:5000/2 would return the model with the id 2 back to us.</p><p><strong>Registering Views</strong><br>We register our view’s blueprints in the __init__.py .</p><pre># from the flaskr/__init__.py from the demo code above<br>from .home import views as home_views<br>app.register_blueprint(home_views.bp)</pre><h3>HTML Templating</h3><p><strong>Static files and urls for views:</strong></p><pre># this will get static/css/style.css<br>{{ url_for(&#39;static&#39;, filename=&#39;css/style.css&#39;) }}<br># getting a view&#39;s url<br>{{ url_for(&quot;home.function_name&quot;) }}<br># getting a view&#39;s url with arguments<br>{{ url_for(&quot;home.function_name&quot;, name=name) }}</pre><p>Note that the home in this case is the blueprint’s name. If you check the example from above, you will see that the home corresponds to the view’s code: bp = Blueprint(“home”, __name__, url_prefix=””) .</p><p><strong>For loops</strong></p><pre>{% for i in context[“mylist”] %}<br>  &lt;p&gt;{{ i }}&lt;/p&gt;<br>{% endfor %}</pre><p><strong>If statements</strong></p><pre>{% if context[“mybool”] %}<br>  &lt;p&gt;{{ context[“mybool”] }}&lt;/p&gt;<br>{% endif %}</pre><p><strong>Referencing HTML Files Example</strong></p><pre># in templates/navbar.html<br>&lt;navbar&gt;<br>  &lt;ul&gt;<br>    &lt;li&gt;Navbar Home&lt;/li&gt;<br>  &lt;/ul&gt;<br>&lt;/navbar&gt;</pre><p>We will be using {% include %} to display our navbar. This way we can write 1 line of code instead of rewriting the navbar on every other html file we create.</p><pre># in templates/index.html<br>&lt;html&gt;<br>&lt;head&gt;<br>  &lt;title&gt;Myproject&lt;/title&gt;<br>&lt;/head&gt;<br>&lt;body&gt;<br>  &lt;!-- Including just adds that .html to here --&gt;<br>  {% include &quot;navbar.html&quot; %}<br>  {% block content %}<br>  &lt;!-- Anything extending index.html will be shown between here --&gt;<br>  {% endblock %}<br>&lt;/body&gt;<br>&lt;/html&gt;</pre><p>Our index.html will be the base of almost every other html files we create, as it contains the layout of an html file. We will use {% block content %}{% endblock %} so that we can extend index.html to our main content.</p><pre># in templates/contents.html<br>{% extends &quot;index.html&quot; %}<br>{% block content %}<br>&lt;h1&gt;Hello Flask, I am in contents.html&lt;/h1&gt;<br>{% endblock %}</pre><p>Using {% extends %} will display everything from index.html , except whatever is in between {% block content %} and {% endblock %} . We add the same blocks in our content.html in order to complete the block, so anything in between {% block content %} and {% endblock %} will be displayed on our index.html</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/382/1*9A2RZaluxtW-Q6AJZF_AdQ.png" /><figcaption>A visual on how referencing HTML files to each other.</figcaption></figure><p>For more complex templating, search for jinja . As that is what flask uses to template in HTML.</p><h3>Getting User Input: Forms</h3><p>In templates/home/index.html</p><pre>&lt;form action=&quot;post&quot; action=&quot;{{ url_for(&#39;home.func_form&#39;) }}&quot;&gt;<br>  &lt;label for=&quot;pk&quot;&gt;Model ID:&lt;/label&gt;<br>  &lt;input id=&quot;pk&quot; type=&quot;text&quot; name=&quot;mymodel_pk&quot;&gt;<br>  &lt;input type=&quot;submit&quot; value=&quot;Submit&quot;&gt;<br>&lt;/form&gt;</pre><p>In home/views.py</p><pre>from flask import render_template, Blueprint, request<br>bp = Blueprint(&quot;home&quot;, __name__, url_prefix=&quot;&quot;)</pre><pre><a href="http://twitter.com/bp">@bp</a>.route(&quot;/&quot;, methods=(&quot;GET&quot;,))<br>def home():<br>    return render_template(&quot;home/index.html&quot;)</pre><pre><a href="http://twitter.com/bp">@bp</a>.route(&quot;/myform&quot;, methods=(&quot;POST&quot;,))<br>def func_form():<br>    pk = request.form[&quot;mymodel_pk&quot;]<br>    context = {<br>        &quot;mymodel_pk&quot;: pk<br>    }<br>    return render_template(&quot;home/page.html&quot;, context=context)</pre><p>In templates/home/page.html</p><pre>&lt;p&gt;{{ context[&quot;mymodel_pk&quot;] }}&lt;/p&gt;</pre><p>This code example should show the rough idea on how to retrieve user input from a form. You can use the pk in func_form() to query the database to edit or delete that data, or use the user input to create new data and add it to the database.</p><h3>Flask Commands Overview</h3><p>Here are the main commands used in flask:</p><p><strong>Database Management</strong>: flask db init, flask db migrate, flask db upgrade<br> Mainly migrate and upgrade are used throughout development after using init.</p><p><strong>Flask Env’s Interactive Mode</strong>: flask shell <br>Use this when you want to interact with the database for testing queries and methods.</p><h3>Notable Go-to Resources</h3><ul><li><a href="https://flask.palletsprojects.com/en/1.1.x/">Flask Docs</a></li><li><a href="https://flask-migrate.readthedocs.io/en/latest/">Flask Migrate</a></li><li><a href="https://flask-sqlalchemy.palletsprojects.com/en/2.x/">Flask S</a>QLAlchemy</li><li><a href="https://docs.sqlalchemy.org/en/13/">SQLAlchemy</a></li><li><a href="https://jinja.palletsprojects.com/en/2.11.x/">Jinja</a></li></ul><p>This framework is great for starting a small personal project, as not all projects need scalability. I hope these concepts help jump start whatever you are trying to do in Flask.</p><p><em>Like my content? — </em><a href="https://ko-fi.com/harukai"><em>Support Me</em></a><em> — </em><a href="https://github.com/kai-dg"><em>Github</em></a><em> — </em><a href="https://twitter.com/the_haru_kai"><em>Twitter</em></a><em> — </em><a href="https://medium.com/@antisyllogism"><em>Medium</em></a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=463c6b2ba1bc" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[3 Cool Terminal Tools Written In Rust]]></title>
            <link>https://antisyllogism.medium.com/3-cool-terminal-tools-written-in-rust-9ad70c225139?source=rss-43a6fe57b83c------2</link>
            <guid isPermaLink="false">https://medium.com/p/9ad70c225139</guid>
            <category><![CDATA[rust]]></category>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[technology]]></category>
            <category><![CDATA[coding]]></category>
            <dc:creator><![CDATA[Derrick Gee]]></dc:creator>
            <pubDate>Tue, 02 Feb 2021 08:28:43 GMT</pubDate>
            <atom:updated>2021-02-02T14:37:34.564Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/739/1*pAHdQ8VPTd6LHFuUeFySQw.png" /></figure><p>Here are 3 nice visual changing terminal tools written in Rust that I have integrated into my workflow. Coding requires spending most of your time looking at your screen, it should at least look visually pleasing. All of the packages mentioned here are compatible Linux, WSL, and Mac. They are very easy to implement, as they pretty much work out of the box after installation. The only configuring you would want to do is in your ~/.bashrc (or whichever shell’s rc you use), as 2 of these packages will replace some of your main commands.</p><h3>Starship</h3><p>This is a neat tool that changes your prompt on all common shells. It is very customizable with a toml file ( ~/.config/starship/starship.toml ), and has hot reload functionality on the config file as well. The main useful features I’ve noticed so far is that it can display prompt command’s runtime, language environment, git branch, and also git status. <a href="https://starship.rs/guide/#%F0%9F%9A%80-installation">Check out installation here</a>. You can also check my <a href="https://github.com/kai-dg/dotfiles/blob/master/starship/starship.toml">dotfiles on my github</a> to see some of the customization I do to my starship prompt.</p><p><strong>Note: My </strong><a href="https://github.com/kai-dg/dotfiles/blob/master/starship/starship.toml"><strong>dotfiles</strong></a><strong> will change over time, feel free to watch or star it for updates.</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/592/0*1tN1gUnLkR3u28DY.png" /><figcaption>Starship with Python and Node environments</figcaption></figure><h3>Bat</h3><p>The cat and less replacement. This tool will do both cat or less , depending on the current size of your terminal. So if the file to display requires you to scroll, bat will less the file. Visa-versa, bat will cat a file if it can be displayed within the terminal height. It also can syntax color the text in terminal as well, which makes reading files a lot easier if it is code or a config file. <a href="https://github.com/sharkdp/bat">Github link here</a>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/481/1*yXaii-sDWxAUFPgS7MsqFQ.png" /><figcaption>bat will less a file if it does NOT fit in the terminal window</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/500/1*85WqeOlyOI9vPOEyIiJmSQ.png" /><figcaption>bat will cat the entire file if it fits in the terminal window</figcaption></figure><p>Below is my alias for replacing cat. I manually enter the style since it has line numbers by default, and that interferes with copy and pasting the output from my terminal.</p><pre>alias cat=&#39;bat --style=header,grid&#39;</pre><h3>Exa</h3><p>The ls and tree replacement. This tool makes customizing the ls output a lot easier, which lets you remove parts of the output with a simple command flag. It also color codes the permissions, which makes it a little bit easier to read. By default, exa will also show a file’s size in k, M, and G instead of only k. <a href="https://github.com/ogham/exa">Github link here</a>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/987/0*9I67478wTPXQd04f.png" /><figcaption>exa vs ls</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/947/1*FccbrvIWp8DfP54EPZkWxg.png" /><figcaption>Having colors on tree makes it easier on the eyes to see which files are in which directory.</figcaption></figure><p>Below are my aliases for replacing ls and tree. The -F flag adds a slash at the end of directories.</p><pre># .bashrc<br>alias ll=&quot;exa -Fl&quot;<br>alias lll=&quot;exa -Fla&quot;<br>alias l=&quot;exa -F&quot;<br>alias tree=&quot;exa --tree -F&quot;</pre><p><em>Like my content? </em><a href="https://github.com/kai-dg"><em>Github</em></a><em> — </em><a href="https://twitter.com/the_haru_kai"><em>Twitter</em></a><em> — </em><a href="https://medium.com/@antisyllogism"><em>Medium</em></a><em> — </em><a href="https://ko-fi.com/harukai"><em>Support Me</em></a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9ad70c225139" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to Install Manjaro Linux Architect]]></title>
            <link>https://antisyllogism.medium.com/how-to-install-manjaro-linux-architect-4211952fbfc4?source=rss-43a6fe57b83c------2</link>
            <guid isPermaLink="false">https://medium.com/p/4211952fbfc4</guid>
            <category><![CDATA[tech]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[linux]]></category>
            <dc:creator><![CDATA[Derrick Gee]]></dc:creator>
            <pubDate>Mon, 28 Dec 2020 09:06:59 GMT</pubDate>
            <atom:updated>2021-02-02T14:37:49.814Z</atom:updated>
            <content:encoded><![CDATA[<h3>Linux — How to Install Manjaro Architect</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/823/1*CxNlFxrO2T2b5sfgkmdI5A.png" /></figure><p>I’ll be documenting how I installed Manjaro in this article for future reference. We will also be starting from booting into the bootable USB, check another guide on how to make that if you haven’t done that yet. From the image above, running down the list:</p><p>— Select your timezone<br> — Keyboard, Language (I default to US)<br> — Driver: free if intel integrated, not free if nvidia</p><p>Enter the Boot: Manjaro</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/452/1*CA-WmQdCTuo3HJfs_1WSHQ.png" /></figure><p>Follow the prompt here, manjaro manjaro to login. Then type setup .</p><p>Follow the wifi menu to connect to your wifi, unless you are on ethernet (which is automatic usually). If you cannot connect to the internet, check this thread <a href="https://forum.manjaro.org/t/manjaro-architect-connect-to-the-internet/33610/5">https://forum.manjaro.org/t/manjaro-architect-connect-to-the-internet/33610/5</a> to solve the issue. After connecting to the internet successfully, it will update packages automatically. Lastly, select your language (mine is us ).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/672/1*6gPBWunjlh7XNLSTUnxiDw.png" /></figure><p>You will be greeted with the installers after selecting your language. We just go from top to bottom, choosing the necessary installers. First we will <strong>prepare the installation.</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/600/1*oNsZ--9Or_gRpuIKJifHlw.png" /></figure><h4>Partition Disk</h4><p><strong>This article will assume that you have already an empty partition space on your disk</strong>. We will go with fdisk , select /dev/sda and choose fdisk .</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/562/1*buQc1IF2qHPSweiIm0HzSw.png" /><figcaption>Taken from Arch install</figcaption></figure><h4>fdisk Main Commands To Use</h4><p>— n Create a new partition<br> — t Change partition’s filesystem type<br> — p Check current partitions<br> — w Save all partition changes</p><p>1.<strong> UEFI:</strong> n for a new partition, press enter for the default partition number, and press enter for the First sector. +512M for our EFI partition, as recommended by arch wiki. The filesystem type will default to Linux Filesystem, so we need to change that by typing t and selecting the number of that partition. We can type L to find the number indexed to the one we want. 1 is the EFI System for me. So we can exit by hitting q and then typing 1 to change our filesystem to EFI.</p><p>2. <strong>Swap</strong>: n again for our next partition. I will be going with a partition for swap, since I have the space to do so. So same as before, except the size this time will be the same as my RAM. +8G for my size, and we need to change the filesystem again t . Listing the types, swap is indexed at 19 for me.</p><p>3. <strong>Root</strong>: Lastly, n again for our Linux Filesystem. I will do +65G for mine. If the partition is not Linux Filesystem by default, you can change it with t .</p><p>Now we can run p and get a list of all our partitions to do a last check, and then do w to save our partitions.</p><h4>Mount Partitions</h4><p>ROOT goes into the Linux File System, SWAP goes into the Swap, skip additional mounts, and then it will ask for the UEFI boot. So we can mount that to our EFI system partition. I will go with /boot/efi , since I have multiple distros on my PC.</p><h4>Configure Installer Mirrorlist</h4><p>Rank by speed: Stable. Pick top 2–3. This will normally take awhile to finish to complete.</p><h4>Refresh Pacman Keys</h4><h4>Choose Pacman Cache</h4><p>Select yes</p><h4>Enable fsck hook</h4><p>This is for checking system file consistency, either it runs at boot or manually by the user.</p><p>That completes the preparation, we can hit back.</p><h3>Install Desktop System</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/653/1*8FR2pQ6ArBgXlzUl65P9Vg.png" /></figure><p>Go to Install Manjaro Desktop. Add yay and pick a linux kernel. I’m using 5.4 , since it seems to be the most compatible with my laptop maker and model.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/636/1*iEZFuuITdDMCsf3144M3Bg.png" /></figure><p>Next pick the DE/WM, I went with bspwm</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/511/1*5LIKR77xwGzu36C2wFzChA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/501/1*CFCsglyCm_sef82VL4NfKg.png" /></figure><p>With bspwm , I go with full installation. My other alternative is i3 , which I do minimal with. If it fails to intsall to root, try to go through the desktop installation again.</p><p>If you have an intel cpu as your gpu, choose Auto-Install free drivers.</p><h4>Bootloader</h4><p>If you already have multiple OS’s, you don’t need to install another bootloader. But if this is your first Linux install, or if you deleted your previous bootloader, then install a bootloader. I recommend grub .</p><h4>Configure base</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/460/1*XbZjNcGT414LTBdmPL4opA.png" /></figure><p>— Generate FSTAB. Pick the default, which is Device UUID.<br> — Set Hostname to your choice<br> — Set system locale, stick with the default, which is en_US.UTF-8<br> — Keyboard layout is us <br> — Then select your timezone, and leave it at UTC<br> — Set a root password<br> — Add a user and choose your default shell. I’m going with bash.</p><p>Once we hit back and then done we can choose to save the installation log or not. I don’t really need it, so I will hit no for that.</p><p>You’ll be moved to the terminal after everything is done. We can now reboot and you should be greeted by the bootloader with your fresh Manjaro install.</p><p><em>Like my content? </em><a href="https://github.com/kai-dg"><em>Github</em></a><em> — </em><a href="https://twitter.com/the_haru_kai"><em>Twitter</em></a><em> — </em><a href="https://medium.com/@antisyllogism"><em>Medium</em></a><em> — </em><a href="https://ko-fi.com/harukai"><em>Support Me</em></a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4211952fbfc4" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>