<?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 FGOINAI on Medium]]></title>
        <description><![CDATA[Stories by FGOINAI on Medium]]></description>
        <link>https://medium.com/@fgo.inai?source=rss-710a64f5e62b------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*wmrmTJcy8uKENX8A0LPTBA.png</url>
            <title>Stories by FGOINAI on Medium</title>
            <link>https://medium.com/@fgo.inai?source=rss-710a64f5e62b------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 21 Nov 2026 10:15:10 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@fgo.inai/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[在FreeBSD以bhyve建立Arch Linux VM]]></title>
            <link>https://medium.com/@fgo.inai/%E5%9C%A8freebsd%E4%BB%A5bhyve%E5%BB%BA%E7%AB%8Barch-linux-vm-142e88464d70?source=rss-710a64f5e62b------2</link>
            <guid isPermaLink="false">https://medium.com/p/142e88464d70</guid>
            <category><![CDATA[freebsd]]></category>
            <category><![CDATA[bhyve]]></category>
            <category><![CDATA[vm]]></category>
            <category><![CDATA[arch-linux]]></category>
            <dc:creator><![CDATA[FGOINAI]]></dc:creator>
            <pubDate>Sat, 01 Jun 2019 18:45:32 GMT</pubDate>
            <atom:updated>2019-06-01T18:47:50.660Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*lNhIkCOzP4mQXIYQ39fgsA.png" /><figcaption>Arch Linux Logo</figcaption></figure><p>在一個月前左右，因為各種原因要把手上的NAS搬遷，結果就是從Linux轉到FreeBSD，而結果也甚為滿意，當然因為平台與習慣的差異，直到現在還不停try and error…</p><p>回到正題，在FreeBSD User Manual當中有提到三種建立VM的方式，當中包括VirtualBox，bhyve和Xen，而今天的主角<strong>bhyve</strong>正是FreeBSD力推並包括在distro內的kvm方案，就像在Linux會用qemu-kvm，在FreeBSD當然也就要用bhyve吧（誤</p><p>話是這樣說，然而在Google上以bhyve建立的Linux VM example大部份都是Ubuntu，而bhyve自己的Arch Linux template sample也有3年沒更新了，於是只能一邊試一邊除錯。。。以下會一步步簡單說明如何安裝Arch Linux，詳情請點擊參考之連結</p><ol><li>$ pkg install vm-bhyve grub2-bhyve</li><li>$ kldload if_bridge if_tap nmdm vmm</li><li>在/boot/loader.conf加入以下四行</li></ol><blockquote>echo ‘if_bridge_load=”YES”’ &gt;&gt; /boot/loader.conf<br>echo ‘if_tap_load=”YES”’ &gt;&gt; /boot/loader.conf<br>echo ‘nmdm_load=”YES”’ &gt;&gt; /boot/loader.conf<br>echo ‘vmm_load=”YES”’ &gt;&gt; /boot/loader.conf</blockquote><p>4. 在/etc/rc.conf加入以下四行</p><blockquote>vm_enable=”YES”<br>vm_dir=”zfs:zroot/vms” #這裡是指你zfs中分配給vm的volume,請自行修改<br>sysrc vm_list=””<br>sysrc vm_delay=”5&quot;</blockquote><p>5. $ zfs create -o mountpoint=<strong>/vms</strong> zroot/vms<br>6. $ vm init<br>7. $ cp /usr/local/share/examples/vm-bhyve/* <strong>/vms</strong>/.templates/<br>8. $ vm switch create public<br>9. $ vm switch add public em0<br>10. $ vm iso <a href="https://mirror.xtom.com.hk/archlinux/iso/2019.06.01/archlinux-2019.06.01-x86_64.iso">https://mirror.xtom.com.hk/archlinux/iso/2019.06.01/archlinux-2019.06.01-x86_64.iso</a><br>11. $ vm create -t arch -s 100G vm-name #名字和大小自己改<br>12. $ env EDITOR=vim vm configure vm-name #把archisolabel改成你iso的年月，這裡的例子就是ARCH_201906<br>13. $ vm install vm-name archlinux-2019.06.01-x86_64.iso<br>14. $ vm console vm-name #注意!此命令沒有退出選項，所以請於tmux執行方便把整個process直接拋棄<br>15. 進入arch linux安裝界面,直接安裝就ok<br>16. 安裝完成後就把shutdown，別reboot，然後把process kill掉/換tty<br>17. $ vm start vm-name; vm console vm-name<br>18. 在進入vm後應該會卡在grub shell，別急，這時請用ls把grub.cfg的位置找出來，我自己是在(hd0,msdos1)/grub<br>19. 然後再次kill掉process/換tty，執行 $ env EDITOR=vim vm configure vm-name<br>20. 加入以下兩行，其內容自己改動</p><blockquote>#bhyve的grub default會找(hd0,1)/boot/grub<br>grub_run_partition=”msdos1&quot; #這行是指示bhyve的grub去找(hd0,msdos1)<br>grub_run_dir=”/grub” #這行則是/boot/grub變成/grub</blockquote><p>21. 再次$ vm start vm-name<br>22. linux正常啟動，可隨便玩了，建議設定好ssh，免受console之苦</p><p>參考：</p><ol><li><a href="https://www.davd.io/install-ubuntu-on-freebsd-with-bhyve/">https://www.davd.io/install-ubuntu-on-freebsd-with-bhyve/</a></li><li><a href="https://github.com/churchers/vm-bhyve/wiki/Configuring-Grub-Guests">https://github.com/churchers/vm-bhyve/wiki/Configuring-Grub-Guests</a></li></ol><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=142e88464d70" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[轉玩Medium]]></title>
            <link>https://medium.com/@fgo.inai/%E8%BD%89%E7%8E%A9medium-61a2a67eebc2?source=rss-710a64f5e62b------2</link>
            <guid isPermaLink="false">https://medium.com/p/61a2a67eebc2</guid>
            <dc:creator><![CDATA[FGOINAI]]></dc:creator>
            <pubDate>Mon, 04 Mar 2019 16:42:47 GMT</pubDate>
            <atom:updated>2019-03-04T16:42:47.940Z</atom:updated>
            <content:encoded><![CDATA[<h3>警告</h3><p>此文內含粗口及不當思想,道德撚請禁Ctrl+W遠離此地</p><h3>前言</h3><p>雖然呢篇實際上係我係Medium第三篇文,但嚴格黎講可以當呢篇係我入駐Medium嘅起點,之前果兩篇分別係宣傳我寫嘅lib(雖然依家暫時onhold左)同試寫既install arch linux on nvidia displaycard laptop,唔算係正式入駐</p><p>其實之前一路有試過wordpress,github pages,blogspot,自己host server寫blog等等,每個方式都有其優劣,其中我比較滿意嘅係blogspot,奈何用落仍然覺得好撚麻煩,寫左寥寥幾篇就皮已收,無他,我係一條懶到出汁嘅仆街</p><p>因工作關係,輾轉黎到Medium,寫第一篇時發現排版功能甚少,寫落煩少好多野,而且實際post出黎效果唔差,對於連寫template都覺得煩嘅我黎講,Medium呢種好似Markdown嘅做法令我好舒服,less is more</p><h3>展望</h3><p>係Medium寫文唔望發達,單純有個平台有動力俾自己寫下野,可以bootstrap咁永續會員(即係賺埋夠俾年費)我已經心滿意足</p><p>我係呢樹會寫乜鳩?試下list下出黎先</p><ol><li>小說</li><li>毒撚評論(輕小說為主)</li><li>書評</li><li>IT野(Programming為主)</li><li>其他bull shit,例如耳機/機械keyboard/政治/酒/砌機/打機…</li></ol><p>大概係咁啦,基本上除左1我會限制自己最少一星期出到兩篇外,其他隨心隨意隨緣啦,1同4會用白話文外其他就用廣東話,雖然小說我都諗緊用廣東話寫...</p><h3>總結</h3><p>TL;DR. 總之就係Medium吸引到我黎寫,內容係毒撚雜記,乜撚都有,希望會保持到出文啦</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=61a2a67eebc2" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[於有Nvidia獨立顯示卡的Laptop上安裝Arch Linux]]></title>
            <link>https://medium.com/@fgo.inai/%E6%96%BC%E6%9C%89nvidia%E7%8D%A8%E7%AB%8B%E9%A1%AF%E7%A4%BA%E5%8D%A1%E7%9A%84laptop%E4%B8%8A%E5%AE%89%E8%A3%9Darch-linux-579f90b308dd?source=rss-710a64f5e62b------2</link>
            <guid isPermaLink="false">https://medium.com/p/579f90b308dd</guid>
            <category><![CDATA[laptop]]></category>
            <category><![CDATA[arch-linux]]></category>
            <category><![CDATA[installation]]></category>
            <category><![CDATA[nvidia]]></category>
            <dc:creator><![CDATA[FGOINAI]]></dc:creator>
            <pubDate>Mon, 04 Mar 2019 15:49:17 GMT</pubDate>
            <atom:updated>2019-03-04T15:49:17.414Z</atom:updated>
            <content:encoded><![CDATA[<p>本文對象:</p><ul><li>對linux安裝已有一定經驗並對linux架構有一定認識</li><li>不怕麻煩</li><li>懂得遇事不決問google/stackoverflow</li></ul><p>本文乃針對於帶獨立N記顯卡的laptop上安裝Arch Linux的主要步驟,故對於Arch Linux安裝過程不熟悉的讀者請先於VM嘗試一次全套安裝過程</p><p>各步驟如無特別問題,皆只會列出what to do而不會列出how to do,因為問題在於nvidia顯示卡的open source driver <strong>nouveau</strong> 在特定情況下會令cpu lock up,也就是死機</p><p><strong>提示:</strong></p><p>本文內所有內容皆不保證100%可行,更不保證此文內容不會對讀者的laptop產失各種損失,還請責任自負</p><h3>基本流程</h3><ol><li>製作開機usb drive</li><li>開機時選擇以usb drive啟動,在grub選單按e,在啟動行加上參數nouveau.modeset=0</li><li>進入安裝程式,安裝bootloader及microcode後先停下來</li><li>此時可安裝display driver,有三種可行選擇</li></ol><ul><li>只啟用獨立顯卡(Nvidia)</li><li>只啟用集成顯卡(Intel)</li><li>啟用集成顯卡,並針定特定程式手動啟用獨立顯卡(hybrid)</li></ul><h3>只啟用獨立顯卡(Nvidia)</h3><ol><li>安裝nvidia/nvidia-lts</li><li>於/etc/default/grub的<strong>GRUB_CMDLINE_LINUX</strong>加上<strong>nvidia-drm.modeset=1 nouveau.modeset=0</strong></li><li><strong>grub-mkconfig -o /boot/grub/grub.cfg</strong></li><li>於<strong>/etc/mkinitcpio.conf </strong>-&gt; <strong>MODULES</strong>部份加上nvidia, nvidia_modeset, nvidia_uvm, nvidia_drm</li><li><strong>mkinitcpio -p linux</strong></li><li>加上<a href="https://wiki.archlinux.org/index.php/Nvidia#Pacman_hook">pacman hook</a></li><li><strong>depmod</strong></li><li><strong>modprobe nvidia</strong></li><li>重啟,進入os</li></ol><h3>只啟用集成顯卡(Intel)</h3><ol><li>安裝<strong>mesa,xf86-video-intel,vulkan-intel</strong></li><li>於/etc/default/grub的<strong>GRUB_CMDLINE_LINUX</strong>加上<strong>nouveau.modeset=0</strong></li><li><strong>grub-mkconfig -o /boot/grub/grub.cfg</strong></li><li>重啟</li></ol><h3>啟用集成顯卡,並針定特定程式手動啟用獨立顯卡(hybrid)</h3><p>先說好一句,這部份有四個較為主流的方案,而每一個方案在不同的laptop上行不行得通是God knows,不試不會知道的</p><p>方案分別為</p><ol><li><a href="https://wiki.archlinux.org/index.php/Bumblebee"><strong>bumblebee</strong></a></li><li><a href="https://wiki.archlinux.org/index.php/NVIDIA_Optimus">Nvidia Optimus</a></li><li><a href="https://wiki.archlinux.org/index.php/PRIME">PRIME</a></li><li><a href="https://wiki.archlinux.org/index.php/Nvidia-xrun">Nvidia-xrun</a></li></ol><p>此文只介紹bumblebee,如此方案無效請查看Arch Linux wiki</p><p><strong>步驟</strong></p><ol><li>安裝xf86-video-intel,mesa,nvidia/nvidia-lts,bumblebee,primus</li><li>depmod &amp;&amp; modsprobe nvidia</li><li><strong>gpasswd -a ${user} bumblebee </strong>#${user}為你使用的account username</li><li>systemctl enable bumblebee</li><li>reboot</li><li>針對要使用nvidia顯卡的程式使用primusrun,例子如下</li></ol><blockquote>LC_ALL=ja.JP.UTF-8 primusrun wine まいてつ.exe</blockquote><h3>WT…安裝nvidia後卡死急救</h3><ol><li>以安裝用的usb drive啟動laptop</li><li>在arch-chroot前確保已連上網絡</li><li>arch-chroot, 以pacman -Rs反安裝nvidia或hybrid driver,並把/etc/mkinitcpio.conf和/etc/default/grub內有關nvidia的參數移除</li><li>別忘了mkinitcpio和grub-mkconfig</li><li>換個方案再試</li><li>再不行就放棄只用intel吧...</li></ol><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=579f90b308dd" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Publication of Rust Functional Programming Library — KaguyaRs]]></title>
            <link>https://medium.com/@fgo.inai/publication-of-rust-functional-programming-library-kaguyars-7401f1e1e43e?source=rss-710a64f5e62b------2</link>
            <guid isPermaLink="false">https://medium.com/p/7401f1e1e43e</guid>
            <category><![CDATA[rust]]></category>
            <category><![CDATA[functional-programming]]></category>
            <dc:creator><![CDATA[FGOINAI]]></dc:creator>
            <pubDate>Tue, 22 May 2018 14:39:12 GMT</pubDate>
            <atom:updated>2018-05-22T14:39:12.418Z</atom:updated>
            <content:encoded><![CDATA[<p>First, let me share my library link first: <a href="https://github.com/fgoinai/KaguyaRs">https://github.com/fgoinai/KaguyaRs</a></p><p>I tried using Rust to write some tools around two months ago. During this two months, I study Rust through Programming Rust and write some tools that makes my Linux life more convenience. However I found that there is no usable functional programming tools in crate.io, and also github. That’s push me to write this library.</p><p>In current commit, only two macros are provided: compose! and pipe!. compose! is to combine functions and invoke them based on the order last-in-first-invoke. pipe! is similar to compose! but the order is last-in-last-invoke.</p><p>I have roadmap about how KaguyaRs is implement. Basically common functions like map/filter/fold will be implemented ASAP, with non-curry function and curry macro. For the others, it depends on how important the function is.</p><p>Besides function, ADTs like Lens/Monad/Functor/Applicative will also be implemented as trait. They will impl for Rust std struct and enum like Option&lt;T&gt; and Result&lt;O,E&gt;.</p><p>This requires time. I will implement them one by one. During this period, I will also share my experience and comment about Rust that may helps all of you.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7401f1e1e43e" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>