tag:blogger.com,1999:blog-23853892802097907432024-03-27T14:37:40.014+08:00阿就操場啊~阿操http://www.blogger.com/profile/12449760480609795429noreply@blogger.comBlogger1165125tag:blogger.com,1999:blog-2385389280209790743.post-38507945585825763722024-03-03T16:58:00.001+08:002024-03-26T13:39:16.429+08:00關閉Windows上AnyViewer的開機啟動<p><span style="font-family: inherit;">安裝某些軟體到Windows上以後, 這些軟體預設會開機啟動,而且還沒有辦法從右下角小工具的設定裡面關閉。以AnyViewer為例子,解決方法是停用其<b>服務</b>選項。</span></p><p>按下『WinKey-R』執行 > 輸入『<b><span style="color: #6fa8dc;">services.msc</span></b>』> 後按下『Enter』</p><p>上述打開的視窗叫做『服務』主控台,依序執行:<span></span></p><a name='more'></a><p></p><p></p><ol style="text-align: left;"><li>找到AnyViewer Service後,點開並找到『一般』頁簽</li><li>啟動類型:調整成【<span style="color: #93c47d;"><b>手動</b></span>】</li><li>服務狀態:按下【<span style="color: #93c47d;"><b>停止(T)</b></span>】</li></ol><h2 style="text-align: left;"><span style="font-family: inherit;">參考資料</span></h2><p></p><ul style="text-align: left;"><li><a href="https://itorz324.blogspot.com/2021/04/cancel-anydesk-reboot-startup.html" target="_blank">基於「安全的理由」讓AnyDesk 開機不啟動的方法 </a></li></ul><p></p><p><span style="font-family: inherit;">_EOF_</span></p>阿操http://www.blogger.com/profile/12449760480609795429noreply@blogger.com0tag:blogger.com,1999:blog-2385389280209790743.post-4604898367305877902024-03-02T16:21:00.000+08:002024-03-26T13:38:59.137+08:00解決Ubuntu 20.04裝Mac上Wifi不通問題<p><span style="font-family: inherit;">在MacBook Pro上運行Ubuntu 20.04或22.04,第一次登入會發現沒有Wifi可以用,原因是驅動程式沒用好。過往安裝方式<a href="https://2formosa.blogspot.com/2019/10/Ubuntu1804-Wifi-not-work-on-Mac.html" target="_blank">《</a></span><a href="https://2formosa.blogspot.com/2019/10/Ubuntu1804-Wifi-not-work-on-Mac.html" target="_blank">Ubuntu 18.04用Mac啟動後Wifi不通</a><span style="font-family: inherit;"><a href="https://2formosa.blogspot.com/2019/10/Ubuntu1804-Wifi-not-work-on-Mac.html" target="_blank">》</a>在執行apt指令會出現error,那是因為系統預設安裝好的驅動不適用。錯誤訊息如下:</span></p><p><span style="font-family: courier;"></span></p><blockquote><p><span style="font-family: courier;">dpkg: error processing package bcmwl-kernel-source (--configure):<br /> subprocess installed post-installation script returned error exit status 3</span></p><p><span style="color: red; font-family: courier;">Errors were encountered while processing: <br /> bcmwl-kernel-source</span></p><p><span style="font-family: courier;">E: Sub-process /usr/bin/dpkg returned an error code (1)</span></p></blockquote><p> </p><p><span style="font-family: courier;"></span></p><p><span style="font-family: inherit;">解決方法如下:</span></p><a name='more'></a><p></p><p></p><ul style="text-align: left;"><li><span style="font-family: Roboto Mono;">sudo apt purge <span style="color: #93c47d;">bcmwl-kernel-source</span></span></li></ul><p></p><p>上述指令刪除舊的驅動之後,再用下面指令裝新的:</p><p><span></span></p><p></p><p></p><ul style="text-align: left;"><li><span style="font-family: Roboto Mono;">sudo apt install -y <span style="color: #93c47d;">broadcom-sta-source broadcom-sta-dkms broadcom-sta-common</span></span></li><li><span style="font-family: Roboto Mono;">sudo modprobe <span style="color: #93c47d;">wl</span></span></li></ul><p></p><p><span style="font-family: inherit;">都做完之後用下列指令重開機後就可以,應該就可以在右上角的icon點進去設定wifi了。以上設定參考了裡面Kevin Bowen和Atef的回答</span></p><p></p><p></p><ul style="text-align: left;"><li><a href="https://askubuntu.com/questions/1005058/dpkg-error-while-installation-bcmwl-kernel-source-on-ubuntu-16-04" target="_blank">DPKG error while installation bcmwl-kernel-source on ubuntu 16.04</a></li><li><a href="https://askubuntu.com/questions/1074225/losing-wifi-on-restart-bcm4360-18-04-lts" target="_blank">Losing wifi on restart [BCM4360 - 18.04 LTS]</a>:</li><li><a href="https://ubuntuforums.org/showthread.php?t=2397051" target="_blank">BCM4360 802.11ac not working w/ 4.15.0-29-lowlatency receint update</a>:手動裝套件</li></ul><p></p><p></p><p><span style="font-family: inherit;">_EOF_</span></p>阿操http://www.blogger.com/profile/12449760480609795429noreply@blogger.com0tag:blogger.com,1999:blog-2385389280209790743.post-51581765863023113122024-02-24T22:29:00.000+08:002024-02-24T22:29:14.071+08:00用What CMS偵測網站的架設技術<p><span style="font-family: inherit;">在<a href="https://whatcms.org/" target="_blank">What CMS</a>輸入網站的URL後,可以看到使用那些技術來架網站或是CMS(Content Management System內容管理系統)。這個偵測網站從2011年開始、2014年前可以偵測到100種架站技術、2018年有400種,到目前已經有1540種架設網站的技術:</span></p><p></p><ul style="text-align: left;"><li><b><span style="font-family: Bookman Old Style;">Detections</span></b></li><ul><li><a href="https://whatcms.org/" target="_blank"><b><span style="color: #6fa8dc;">CMS & Web Technologies</span></b></a>:What CMS Is This Site Using?<br />偵測CMS與Web的技術</li><li><a href="https://www.who-hosts-this.com/" target="_blank"><b><span style="color: #93c47d;">Hosting Providers</span></b></a>:Who Hosts This Site?<br />查詢網站架在哪家廠商下面<span><a name='more'></a></span></li><li><a href="https://www.themedetect.com/" target="_blank">WordPress Themese</a>:What WordPress Theme Is That?<br />若網站是用WordPress架設,偵測使用的主體(Theme)</li><li><a href="https://www.shopify-themes.com/" target="_blank">Shopify Themes</a>:Detect Shopify Themes</li></ul><li><b><span style="font-family: Bookman Old Style;">Resources</span></b></li><ul><li><a href="https://whatcms.org/API" target="_blank">API</a>:用程式來自動偵測架站技術,計價方式</li><li><a href="https://whatcms.org/Documentation" target="_blank">API Documentation</a>:怎麼使用API</li><li><a href="https://whatcms.org/Tech_Reports" target="_blank">Technology Reports</a>:</li><ul><li>CMS:<a href="https://whatcms.org/c/WordPress" target="_blank">WordPress</a>, <a href="https://whatcms.org/c/Shopify" target="_blank">Shopify</a>, <a href="https://whatcms.org/c/Wix" target="_blank">Wix</a>, <a href="https://whatcms.org/c/Blogger" target="_blank">Blogger</a>, ...等技術</li><li>Websites:看放在Google, AWS, Azure還是其他</li><li>Technologies:<a href="https://whatcms.org/c/PHP" target="_blank">PHP</a>, <a href="https://whatcms.org/c/MySQL" target="_blank">MySQL</a>, WordPress, <a href="https://whatcms.org/c/Apache-HTTP-Server" target="_blank">Apache</a>等技術使用占比</li><li>Hosting Provider:網站放在那些廠商的機房內</li><li>Language:網站使用的語言</li><li>TLD:.com最多,再來是.de, au, uk, org, nl, at, net等</li><li>WP Theme:WordPress用的主題,像是Divi, Astra, Hello-Elementor, Avada, GeneratePress, OceanWP, Enfold等等</li></ul><li>Batch Detections:</li><li>Technologies:偵測到使用的架站技術,<u>還有這些技術使用的比例</u></li><ul><li><a href="https://whatcms.org/Technologies/Blog" target="_blank">Blog</a>:列出32種<b>部落格</b>技術,例如WordPress</li><li><a href="https://whatcms.org/Technologies/Document-Management" target="_blank">Document Management</a>:列出4種技術,例如Open Journal Systems</li><li><a href="https://whatcms.org/Technologies/Documentation" target="_blank">Documentation</a>:列出31種技術,例如Zendesk</li><li><a href="https://whatcms.org/Technologies/E-commerce" target="_blank">E-commerce</a>:列出383種<b>電子商務</b>技術,例如WooCommerce, Shopify</li><li><a href="https://whatcms.org/Technologies/Editor" target="_blank">Editor</a>:列出18種編寫網站的技術,例如Dreamweaver</li><li><a href="https://whatcms.org/Technologies/Issue-Tracker" target="_blank">Issue Tracker</a>:列出60種技術,例如Zendesk</li><li><a href="https://whatcms.org/Technologies/Landing-Page-Builder" target="_blank">Landing Page Builder</a>:列出93種技術,例如Elementor</li><li><a href="https://whatcms.org/Technologies/Learning-Management" target="_blank">Learning Management</a>:列出22種技術,例如Moodle</li><li><a href="https://whatcms.org/Technologies/Message-Board" target="_blank">Message Board</a>:列出30種技術,例如XenForo, phpBB, vBulletin</li><li><a href="https://whatcms.org/Technologies/Other-CMS" target="_blank">Other CMS</a>:列出<span style="color: #ffa400;">549種<b>CMS</b></span>技術,例如Joomla</li><li><a href="https://whatcms.org/Technologies/Static-Site-Generator" target="_blank">Static Site Generator</a>:列出29種<b>靜態網站架設</b>技術,例如Next.js, Nuxt.js</li><li><a href="https://whatcms.org/Technologies/Website-Builder" target="_blank">Website Builder</a>:列出12種<b>架站</b>技術,例如Wix, Squarespace, Blogger</li><li><a href="https://whatcms.org/Technologies/Wiki" target="_blank">Wiki</a>:列出13種技術,例如MediaWiki, DokuWiki</li><li><a href="https://whatcms.org/Technologies/CMS" target="_blank">CMS</a>:列出<span style="color: #ffa400;">1246種<b>CMS</b></span>技術,例如WordPress, Elementor, WooCommerce,</li><li><a href="https://whatcms.org/Technologies/Web-Framework" target="_blank">Web Framework</a>:列出90種<b>網站框架</b>技術,例如ASP.NET, Laravel, Ruby on Rails</li><li><a href="https://whatcms.org/Technologies/Programming-Language" target="_blank">Programming Language</a>:列出28種<b>程式語言</b>,例如PHP, Java, Node.js</li><li><a href="https://whatcms.org/Technologies/Database" target="_blank">Database</a>:列14種<b>資料庫</b>技術,例如MySQL</li><li><a href="https://whatcms.org/Technologies/CDN" target="_blank">CDN</a>:列出54個使用的CNS,例如Cloudflare</li><li><a href="https://whatcms.org/Technologies/Web-Server" target="_blank">Web Server</a>:列出<span style="color: #ffa400;">89種<b>架網站</b></span>技術,例如Apache, Nginx, LiteSpeed, OpenRestry, IIS</li><li><a href="https://whatcms.org/Technologies/Operating-System" target="_blank">Operation System</a>:列出<span style="color: #ffa400;">20種運行網站的<b>作業系統</b></span>,例如:Windows Server, Ubuntu, UNIX, Debian, CentOS, FreeBSD等</li></ul></ul><li><a href="https://whatcms.org/API/Plans" target="_blank"><b><span style="font-family: Bookman Old Style;">Pricing</span></b></a>:買API Plan要花多少錢</li></ul><p><span style="font-family: inherit;">_EOF_</span></p>阿操http://www.blogger.com/profile/12449760480609795429noreply@blogger.com0tag:blogger.com,1999:blog-2385389280209790743.post-10396746740641241762024-02-03T13:19:00.141+08:002024-02-22T17:02:32.560+08:00台北區網中心的公開網站<p><span style="font-family: inherit;">台北區域網路中心(<a href="https://www.tp1rc.edu.tw/index.php" target="_blank">Taipei Network Regional Center</a>),網站主要分成:</span></p><p></p><ul style="text-align: left;"><li><a href="https://www.tp1rc.edu.tw/index.php" target="_blank">Home</a>:公布最新消息</li><li><a href="https://www.tp1rc.edu.tw/a1.php" target="_blank">關於台北區網</a>:聯繫訊息,連線學校列表</li><ul><li><a href="https://www.tp1rc.edu.tw/a3.php" target="_blank">網路架構</a>:由台大區網中心與ISP、TANET、NTU和其他大專院校、高中職與高國中小學連在一起</li><li>連線單位:<a href="https://www.tp1rc.edu.tw/a5.php" target="_blank">IP查詢系統</a>、<a href="https://www.tp1rc.edu.tw/a6.php" target="_blank">頻寬資料</a></li><li><a href="https://www.tp1rc.edu.tw/a7.php" target="_blank">提供服務</a>:包含WWW, DNS, Proxy, FTP, Mail, News, BBS等</li></ul><li><a href="https://www.tp1rc.edu.tw/b1.php" target="_blank">網路品質管理</a>:<a href="https://www.tp1rc.edu.tw/topology.html" target="_blank">連線架構圖</a>可搭配<a href="https://www.tp1rc.edu.tw/a3.php" target="_blank">網路架構</a>一起看</li><ul><li><a href="https://www.tp1rc.edu.tw/cacti.php" target="_blank">Cacti流量分析</a>:提供往各單位的流量圖、封包量圖、介面異常圖</li><li><a href="http://asoc52.cc.ntu.edu.tw/mrtg/" target="_blank">MRTG流量分析</a>:北區區網的總流量、封包量圖<span><a name='more'></a></span></li></ul><li><a href="https://www.tp1rc.edu.tw/c1.php" target="_blank">資訊安全</a>:一些資安的服務與概念</li><ul><li><a href="https://www.tp1rc.edu.tw/c1-DNS-amplify.php" target="_blank">DNS放大攻擊與檢測</a>:原理說明與緩解措施</li></ul><li><a href="https://www.tp1rc.edu.tw/d1.php" target="_blank">會議資料</a>:每個年度的執行成效,裡面可以看到處理網路的相關議題。</li><ul><li><a href="https://www.tp1rc.edu.tw/d1.php" target="_blank">執行成效</a>:可以找到區網中心維運與資安的簡報與計畫書</li><li><a href="https://www.tp1rc.edu.tw/d2.php" target="_blank">區網會議</a>:裡面會有很多案例分析簡報可參考</li><li><a href="https://www.tp1rc.edu.tw/d3.php" target="_blank">研討會</a>:辦理的研討會與簡報投影片檔</li></ul><li><a href="https://www.tp1rc.edu.tw/e1.php" target="_blank">技術文件</a>:各式各樣的技術分享</li><ul><li>分享GCB導入經驗</li><li>HTTPS免費憑證Let's Encrypt申請</li><li>BGP Hijacking, WAF阻擋, DDoS攻擊, 網路品質監控...</li></ul></ul><p><span style="font-family: inherit;">_EOF_</span></p>阿操http://www.blogger.com/profile/12449760480609795429noreply@blogger.com0tag:blogger.com,1999:blog-2385389280209790743.post-67828819273193555862024-01-28T13:24:00.001+08:002024-02-20T16:25:11.245+08:00災難恢復與可用性availability的時間點<p><span style="font-family: inherit;">量化系統可用性(Availability)的指標是時間,通常會說的是一年可容忍停機多久,或是用百分比來說明系統可用的時間,帶出來的幾個名詞是:</span></p><p></p><ul style="text-align: left;"><li><span style="font-family: inherit;"><b>SLA</b>:Service Level Agreement</span><b>服務水準協議</b><br />廠商給予服務水準的正式承諾文件</li><li><span style="font-family: inherit;"><b>SLO</b>:Service Level Objectives<b>服務水準目標</b><br />對SLA的服務標的之說明文件,像是在某個條件下的維修服務做到哪邊</span></li><li><span style="font-family: inherit;"><b><span style="color: #ffa400;">MTD</span></b>:Maximum Tolerable Downtime <b><span style="color: #ffa400;">最大可容忍停機時間</span></b>,通常會寫的是Annual MTD,以年為標準列出可停機的時間,MTD根據可用性高到低列出:<span><a name='more'></a></span></span></li><ul><li>6個9:MTD=32s,一年最多停機32秒,可用性是99.9999%</li><li>5個9:MTD=5m15s:最多停機5分多鐘,可用性是99.999%</li><li>4個9:MTD=52m34s:最多停機快1小時,可用性是 99.99%</li><li>3個9:MTD=8hr45m36s:最多停機8個多小時,可用性是99.9%</li><li>2個9:MTD=3d15hr36m:最多停機超過3天半,可用性是99%</li></ul></ul><p></p><p><span style="font-family: inherit;"><br /></span></p><p>談到MTD最大可停機時間,就需要說明幾個與災難(Disaster,指的是停機發生)與復原(Recovery,指的是系統恢復)相關的時間點:</p><p></p><ol style="text-align: left;"><li><b>Last backup</b>:災難發生前最後備份的時間點</li><li><b>Disaster</b>:事故(outage event)發生的時間點<br /></li><li><b>Complete system recovery</b>:完成系統還原的時間點,<b>只有系統沒有資料</b><br /></li><li>完成recovery lost data:把最後備份的資料倒回去的時間點,有系統還有部分資料</li><li><b>完成recover manually collect data</b>:把手工蒐集的資料完整倒回去,也就是<b>恢復了系統與資料</b>。這個時間點之後系統完全正常作業,但需要進一步的驗證</li><li>完成test & verify system/data:完成系統與資料的驗證。</li></ol><div>確定事件的時間點後,就可以說明各個時間區間了<strike>終於講到這篇的重點</strike>:</div><div><ul style="text-align: left;"><li><b><span style="color: #6fa8dc;">RPO</span></b>:Recovery Point Objective<b><span style="color: #6fa8dc;">可容許的最大資料損失量</span></b>(acceptable amount of data lose),從時間點1到2<br />這段時間的資料因為處於備份的空窗期,所以即便是系統復原後資料還是會有缺失。這部分缺失的資料後面會做recover work backlog來嘗試修復</li><li><b><span style="color: #93c47d;">RTO</span></b>:Recovery Time Objective<b><span style="color: #93c47d;">讓系統重新上線花費的時間</span></b>(acceptable amount of downtime),即時間點2到3<br />這段時間系統因為事故而無法正常運行,所以重點會是恢復整個系統,簡稱work backlog,注意到這邊資料都還沒有倒回去,所以系統是空的</li><li><b>WRT</b>:Work Recovery Time將工作恢復到之前的服務水準,時間點從3到5。</li><ul><li>這段時間就是將備份的資料倒回去,時間點從3到4</li><ul><li>嘗試修復RPO這段時間失去的資料叫recover work backlog,注意這部分不是把備份倒回去</li><li>把備份倒回去這個動作叫做recover lost data</li></ul><li>對於當下無法上系統的資料要先手工處理後然後再上系統,時間從3到5<br />把手工處理蒐集的資料倒進去叫做recover manually collect data</li></ul><li><b><span style="color: #ffa400;">MTD</span></b>:等於<b><span style="color: #93c47d;">RTO</span>+WRT</b>,從災難發生到系統完全恢復,時間從2到5</li></ul></div><div><br /></div><p></p><h2 style="text-align: left;"><span style="font-family: inherit;">參考文件</span></h2><p></p><ul style="text-align: left;"><li><a href="https://www.uuu.com.tw/Public/content/article/21/20211101.htm" target="_blank">漫談高可用性與災難重建的規劃與評估(第三集)</a> by Joseph Tu:有圖與解釋</li><li><a href="https://tomtomtom456.pixnet.net/blog/post/47284725" target="_blank">RPO, RTO, WRT 與 MTD</a>@Dog's Life 2.0:有圖有解釋有例子</li></ul><p></p><p><span style="font-family: inherit;">_EOF_</span></p>阿操http://www.blogger.com/profile/12449760480609795429noreply@blogger.com0tag:blogger.com,1999:blog-2385389280209790743.post-60752386306778836682024-01-27T20:00:00.008+08:002024-02-06T22:20:39.983+08:00用指令nslookup與dig查詢DNS資訊<p><span style="font-family: inherit;">在Windows裡面要查詢網域domain name的相關資訊,可以用nslookup。已舊交大的網域<b>nctu.edu.tw</b>為例,用指令去問Google的DNS(<span style="color: #93c47d;">8.8.8.8</span>也就是dns.google)</span><span style="font-family: inherit;">: </span></p><p></p><ul style="text-align: left;"><li><span style="font-family: Roboto Mono;">nslookup <b>nctu.edu.tw</b></span></li><li><span style="font-family: Roboto Mono;">nslookup <span style="color: #6fa8dc;">-q=all</span> <b>nctu.edu.tw</b></span></li></ul><p></p><p>若想要分項看,可以設定<span style="color: #6fa8dc; font-family: Roboto Mono;">-q</span>;若需要詳細資料請加上參數<span style="color: #ffa400; font-family: Roboto Mono;">-debug</span>:<span></span></p><a name='more'></a><p></p><p></p><ol style="text-align: left;"><li><span style="font-family: Roboto Mono;">nslookup <span style="color: #6fa8dc;">-q=soa</span> <b>nctu.edu.tw</b> <span style="color: #93c47d;">8.8.8.8</span></span><br />看SOA的設定,還可以看到default TTL</li><li><span style="font-family: Roboto Mono;">nslookup <span style="color: #6fa8dc;">-q=ns</span> <b>nctu.edu.tw</b> <span style="color: #93c47d;">8.8.8.8</span></span><br />列出這個網域的名稱伺服器有哪幾台,找到名稱後再來找IP</li><li><span style="font-family: Roboto Mono;">nslookup <span style="color: #6fa8dc;">-q=a</span> ns1.nycu.edu.tw <span style="color: #93c47d;">8.8.8.8</span></span><br />看某台機器對應到的實際IP address</li><li><span style="font-family: Roboto Mono;">nslookup <span style="color: #6fa8dc;">-q=mx</span> <b>nctu.edu.tw</b> <span style="color: #93c47d;">8.8.8.8</span></span><br />列出此網域的郵件伺服器</li><li><span style="font-family: Roboto Mono;">nslookup <span style="color: #6fa8dc;">-q=cname</span> www.nycu.edu.tw <span style="color: #93c47d;">8.8.8.8</span></span><br />看Canonical Name指到哪裡,這邊是nycu-nctu.cdn.hinet.net</li><li><span style="font-family: Roboto Mono;">nslookup <span style="color: #6fa8dc;">-q=txt</span> <b>nctu.edu.tw</b> <span style="color: #93c47d;">8.8.8.8</span></span><br />列出網域所有的TXT record</li><li><span style="font-family: Roboto Mono;">nslookup <span style="color: #6fa8dc;">-q=txt</span> <b>nctu.edu.tw</b> <span style="color: #93c47d;">8.8.8.8</span> | find "<b>spf</b>"</span><br />列出TXT record裡面與郵件相關的SPF設定</li></ol><p></p><p><span style="font-family: inherit;"><br /></span></p><p><span style="font-family: inherit;">在Linux或BSD裡面,則可以使用dig;若不要詳細內容加上參數</span><span style="color: #ffa400; font-family: Roboto Mono;">+short</span><span style="font-family: inherit;">:</span></p><p></p><ol style="text-align: left;"><li><span style="font-family: Roboto Mono;">dig <span style="color: #93c47d;">@8.8.8.8</span> <span style="color: #6fa8dc;">-t soa</span> +short nctu.edu.tw</span><br />得到精簡的回答ns1.nycu.edu.tw. hostmaster.ncyu.edu.tw. 2024010401 10800 3600 604800 3600</li><li><span style="font-family: Roboto Mono;">dig <span style="color: #93c47d;">@8.8.8.8</span> <span style="color: #6fa8dc;">-t ns</span> +short <b>nctu.edu.tw</b></span><br />列出網域的名稱伺服器</li><li><span style="font-family: Roboto Mono;">dig <span style="color: #93c47d;">@8.8.8.8</span> <span style="color: #6fa8dc;">-t a</span> +short ns1.nycu.edu.tw</span><br />看到某台伺服器的IP是140.113.6.1</li><li><span style="font-family: Roboto Mono;">dig <span style="color: #93c47d;">@8.8.8.8</span> <span style="color: #6fa8dc;">-t mx</span> +short <b>nctu.edu.tw</b></span><br />列出郵件伺服器,與他們的priority</li><li><span style="font-family: Roboto Mono;">dig <span style="color: #93c47d;">@8.8.8.8</span> <span style="color: #6fa8dc;">-t cname</span> +short www.nycu.edu.tw</span><br />列出Canonical Name</li><li><span style="font-family: Roboto Mono;">dig <span style="color: #93c47d;">@8.8.8.8</span> <span style="color: #6fa8dc;">-t txt</span> +short <b>nctu.edu.tw</b></span><br />列出所有的TXT record</li><li><span style="font-family: Roboto Mono;">dig <span style="color: #93c47d;">@8.8.8.8</span> <span style="color: #6fa8dc;">-t txt</span> +short <b>nctu.edu.tw</b> | grep "spf"</span><br />挖出TXT record裡面跟寄件相關的spf設定</li></ol><p></p><p><span style="font-family: inherit;"><br /></span></p><h2 style="text-align: left;"><span style="font-family: inherit;">參考資料</span></h2><p></p><ul style="text-align: left;"><li><a href="https://blog.miniasp.com/post/2010/12/27/DNS-query-process-explained-using-nslookup" target="_blank">為什麼 nslookup 的查詢結果會有「未經授權的回答」的狀況</a></li><li><a href="https://2formosa.blogspot.com/2018/08/twnicdns-101101101101.html" target="_blank">TWNIC的免費DNS 101.101.101.101</a>:可以把8.8.8.8取代成這台</li><li><a href="https://2formosa.blogspot.com/2023/11/check-DNS-setup-by-whatsmydns.net.html" target="_blank">用whatsmydns檢查DNS是否設定成功</a>:圖形化查詢DNS紀錄的網站</li><li><a href="https://2formosa.blogspot.com/2020/12/windows-detects-dhcp-or-dns-server-ip-address.html" target="_blank">Windows偵測使用的DHCP與DNS</a>:看本機預設的DNS是哪一台</li><li><a href="https://blog.miniasp.com/post/2010/12/15/DNS-Client-query-question-about-Root-hints-response" target="_blank">釐清 DNS Client 查詢過程的異象 ( 當名稱伺服器停用遞迴時 )</a>:DNS 名稱伺服器查詢到的結果卻不是 Query refused,而是一堆 根提示 ( Root Hint ) 的資料的原因</li></ul><p></p><p><span style="font-family: inherit;">_EOF_</span></p>阿操http://www.blogger.com/profile/12449760480609795429noreply@blogger.com0tag:blogger.com,1999:blog-2385389280209790743.post-49787072185168951832024-01-21T20:58:00.005+08:002024-01-21T21:30:59.302+08:00《Back on the Rocks》<p><span style="font-family: inherit;">Initial D - Back on the Rocks [AMV], 4m53s</span></p><p><span style="font-family: inherit;"><iframe allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" allowfullscreen="" frameborder="0" height="380" src="https://www.youtube.com/embed/Y1EbiK3hlnA" title="Initial D - Back on the Rocks [AMV]" width="555"></iframe></span></p><p><span style="font-family: inherit;">這影片的片頭是巴哈的D小調觸技曲與賦格BWV 565(Bach, Toccata and Fuga D minor BWV 565),對於頭文字D迷一聽到這個片頭就知道該出場的是東瀛戰神GTR。<span></span></span></p><a name='more'></a><p>BACK ON THE ROCKS · MEGA NRG MAN, SUPER EUROBEAT VOL.77@AVEX MUSIC CREATIVE INC., 3m47s</p><p><iframe allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" allowfullscreen="" frameborder="0" height="380" src="https://www.youtube.com/embed/OMDkA1-VWlc" title="BACK ON THE ROCKS" width="555"></iframe></p><p><span style="font-family: inherit;">提到東瀛戰神Nissan GTR,看到這篇<a href="https://autos.udn.com/autos/story/7826/6373730" target="_blank">《R32-R35世代的Nissan GT-R大比拚 勝負不重要 畫面永流傳》</a>,把Skyline GT-R32, R33, R34和R35(特殊版GT-R NISMO)放在一起比較。在上個世紀前三台搭載RB26DETT的2.6升直列六缸雙渦輪增壓引擎的,大概300匹馬力就是超跑了;但到了新世紀的VR38DETT 3.8升V6雙渦輪增壓引擎就直接到600匹馬力。這個2022年的影片如下</span></p><p><span style="font-family: inherit;"><iframe allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" allowfullscreen="" frameborder="0" height="380" src="https://www.youtube.com/embed/7c6_sOB0az0" title="EVERY Nissan GT-R DRAG RACE!" width="555"></iframe></span></p><p>在2023年,日產又出了【R32EV】vol.1,這影片吊人胃口</p><p><iframe width="555" height="380" src="https://www.youtube.com/embed/6-OJ-ZcXqms" title="【R32EV】vol.1" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" allowfullscreen></iframe></p><p><span style="font-family: inherit;">_EOF_</span></p>阿操http://www.blogger.com/profile/12449760480609795429noreply@blogger.com0tag:blogger.com,1999:blog-2385389280209790743.post-87230769466121620112023-12-29T11:26:00.257+08:002024-01-21T17:33:20.077+08:00楓葉國的Fraser Institute智庫<p><span style="font-family: inherit;">加拿大的<a href="https://www.fraserinstitute.org/" target="_blank">FRASER INSTITUTE</a>是個有50年歷史的智庫,有一些有趣的調查可以查閱:</span></p><p></p><ul style="text-align: left;"><li><a href="https://www.fraserinstitute.org/economic-freedom" target="_blank"><b><span style="color: #6fa8dc;">Economic Freedom</span></b></a>:<span style="color: #6fa8dc;">經濟自由度</span>的地圖,從1975年到2021年</li><li><a href="https://www.compareschoolrankings.org/" target="_blank"><b>School Ranking</b></a>:加拿大小學與國中的學校排名,楓葉國中小學有很多種</li><ol><li>Public School:公辦公營的傳統公立學校</li><li>Private School:私辦私營的私立學校</li><li>Separate School:獨立學校,接受公費但由獨立的教育局管理的學校。運作在安大略省(Ontario)及魁北克省(Quebec),通常是宗教學校</li><li>Charter School:公辦私營的特許學校</li><li>Francophone School:法語學校</li><li>First Nations School:原住民學校</li></ol><li><a href="https://www.fraserinstitute.org/education-programs" target="_blank"><b>Education Programs</b></a>:楓葉國的教育資源,應該是中小學的<br /><br /></li></ul><div>既然是智庫,那麼就會有<b><a href="https://www.fraserinstitute.org/research" target="_blank"><span style="color: #93c47d;">鑽研的議題</span></a></b>,依字母順序可分成:</div><div><span><a name='more'></a></span></div><ul style="text-align: left;"><ol><li><a href="https://www.fraserinstitute.org/studies/aboriginal-policy" target="_blank">Aboriginal Policy</a>:原住民政策</li><li><a href="https://www.fraserinstitute.org/studies/pensions-retirement" target="_blank">Aging, Retirement, and Pensions</a>:退休與養老</li><li><a href="https://www.fraserinstitute.org/studies/competitiveness" target="_blank">Competitiveness</a>:國家競爭力</li><li><a href="https://www.fraserinstitute.org/studies/covid" target="_blank">COVID-19</a>:那個肺炎</li><li><a href="https://www.fraserinstitute.org/studies/economic-freedom" target="_blank">Economic Freedom</a>:經濟自由度</li><li><a href="https://www.fraserinstitute.org/studies/education" target="_blank">Education Policy</a>:教育政策</li><li><a href="https://www.fraserinstitute.org/categories/energy" target="_blank">Energy</a>:能源政策</li><li><a href="https://www.fraserinstitute.org/studies/environment" target="_blank">Environment</a>:環境政策</li><li><a href="https://www.fraserinstitute.org/studies/esg" target="_blank">ESG</a>:現在很流行的Environmental, Social and Governance</li><li><a href="https://www.fraserinstitute.org/studies/federal-reform" target="_blank">Federal Reform Series</a>:聯邦改革系列</li><li><a href="https://www.fraserinstitute.org/studies/government-spending-taxes" target="_blank">Government Spending & Taxes</a>:政府支出與稅收</li><li><a href="https://www.fraserinstitute.org/studies/health-care" target="_blank">Health Care</a>:醫療保健</li><li><a href="https://www.fraserinstitute.org/studies/labour-policy" target="_blank">Labour Policy</a>:勞工政策</li><li><a href="https://www.fraserinstitute.org/categories/monetary-policy-banking" target="_blank">Monetary Policy & Banking</a>:貨幣政策</li><li><a href="https://www.fraserinstitute.org/studies/municipal-policy" target="_blank">Municipal Policy</a>:市政</li><li><a href="https://www.fraserinstitute.org/studies/natural-resources" target="_blank">Natural Resources</a>:自然資源</li><li><a href="https://www.fraserinstitute.org/studies/poverty-inequality" target="_blank">Poverty and Inequality</a>:貧困與不平等</li><li><a href="https://www.fraserinstitute.org/studies/provincial-prosperity" target="_blank">Provincial Prosperity</a>:省的繁榮</li><li><a href="https://www.fraserinstitute.org/studies/realities-of-socialism" target="_blank">Realities of Socialism</a>:社會主義的現實</li><li><a href="https://www.fraserinstitute.org/studies/school-report-cards" target="_blank">School Report Cards</a>:</li><li><a href="https://www.essentialscholars.org/" target="_blank">Essential Scholars</a>:重要學者</li><li><a href="https://www.fraserinstitute.org/studies/other-topics" target="_blank">Other Research Topics</a>:較少提到的議題,但有超過一年以前的文章</li><ul><li><a href="https://www.fraserinstitute.org/categories/crime-drug-policy" target="_blank">Crime & Drug Policy</a>:犯罪與毒品政策</li><li><a href="https://www.fraserinstitute.org/categories/defence-security" target="_blank">Defence & Security</a>:國防與安全</li><li><a href="https://www.fraserinstitute.org/categories/entrepreneurship" target="_blank">Entrepreneurship</a>:企業家精神</li><li><a href="https://www.fraserinstitute.org/categories/democracy-governance" target="_blank">Democracy & Governance</a>:民主與治理</li><li><a href="https://www.fraserinstitute.org/categories/immigration" target="_blank">Immigration</a>:移民</li><li><a href="https://www.fraserinstitute.org/categories/privatization" target="_blank">Privatization</a>:私有化</li><li><a href="https://www.fraserinstitute.org/categories/risk-regulation" target="_blank">Risk & Regulation</a>:風險與監管</li><li><a href="https://www.fraserinstitute.org/studies/trade-us-relations" target="_blank">Trade and US Relations</a>:貿易與美國關係</li><li><a href="https://www.fraserinstitute.org/categories/transportation-infrastructure" target="_blank">Transportation & Infrastructure:</a>交通與基礎設施</li></ul><li><a href="https://www.fraserinstitute.org/more-from-the-fraser-institute" target="_blank">More from the Fraser Institute</a>:一些專題,有自己另外的首頁</li><ul><li><a href="https://www.fraserinstitute.org/more-from-the-fraser-institute" target="_blank">Addington Centre for Measurement</a>:</li><li><a href="https://www.compareschoolrankings.org/" target="_blank">Compare School Rankings</a>:<br />連結到前面提到的中小學排名網頁</li><li><a href="https://econjwatch.org/" target="_blank">EJW - Econ Journal Watch</a>:<br />Scholarly Comments on Academic Economics</li><li><a href="https://www.essentialscholars.org/" target="_blank">Essential Scholars</a>:重要學者</li><li>Fraser Legacy:</li><li><a href="https://www.fraserinstitute.org/studies/troubled-waters-for-the-canadian-economy" target="_blank">Troubled Waters for the Canadian Economy</a>:<br />楓葉國經濟的隱憂</li><li><a href="https://womenandprogress.org/" target="_blank">Women and Progress</a>:婦女與進步</li></ul></ol></ul><p></p><p><span style="font-family: inherit;"><br /></span></p><h2 style="text-align: left;"><span style="font-family: inherit;">參考資料</span></h2><p></p><ul style="text-align: left;"><li><a href="https://en.wikipedia.org/wiki/Fraser_Institute" target="_blank">Fraser Institute</a>@Wikipedia:有提到到此機構的資金來源,政治偏向為自由主義(libertarian)。會訂出楓葉國的免稅日(Tax Freedom Day)</li><li><a href="https://crossing.cw.com.tw/article/10617" target="_blank">這世界真沒有所謂的「公平」:美國特許小學、私立小學大不同</a>@換日線</li><li><a href="http://www.ohstudy.net/page_news1.php?country=OC&semid=604" target="_blank">公立中學VS私立中學</a>:獨立學校的說明從這邊找到的 </li><li><a href="https://www2.gov.bc.ca/gov/content/education-training/k-12/administration/program-management/indigenous-education/first-nations-schools" target="_blank">First Nations Schools</a>:British Columbia省對原住民學校法源的說明</li></ul><p></p><p><span style="font-family: inherit;">_EOF_</span></p>阿操http://www.blogger.com/profile/12449760480609795429noreply@blogger.com0tag:blogger.com,1999:blog-2385389280209790743.post-33621516601260013552023-12-28T15:42:00.201+08:002024-02-21T16:32:35.889+08:00應用程式架構:單體、三層、微服務<div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgUUIhNU2UDz-wfmkdbru2RtBsrPtlMRz7YLCfO-WXwIJn8JvdcBOKjL1OdRJQunDJjqjhjsZNhj1yyzOJrLm41U75PnMUjWs_KqT0iWLi4BogbWQhQ8EnswF7QQRfuibDunXXmpaa6MAlDjAq1HLA5sEyFEM4A4z19dId9UfVVrNcGletrY6Ie44LZehGY/s1280/00012.png" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="640" data-original-width="1280" height="256" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgUUIhNU2UDz-wfmkdbru2RtBsrPtlMRz7YLCfO-WXwIJn8JvdcBOKjL1OdRJQunDJjqjhjsZNhj1yyzOJrLm41U75PnMUjWs_KqT0iWLi4BogbWQhQ8EnswF7QQRfuibDunXXmpaa6MAlDjAq1HLA5sEyFEM4A4z19dId9UfVVrNcGletrY6Ie44LZehGY/s320/00012.png" width="512" /></a></div><p>應用軟體設計(application design, software architechture)架構的演進從單體式(<b><span style="font-family: Bookman Old Style;">Monolithic</span></b>)到多層架構(<b><span style="font-family: Bookman Old Style;">Multitier</span></b>)到微服務(<b><span style="font-family: Bookman Old Style;">Microservice</span></b>)的架構:</p><p></p><ul style="text-align: left;"><li><span style="font-family: Bookman Old Style;"><b><u>Monolithic Architecture</u></b></span>:單體式架構,將所有的功能都塞在一起。為了方便開發與維護,漸漸地會將下列應用程式的功能模組化:</li><ol><li><span style="color: #6fa8dc;"><b>UI (User Interface)</b></span>:使用者接觸到的介面</li><li><b><span style="color: #93c47d;">Business logic</span></b>:商業運行邏輯</li><li><b><span style="color: #ffa400;">Data</span></b>:應用程式要用到的資料<span><br /><a name='more'></a></span><br /></li></ol><li><span style="font-family: Bookman Old Style;"><b><u>Multitier</u></b></span>:通常會是三層架構(<b><span style="font-family: Bookman Old Style;">3 Tiers Architecture</span></b>),把monolithic架構拆分地的UI, logic, data等功能對應到下列三層:</li><ol><li><span style="color: #6fa8dc;"><b>Presentation layer</b></span>:由前端(Frontend)開發,把從使用者接到的需求丟到後面的logic layer來處理,不會直接存取data layer的資料。</li><li><b><span style="color: #93c47d;">Logic layer</span></b>:由後端(Backend)開發,根據business logic來處理需求,並且與data layer溝通完成使用者的需求後,把結果丟回presentation layer。</li><li><b><span style="color: #ffa400;">Data layer</span></b>:由資料庫管理員(Database admin)來維護,提供logic layer處理需求所需的資料。不會與presentation layer有所溝通。<br /><br /></li></ol><li><span style="font-family: Bookman Old Style;"><b><u>Microservice</u></b></span>:微服務,把軟體提供的每一項功能都拆開後,單一功能由一個微服務來提供。</li><ol><li><b><span style="color: #6fa8dc;">API Gateway</span></b>:接收使用者從不同裝置的需求,透過API丟到微服務</li><li><b><span style="color: #93c47d;">Microservices</span></b>:每個拆分的功能都由一個微服務來提供,每個微服務可以由不同的開發團隊來開發;微服務之間溝通透過所謂的surface area,例如說:gRPC, event streaming, message broker等等來達成。</li><li>將資料庫的資料拆分到微服務中</li></ol></ul><p></p><p><br /></p><h2 style="text-align: left;">參考資料</h2><p></p><ul style="text-align: left;"><li><a href="https://www.youtube.com/watch?v=lL_j7ilk7rc" target="_blank">Microservices Explained in 5 Minutes</a>@5 Minutes or Less:五分鐘理解monolithic, 3-tier architecture, microservice的影片,本文的內容整理自這個影片</li><li><a href="https://www.youtube.com/watch?v=lTAcCNbJ7KE" target="_blank">What Are Microservices Really All About? (And When Not To Use It)</a>@ByteByteGo:說明微服務會遇到的困難,建議小公司先從monolithic開始,變大後再慢慢轉到microservice</li><li><a href="https://www.youtube.com/watch?v=6ULyxuHKxg8" target="_blank">What is API Gateway?</a>@ByteByteGo:解說從client到API的資料流</li><li><a href="https://vicxu.medium.com/web-server-and-application-server-5a6d9c940eff" target="_blank">淺談 Web Server and Application Server</a>:AppServer負責 business logic 的執行以及資料庫的存取。<br />Common Gateway Interface, Java 的 Servlet, Python 的WSGI, Ruby的Rack</li></ul><p></p><p>_EOF_</p><p><span style="font-family: Inconsolata;">Postprocess upscale by: 2.5, Postprocess upscaler: R-ESRGAN 4x+ Anime6B</span></p><p><span style="font-family: courier;">Time taken: <b>21.6 sec.</b> on Nvidia MX550<br />A: 1.23 GB, R: 1.28 GB, Sys: 1.8/2 GB (89.2%)</span></p><p><span style="font-family: Bookman Old Style;">Monolithic, Multitier, Microservice, sci-fi</span></p><p><span style="font-family: Inconsolata;">Steps: 32, Sampler: <b>Euler</b>, CFG scale: 7, Seed: <b>1653555007</b>, Size: 512x256, Model hash: fc2511737a, Model: <b>chilloutmix_NiPrunedFp32Fix</b>, Version: v1.6.1</span></p><p><span style="font-family: courier;">Time taken: <b>47.4 sec.</b> on Nvidia MX550<br />A: 1.70 GB, R: 2.26 GB, Sys: 2.0/2 GB (100.0%)</span></p>阿操http://www.blogger.com/profile/12449760480609795429noreply@blogger.com0tag:blogger.com,1999:blog-2385389280209790743.post-57667750036356777582023-12-24T22:46:00.001+08:002024-02-06T23:01:23.234+08:00《Don't Shoot Me Santa》<p><span style="font-family: inherit;">The Killers - Don't Shoot Me Santa, 4m33s</span></p><p><span style="font-family: inherit;"><iframe allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" allowfullscreen="" frameborder="0" height="380" src="https://www.youtube.com/embed/cglLJJ0Czo8" title="The Killers - Don't Shoot Me Santa" width="555"></iframe></span></p><p><span></span></p><a name='more'></a>耶誕節的應景歌曲,歌詞如下:<p></p><p><span style="font-family: Bookman Old Style;">Oh, Santa<br />I've been waiting on you</span></p><p><span style="font-family: courier;">That's funny, kid, because<br />I've been coming for you</span></p><p><span style="font-family: Bookman Old Style;">Oh, Santa<br />I've been killing just for fun</span></p><p><span style="font-family: courier;">Well, the party's over, kid<br />Because I, because I got a bullet in my gun</span></p><p><span style="font-family: Bookman Old Style;">A bullet in your what?<br />Santa's got a bullet in his gun (you know it)<br />Santa's got a bullet in his gun</span></p><p><span style="font-family: Bookman Old Style;">Don't shoot me, Santa Claus<br />I've been a clean living boy, I promise you<br />Did every little thing you asked me to<br />I can't believe the things I'm going through</span></p><p><span style="font-family: Bookman Old Style;">Don't shoot me, Santa Claus<br />Well, no one else around believes me<br />But the children on the block, they tease me<br />And I couldn't let 'em off that easy</span></p><p><span style="font-family: Bookman Old Style;">Oh, Santa<br />It's been a real hard year (year)</span></p><p><span style="font-family: courier;">There just ain't no getting around this, life is hard<br />But look at me, I turned out alright</span></p><p><span style="font-family: Bookman Old Style;">Hey, Santa<br />Why don't we talk about it?<br />Work it out</span></p><p><span style="font-family: courier;">Believe me, this ain't what I wanted<br />I love all you kids, you know that<br />Hell, I remember when you were just ten years old<br />Playing out there in the desert<br />Just waiting for a sip of that sweet Mojave rain</span></p><p><span style="font-family: Bookman Old Style;">In the sweet Mojave rain, the boy was on his own</span><br /></p><p><span style="font-family: Bookman Old Style;">Don't shoot me, Santa Claus<br />I've been a clean living boy, I promise you<br />Did every little thing you asked me to<br />I can't believe the things I'm going through</span></p><p><span style="font-family: Bookman Old Style;">Hey, Santa Claus<br />Well, no one else around believes me<br />But the children on the block, they tease me<br />And I couldn't let 'em off that easy</span></p><p><span style="font-family: Bookman Old Style;">They had it coming, so why can't you see?<br />I couldn't turn my cheek no longer<br />The sun is going down and Christmas is near<br />Just look the other way and I'll disappear forever</span></p><p><span style="font-family: Bookman Old Style;">這邊的間奏很奇妙地可愛</span></p><p><span style="font-family: Bookman Old Style;">Don't shoot me, Santa Claus<br />Well, no one else around believes me<br />But the children on the street, they tease me<br />And I couldn't let 'em off that easy<br />Believe me<br />Santa (Santa)</span></p><p><span style="font-family: inherit;">雖然不知道歌詞究竟想要表達甚麼,但總覺得很應景</span></p><p><span style="font-family: inherit;">_EOF_</span></p><p><br /></p>阿操http://www.blogger.com/profile/12449760480609795429noreply@blogger.com0tag:blogger.com,1999:blog-2385389280209790743.post-7068160472833535912023-12-22T13:24:00.040+08:002024-01-06T11:50:05.270+08:00Windows的RDCMan設定檔<p></p><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi7Jhbt6btNClES4ze-5u1K0OpKW2LExc7q5bg8VDyc-0svjQLa432uAxiInpSVoTi9cjJ5wB8fijULvqFuFIaZsFBXqEtLAfOGeVgd4O7_cJEnApbVoyNz17RAA3zmihKU6VPqjr6bV5jwhnNL22DIV6k0fmO08Zja_aJ_XzezE4tBEURusyV6iHk4MEow/s1280/00010.png" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="640" data-original-width="1280" height="256" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi7Jhbt6btNClES4ze-5u1K0OpKW2LExc7q5bg8VDyc-0svjQLa432uAxiInpSVoTi9cjJ5wB8fijULvqFuFIaZsFBXqEtLAfOGeVgd4O7_cJEnApbVoyNz17RAA3zmihKU6VPqjr6bV5jwhnNL22DIV6k0fmO08Zja_aJ_XzezE4tBEURusyV6iHk4MEow/s320/00010.png" width="512" /></a></div><p></p><p><span style="font-family: inherit;">Windows 11的R</span>遠端桌面管理員R<span style="font-family: inherit;">DCMan(Remote Desktop Connection Manager)設定檔案叫做</span><span style="color: #6fa8dc; font-family: Roboto Mono;"><b>RDCMan.settings</b></span>,如果是用命令提示字元(CMD)用下列指令到存放設定的資料夾:<span style="font-family: inherit;"> </span></p><p></p><ul style="text-align: left;"><li><span style="font-family: Roboto Mono;">cd "C:\Users\<b><span style="color: #93c47d;">%username%</span></b>\AppData\Local\Microsoft\Remote Desktop Connection Manager"</span></li><li><span style="font-family: Roboto Mono;">dir <span style="color: #6fa8dc;"><b>RDCMan.settings</b></span></span></li></ul><p></p><p>若是PowerShell,則要用下列指令:<span></span></p><a name='more'></a><p></p><p></p><ul style="text-align: left;"><li><span style="font-family: Roboto Mono;">cd "C:\Users\<b><span style="color: #93c47d;">$env:username</span></b>\AppData\Local\Microsoft\Remote Desktop Connection Manager"</span></li><li><span style="font-family: Roboto Mono;">ls <b><span style="color: #6fa8dc;">RDCMan.settings</span></b></span></li></ul><p></p><p><span style="font-family: inherit;"><br /></span></p><h2 style="text-align: left;"><span style="font-family: inherit;">參考資料</span></h2><p></p><ul style="text-align: left;"><li><a href="https://stackoverflow.com/questions/2085744/how-do-i-get-the-current-username-in-windows-powershell" target="_blank">How do I get the current username in Windows PowerShell?</a></li><li><a href="https://learn.microsoft.com/zh-tw/sysinternals/downloads/rdcman" target="_blank">遠端桌面連線管理員</a>:微軟官網對RDCMan的操作手冊</li></ul><p></p><p><span style="font-family: inherit;">_EOF_</span></p><p><span style="font-family: Inconsolata;">Postprocess upscale by: <b>2.5</b>, Postprocess upscaler: <b>LDSR</b></span></p><p><span style="font-family: courier;">Time taken: <b>11 min. 38.7</b> sec. on Nvidia MX550<br />A: 3.08 GB, R: 3.31 GB, Sys: 2.0/2 GB (100.0%)</span></p><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi-2SuoIwUiRCNXqI_NPOvY_ipE2YSSofZ4D04QAs9wAGoUweUkS4QGhQ1JclwYkUHsPxJayiFVMWxxXsVx5ZFESzf4Qrlcw_YeYiMhrZlmgtB6eNImmfqIU9rZkgA6iI5IO-0uE855sEJPpW2aSnPkvNMZrQbrYFHPX1O-Uz5OHBas-LkPG9fuUnAXyWky/s512/00003-231235.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="256" data-original-width="512" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi-2SuoIwUiRCNXqI_NPOvY_ipE2YSSofZ4D04QAs9wAGoUweUkS4QGhQ1JclwYkUHsPxJayiFVMWxxXsVx5ZFESzf4Qrlcw_YeYiMhrZlmgtB6eNImmfqIU9rZkgA6iI5IO-0uE855sEJPpW2aSnPkvNMZrQbrYFHPX1O-Uz5OHBas-LkPG9fuUnAXyWky/s16000/00003-231235.png" /></a></div><p><span style="font-family: Bookman Old Style;">A ultradetailed beautiful concept art of the crystal formation of the prismatic crystal of hope is filled with the wonderful colors of the emotion around it in a forgotten cave lighten by the moon light and reflecting on the surface of a quiet lake, concept art, high resolution, 4k, by Artgerm</span></p><p><span style="font-family: Inconsolata;">Steps: 20, Sampler: <b>Euler</b>, CFG scale: 7, Seed: <b>231235</b>, Size: 512x256, Model hash: fc2511737a, Model: <b>chilloutmix_NiPrunedFp32Fix</b>, Version: v1.6.1</span></p><p><span style="font-family: courier;">Time taken: <b>1 min. 23.0 sec.</b> on Nvidia MX550<br />A: 1.70 GB, R: 2.26 GB, Sys: 2.0/2 GB (100.0%)</span></p>阿操http://www.blogger.com/profile/12449760480609795429noreply@blogger.com0tag:blogger.com,1999:blog-2385389280209790743.post-7728542933028424122023-12-21T17:00:00.003+08:002024-01-06T11:50:05.270+08:00Windows 11上用WSL2安裝Ubuntu 22.04<p style="text-align: left;"></p><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjRw_75ZOHUjBNY5mmz9fv63F1_bv6HS97FgAu_8sVCxqtsNBVA_W0VndLNwW3fnIaLeaJJkRy1OdEmhhxi3aX8nO0EfiGbh4MG7lrosldYjGx14HYB3gu9vfNBqmcRhvh4VQDJLk1y1KjuJOQOvJUAPXMBW3ByiH6QF9XNAh5h_rWBzEDxnu5kSwJGIHiB/s512/00006-3047809571.png" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="256" data-original-width="512" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjRw_75ZOHUjBNY5mmz9fv63F1_bv6HS97FgAu_8sVCxqtsNBVA_W0VndLNwW3fnIaLeaJJkRy1OdEmhhxi3aX8nO0EfiGbh4MG7lrosldYjGx14HYB3gu9vfNBqmcRhvh4VQDJLk1y1KjuJOQOvJUAPXMBW3ByiH6QF9XNAh5h_rWBzEDxnu5kSwJGIHiB/s16000/00006-3047809571.png" /></a></div><p></p><div style="text-align: left;"><span style="font-family: inherit;">在Windows上要安裝Linux虛擬機,可以用WSL2。以下是安裝環境:</span></div><div style="text-align: left;"><ul style="text-align: left;"><li>實體機的host OS:<b><span style="color: #6fa8dc;">Windows 11</span></b></li><li>讓Windows可以跑Linux的WSL2:Windows Subsystem for Linux version 2</li><li>虛擬機的guest OS:<b><span style="color: #93c47d;">Ubuntu 22.04</span></b><br /><br /></li></ul></div><p>先用<b>系統管理者權限</b>開啟PowerShell後,安裝步驟如下:<span></span></p><a name='more'></a><p></p><p></p><p></p><ol style="text-align: left;"><li>用下面指令安裝WSL,預設安裝會是version 2的WSL2<br /><span style="font-family: Roboto Mono;">wsl --install<br /></span><br /></li><li>用指令確保WSL的版本是version 2,若是version 1的WSL就不是完整的虛擬機,而比較像是容器<br /><span style="font-family: Roboto Mono;">wsl <span style="color: #6fa8dc;">--set-default-version 2</span><br /></span><br /></li><li>列出可以用WSL2安裝的Linux distritubion (Distro)。目前可安裝Distro有Ubuntu, Debian, kali-linux, OracleLinux, openSUSE, SUSE。上述指令會列出可用Distro的版本。<br /><span style="font-family: Roboto Mono;">wsl --list --online<br /></span><br /></li><li>這次選擇安裝的guest OS為Ubuntu 22.04 LTS。指令執行完後要等待安裝並設定想要的帳號密碼<br /><span style="font-family: Roboto Mono;">wsl --install -d <span style="color: #93c47d;">Ubuntu-22.04</span><br /></span><br /></li><li>同一台Windows 11下可以安裝多個Linux Distro,用下列指令確認安裝的版本<br /><span style="font-family: Roboto Mono;">wsl --list<br /><br /></span></li></ol><p></p><p>以上就已經完成安裝Linux了。實際使用時只要一般使用者開啟PowerShell後,輸入:</p><p></p><ul style="text-align: left;"><li><span style="font-family: Roboto Mono;">wsl -d <span style="color: #93c47d;">Ubuntu-22.04</span></span></li></ul><p></p><p>這樣就可以開啟Ubuntu-22.04這個系統。同時開多個PowerShell可以開多個不同版本的Linux,還可以</p><p><br /></p><h2 style="text-align: left;"><span style="font-family: inherit;">參考資料</span></h2><p></p><ul style="text-align: left;"><li><a href="https://learn.microsoft.com/zh-tw/windows/wsl/install" target="_blank">如何使用 WSL 在 Windows 上安裝 Linux</a>:微軟官網的安裝WSL資訊</li><li><a href="https://2formosa.blogspot.com/2020/07/Install-WSL2-on-Win10.html" target="_blank">Windows 10上安裝WSL2</a>:若安裝有問題,可以看一下過往安裝的需求與設定</li><li><a href="https://2formosa.blogspot.com/2016/10/windows-subsystem-for-linux-wsl.html" target="_blank">Windows Subsystem for Linux (WSL)</a>:2016年時安裝version 1的WSL,跟WSL2是虛擬機比起來WSL比較像容器,已經不建議使用</li><li><a href="https://learn.microsoft.com/zh-tw/windows-hardware/manufacture/desktop/what-is-dism?view=windows-11" target="_blank">Windows的DISM 概觀</a>:部署映像服務與管理 (DISM.EXE) 用來服務和準備 Windows 映像 (.wim) 或虛擬硬碟 (.vhd 或 .vhdx)。</li><li><a href="https://zikin.org/wsl-forgot-passwd/" target="_blank">WSL2下忘记Linux子系统root密码的解决办法</a>:開PowerShell輸入<br /><span style="font-family: Ubuntu Mono;">wsl -u root </span>後用passwd指令修改密碼</li></ul><p></p><p><span style="font-family: inherit;">_EOF_</span></p><p><span style="font-family: Bookman Old Style;">Furniture designs in the style of bauhaus movement, design sheet, 3d render, Les Edwards, Zdzislaw Beksinski, Carl Gustav Carus, John Harris, Michal Karcz, Zhang Kechun, Mikko Lagerstedt, Scott Listfield, Steven Outram, Jessica Rossier.</span></p><p><span style="font-family: Inconsolata;">Steps: 32, Sampler: DPM++ 2M Karras, CFG scale: 7, Seed: <b>3047809571</b>, Size: 512x256, Model hash: 6ce0161689, Model: <b>v1-5-pruned-emaonly</b>, Version: v1.6.1</span></p><p><span style="font-family: courier;">Time taken: <b>2 min. 5.2 sec.</b> on Nvidia MX550<br />A: 1.70 GB, R: 2.26 GB, Sys: 2.0/2 GB (100.0%)</span></p>阿操http://www.blogger.com/profile/12449760480609795429noreply@blogger.com0tag:blogger.com,1999:blog-2385389280209790743.post-50000541412807458002023-12-15T14:58:00.015+08:002024-01-06T11:50:05.279+08:00幾個Stable Diffusion常用來出AI圖的模型<div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhVnX10l-WuF4vm84-NEhkX0MF0U3mne4Xq-72kQfqSBX_btk8RqthQx9WLknYIjPpJAYc26pVmJ0AYnqqKlgLSko8jtJhuBiS0xXSkmmAkASxnFie5ajEtiIiOdGXoEDXrgf5-b0zwbxtgn5_r-E7uJsEyli0hdQLfySdNUz6Vn0EZbMtXMEMNr7KTOsFG/s1024/00205-1418405164.png" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="1024" data-original-width="1024" height="512" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhVnX10l-WuF4vm84-NEhkX0MF0U3mne4Xq-72kQfqSBX_btk8RqthQx9WLknYIjPpJAYc26pVmJ0AYnqqKlgLSko8jtJhuBiS0xXSkmmAkASxnFie5ajEtiIiOdGXoEDXrgf5-b0zwbxtgn5_r-E7uJsEyli0hdQLfySdNUz6Vn0EZbMtXMEMNr7KTOsFG/s320/00205-1418405164.png" width="512" /></a></div><p><span></span></p>經過一個月的玩耍,本部落格使用<a href="https://github.com/AUTOMATIC1111/stable-diffusion-webui" target="_blank">AUTOMATIC1111的Stable Diffusion (SD) WebUI</a>來出圖時,使用的模型如下(點連結可以看到模型對應生成出來的圖片):<br /><a name='more'></a><p></p><p></p><ol style="text-align: left;"><li><span><b><span style="font-family: inherit;">chilloutmix</span></b><span style="font-family: Bookman Old Style;">系列</span></span>:選哪個都差不多</li><ul><li><a href="https://2formosa.blogspot.com/search?q=chilloutmix" target="_blank">chilloutmix</a>:7,347 MB,比較糊一點,但解析度512x512還夠用</li><li>chilloutmix_NiPrunedFp16:2,034 MB,</li><li>chilloutmix_NiPrunedFp16Fix:2,034 MB,Fix的會比較清楚一點點</li><li><a href="https://2formosa.blogspot.com/search?q=chilloutmix_NiPrunedFp32" target="_blank">chilloutmix_NiPrunedFp32</a>:4,068 MB,比Fp16產出的圖要細緻</li><li><a href="https://2formosa.blogspot.com/search?q=chilloutmix_NiPrunedFp32Fix" target="_blank">chilloutmix_NiPrunedFp32Fix</a>:4,068 MB,通常chilloutmix都選這個</li></ul><li><a href="https://2formosa.blogspot.com/search?q=Dall-e_3_0.3-v2" target="_blank"><span style="font-family: inherit;"><b>Dall-e_3_0.3-v2</b></span></a>:654MB很小,易把SD算到當掉,有些和chillotmix結果差不多</li><li><a href="https://2formosa.blogspot.com/search?q=diffusion_pytorch_model" target="_blank"><span style="font-family: inherit;"><b>diffusion_pytorch_model</b></span></a>:3,279 MB,目前還沒有找到適合的提示詞</li><li>etherRealMix系列:</li><ul><li>etherRealMix_21Inpaint-inpainting:2,034 MB</li><li>etherRealMix_etherRealMix31:2,034 MB</li></ul><li><span><b><span style="font-family: inherit;">playground-v2</span></b><span style="font-family: Bookman Old Style;">系列</span></span>:風格和其他的模型蠻不一樣的,通常Sampling method搭配Euler。可以出一些風格強烈的圖</li><ul><li>playground-v2.fp16:6,617 MB,載入已經需要一些時間了</li><li><a href="https://2formosa.blogspot.com/search?q=playground-v2" target="_blank">playground-v2</a>:13.233 MB,出圖品質不錯。要特別注意512x512的解析度是最適合這個模型,若改成512x256這種長方形解析度會長出奇怪的圖</li></ul><li><a href="https://2formosa.blogspot.com/search?q=v1-5-pruned-emaonly" target="_blank"><span style="font-family: inherit;"><b>v1-5-pruned-emaonly</b></span></a>:4,068 MB,最初安裝的時候的模型,還算萬用</li></ol><p></p><p><br /></p><h2 style="text-align: left;">參考資料</h2><p></p><ul style="text-align: left;"><li><a href="https://2formosa.blogspot.com/2023/11/Install-Stable-Diffusion-WebUI-on-M2-MB.html" target="_blank">M2 Mac裝Stable Diffusion WebUI來出圖</a>:蘋果電腦用SD出圖</li><li><a href="https://2formosa.blogspot.com/2023/12/win-11stable-diffusion-webui.html" target="_blank">Winows 11上裝Stable Diffusion來出圖</a>:微軟電腦用SD出圖</li><li><a href="https://huggingface.co" target="_blank">Hugging Face</a>:模型的safetensors到這邊來找,例如說<a href="https://huggingface.co/playgroundai/playground-v2-1024px-aesthetic" target="_blank">Playground v2</a></li><li><a href="https://blog.playgroundai.com/playground-v2/" target="_blank">Playground v2</a>:官網,有一些提示詞可以抄來用</li><li><a href="https://mspoweruser.com/best-stable-diffusion-prompts" target="_blank">30 Best Stable Diffusion Prompts for Great Images</a>:很多出圖風格可參考</li><li><a href="https://www.bing.com/images/create?FORM=GDPGLP" target="_blank">Microsoft Bing影像建立工具Designer</a>:微軟線上AI出圖服務</li><li><a href="https://docs.google.com/spreadsheets/d/16wR5Zg_aQEbxLdrTOrB9cZf8QmsMrJnSGxFKbZVtrKc" target="_blank">AI magic book drawing</a>:暗黑咒語</li><li><a href="https://koding.work/generate-high-resolution-images-with-stable-diffusion/" target="_blank">如何用 Stable Diffusion 產生高解析度的圖?</a>@Koding Work</li><li><a href="https://multi-ai.pro/model/stable-diffusion/" target="_blank">Stable Diffusion@MultiAI</a>:要收費的線上SD,支援的scheduler (sampler)有</li><ul><li>DDIM</li><li>K_EULER</li><li>DPMSolverMultiStep</li><li>K_EULER_ANCESTRAL</li><li>PNDM</li><li>KLMS</li></ul></ul><p></p><p>_EOF_</p><p><span style="font-family: Bookman Old Style;">a forest with a stream running through it, a comic book panel by Dan Mumford, featured on deviantart, fantasy art, night forest background, moonlit forest environment, ( ( ( ( ( dan mumford ) ) ) ) )</span></p><p><span style="font-family: Inconsolata;">Steps: 41, Sampler: <b>Euler</b>, CFG scale: 7, Seed: <b>1418405164</b>, Size: 1024x1024, Model hash: 5c7d38880d, Model: playground-v2, Version: v1.6.0-2-g4afaaf8a</span></p>阿操http://www.blogger.com/profile/12449760480609795429noreply@blogger.com0tag:blogger.com,1999:blog-2385389280209790743.post-58748812297776468492023-12-14T11:00:00.003+08:002024-01-06T11:50:05.280+08:00M2 Mac裝Stable Diffusion WebUI來出圖<p></p><p></p><p></p><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi2g5V_eEuaI3WLxbUVueRWJproCYuHVEVdW60_zDkLgx09gyA3OnJk3x-9sFl8Pn9E5TR5-poLZ6-mNA-H9Byg07sUKE2UR1jKdkthKJGrTpIxPPqfTOF8d9MWSCPVdMrDIdqsSPuB7XDcOnIfZflzR3G3-kGnv6ceO2xi_BjUyJB_oT3fLODJM2fjFMa7/s1024/00002-2258181.png" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="512" data-original-width="1024" height="256" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi2g5V_eEuaI3WLxbUVueRWJproCYuHVEVdW60_zDkLgx09gyA3OnJk3x-9sFl8Pn9E5TR5-poLZ6-mNA-H9Byg07sUKE2UR1jKdkthKJGrTpIxPPqfTOF8d9MWSCPVdMrDIdqsSPuB7XDcOnIfZflzR3G3-kGnv6ceO2xi_BjUyJB_oT3fLODJM2fjFMa7/s320/00002-2258181.png" width="512" /></a></div><p></p><p><span style="font-family: inherit;">終於發文可以附上自己生成的圖了,以下介紹要如何在M2 Mac上安裝Stable Diffusion WebUI。在安裝前需要先知道幾件事情:</span></p><p></p><ol style="text-align: left;"><li>安裝的Stable Diffusion是<a href="https://github.com/AUTOMATIC1111" target="_blank">AUTOMATIC1111</a>組出來Stable Diffusion的WebUI版</li><li><a href="https://stability.ai" target="_blank">Stable Diffusion</a>是從文字生成圖像的生成模型,意思就是輸入文字會產生圖片。原始碼可以在GitHub上看到,產生圖片的模型則可在Hugging Face上找到</li><li>WebUI意思是執行後會在本機背景執行一個網站,使用者只要直接用瀏覽器開啟 <a href="http://127.0.0.1:7860"><span style="color: #6fa8dc; font-family: Ubuntu;">http://127.0.0.1:7860</span></a> 即可連線本機網站開始使用</li><li>這個網站是用python寫的,會需要安裝許多相關的套件。一般網路上為了方便都會用anaconda來把背景需要的python裝好。但不喜歡anaconda裝了一大堆有的沒有的,所以一些需要的程式會用MacPorts來安裝python 3.10版與其他軟體,而不使用anaconda<span></span></li></ol><span><a name='more'></a></span><div style="text-align: left;"><br /></div><h3 style="text-align: left;"><span style="color: #93c47d;"> Step 1 </span>:<a href="https://2formosa.blogspot.com/2023/09/Install-MacPorts-on-M2-Mac.html" target="_blank">安裝MacPorts</a>後,用port指令安裝需要的軟體</h3><pre class="language-bash" style="background: rgb(245, 242, 240); border-radius: 3px; border: 1px solid rgb(204, 204, 204); font-family: Consolas, Monaco, "Andale Mono", "Ubuntu Mono", monospace; font-size: 13px; line-height: 1.5; margin-bottom: 0.5em; margin-top: 0.5em; overflow-wrap: normal; overflow: auto; padding: 1em; tab-size: 4; text-shadow: white 0px 1px; word-break: normal;"><code class="language-bash" style="background: none; border-radius: 3px; border: medium; font-family: Consolas, Monaco, "Andale Mono", "Ubuntu Mono", monospace; line-height: 1.5; margin: 0px; overflow-wrap: normal; padding: 0px; tab-size: 4; text-shadow: white 0px 1px; word-break: normal; word-spacing: normal;"><span class="token function" style="color: #dd4a68; print-color-adjust: exact;">sudo</span> port <span class="token function" style="color: #dd4a68; print-color-adjust: exact;">install</span> <span class="token function" style="color: #dd4a68; print-color-adjust: exact;">wget</span></code></pre><p>首先安裝wget指令,用來抓網路上的資料。然後安裝Python 3.10版</p><pre class="language-bash" style="background: rgb(245, 242, 240); border-radius: 3px; border: 1px solid rgb(204, 204, 204); font-family: Consolas, Monaco, "Andale Mono", "Ubuntu Mono", monospace; font-size: 13px; line-height: 1.5; margin-bottom: 0.5em; margin-top: 0.5em; overflow-wrap: normal; overflow: auto; padding: 1em; tab-size: 4; text-shadow: white 0px 1px; word-break: normal;"><code class="language-bash" style="background: none; border-radius: 3px; border: medium; font-family: Consolas, Monaco, "Andale Mono", "Ubuntu Mono", monospace; line-height: 1.5; margin: 0px; overflow-wrap: normal; padding: 0px; tab-size: 4; text-shadow: white 0px 1px; word-break: normal; word-spacing: normal;"><span class="token function" style="color: #dd4a68; print-color-adjust: exact;">sudo</span> port <span class="token function" style="color: #dd4a68; print-color-adjust: exact;">install</span> python310
<span class="token function" style="color: #dd4a68; print-color-adjust: exact;">sudo</span> port <span class="token keyword" style="color: #0077aa; print-color-adjust: exact;">select</span> --set python python310</code></pre><p>M2 Mac預設只有python3而沒有python這個指令,所以這邊把python指令指向安裝的Python 3.10</p><pre class="language-bash" style="background: rgb(245, 242, 240); border-radius: 3px; border: 1px solid rgb(204, 204, 204); font-family: Consolas, Monaco, "Andale Mono", "Ubuntu Mono", monospace; font-size: 13px; line-height: 1.5; margin-bottom: 0.5em; margin-top: 0.5em; overflow-wrap: normal; overflow: auto; padding: 1em; tab-size: 4; text-shadow: white 0px 1px; word-break: normal;"><code class="language-bash" style="background: none; border-radius: 3px; border: medium; font-family: Consolas, Monaco, "Andale Mono", "Ubuntu Mono", monospace; line-height: 1.5; margin: 0px; overflow-wrap: normal; padding: 0px; tab-size: 4; text-shadow: white 0px 1px; word-break: normal; word-spacing: normal;"><span class="token function" style="color: #dd4a68; print-color-adjust: exact;">sudo</span> port <span class="token function" style="color: #dd4a68; print-color-adjust: exact;">install</span> py310-pip
<span class="token function" style="color: #dd4a68; print-color-adjust: exact;">sudo</span> port <span class="token keyword" style="color: #0077aa; print-color-adjust: exact;">select</span> --set pip pip310</code></pre><p>安裝Python 3.10的套件管理程式pip。M2 Mac預設只有pip3沒有pip,所以就把pip這個指令的位置轉給用MacPorts安裝的pip</p><pre class="language-bash" style="background: rgb(245, 242, 240); border-radius: 3px; border: 1px solid rgb(204, 204, 204); font-family: Consolas, Monaco, "Andale Mono", "Ubuntu Mono", monospace; font-size: 13px; line-height: 1.5; margin-bottom: 0.5em; margin-top: 0.5em; overflow-wrap: normal; overflow: auto; padding: 1em; tab-size: 4; text-shadow: white 0px 1px; word-break: normal;"><code class="language-bash" style="background: none; border-radius: 3px; border: medium; font-family: Consolas, Monaco, "Andale Mono", "Ubuntu Mono", monospace; line-height: 1.5; margin: 0px; overflow-wrap: normal; padding: 0px; tab-size: 4; text-shadow: white 0px 1px; word-break: normal; word-spacing: normal;"><span class="token function" style="color: #dd4a68; print-color-adjust: exact;">which</span> python <span class="token operator" style="background: rgba(255, 255, 255, 0.5); color: #a67f59; print-color-adjust: exact;">&&</span> python --version <span class="token operator" style="background: rgba(255, 255, 255, 0.5); color: #a67f59; print-color-adjust: exact;">&&</span> <span class="token function" style="color: #dd4a68; print-color-adjust: exact;">which</span> pip <span class="token operator" style="background: rgba(255, 255, 255, 0.5); color: #a67f59; print-color-adjust: exact;">&&</span> pip --version</code></pre><pre class="language-r" style="background: rgb(245, 242, 240); border-radius: 3px; border: 1px solid rgb(204, 204, 204); font-family: Consolas, Monaco, "Andale Mono", "Ubuntu Mono", monospace; font-size: 13px; line-height: 1.5; margin-bottom: 0.5em; margin-top: 0.5em; overflow-wrap: normal; overflow: auto; padding: 1em; tab-size: 4; text-shadow: white 0px 1px; word-break: normal;"><code class="language-r" style="background: none; border-radius: 3px; border: medium; font-family: Consolas, Monaco, "Andale Mono", "Ubuntu Mono", monospace; line-height: 1.5; margin: 0px; overflow-wrap: normal; padding: 0px; tab-size: 4; text-shadow: white 0px 1px; word-break: normal; word-spacing: normal;"><span class="token operator" style="background: rgba(255, 255, 255, 0.5); color: #a67f59; print-color-adjust: exact;">/</span>opt<span class="token operator" style="background: rgba(255, 255, 255, 0.5); color: #a67f59; print-color-adjust: exact;">/</span>local<span class="token operator" style="background: rgba(255, 255, 255, 0.5); color: #a67f59; print-color-adjust: exact;">/</span>bin<span class="token operator" style="background: rgba(255, 255, 255, 0.5); color: #a67f59; print-color-adjust: exact;">/</span>python
Python <span class="token number" style="color: #990055; print-color-adjust: exact;">3.10</span>.<span class="token number" style="color: #990055; print-color-adjust: exact;">13</span>
<span class="token operator" style="background: rgba(255, 255, 255, 0.5); color: #a67f59; print-color-adjust: exact;">/</span>opt<span class="token operator" style="background: rgba(255, 255, 255, 0.5); color: #a67f59; print-color-adjust: exact;">/</span>local<span class="token operator" style="background: rgba(255, 255, 255, 0.5); color: #a67f59; print-color-adjust: exact;">/</span>bin<span class="token operator" style="background: rgba(255, 255, 255, 0.5); color: #a67f59; print-color-adjust: exact;">/</span>pip
pip <span class="token number" style="color: #990055; print-color-adjust: exact;">23.2</span>.<span class="token number" style="color: #990055; print-color-adjust: exact;">1</span> from <span class="token operator" style="background: rgba(255, 255, 255, 0.5); color: #a67f59; print-color-adjust: exact;">/</span>opt<span class="token operator" style="background: rgba(255, 255, 255, 0.5); color: #a67f59; print-color-adjust: exact;">/</span>local<span class="token operator" style="background: rgba(255, 255, 255, 0.5); color: #a67f59; print-color-adjust: exact;">/</span>Library<span class="token operator" style="background: rgba(255, 255, 255, 0.5); color: #a67f59; print-color-adjust: exact;">/</span>Frameworks<span class="token operator" style="background: rgba(255, 255, 255, 0.5); color: #a67f59; print-color-adjust: exact;">/</span>Python.framework<span class="token operator" style="background: rgba(255, 255, 255, 0.5); color: #a67f59; print-color-adjust: exact;">/</span>Versions<span class="token operator" style="background: rgba(255, 255, 255, 0.5); color: #a67f59; print-color-adjust: exact;">/</span><span class="token number" style="color: #990055; print-color-adjust: exact;">3.10</span><span class="token operator" style="background: rgba(255, 255, 255, 0.5); color: #a67f59; print-color-adjust: exact;">/</span>lib<span class="token operator" style="background: rgba(255, 255, 255, 0.5); color: #a67f59; print-color-adjust: exact;">/</span>python3<span class="token number" style="color: #990055; print-color-adjust: exact;">.10</span><span class="token operator" style="background: rgba(255, 255, 255, 0.5); color: #a67f59; print-color-adjust: exact;">/</span>site<span class="token operator" style="background: rgba(255, 255, 255, 0.5); color: #a67f59; print-color-adjust: exact;">-</span>packages<span class="token operator" style="background: rgba(255, 255, 255, 0.5); color: #a67f59; print-color-adjust: exact;">/</span>pip <span class="token punctuation" style="color: #999999; print-color-adjust: exact;">(</span>python <span class="token number" style="color: #990055; print-color-adjust: exact;">3.10</span><span class="token punctuation" style="color: #999999; print-color-adjust: exact;">)</span></code></pre><p><span></span>上述的指令與其輸出結果顯示Python版本是3.10.13,pip則是23.2.1</p><p><span style="font-family: inherit;"><br /></span></p><h3 style="text-align: left;"><span style="color: #93c47d;"> Step 2 </span><span style="font-family: inherit;">:下載AUTOMATIC1111的Stable Diffusion WebUI</span></h3><pre class="language-bash" style="background: rgb(245, 242, 240); border-radius: 3px; border: 1px solid rgb(204, 204, 204); font-family: Consolas, Monaco, "Andale Mono", "Ubuntu Mono", monospace; font-size: 13px; line-height: 1.5; margin-bottom: 0.5em; margin-top: 0.5em; overflow-wrap: normal; overflow: auto; padding: 1em; tab-size: 4; text-shadow: white 0px 1px; word-break: normal;"><code class="language-bash" style="background: none; border-radius: 3px; border: medium; font-family: Consolas, Monaco, "Andale Mono", "Ubuntu Mono", monospace; line-height: 1.5; margin: 0px; overflow-wrap: normal; padding: 0px; tab-size: 4; text-shadow: white 0px 1px; word-break: normal; word-spacing: normal;"><span class="token function" style="color: #dd4a68; print-color-adjust: exact;">cd</span> ~/Pictures
<span class="token function" style="color: #dd4a68; print-color-adjust: exact;">git</span> clone https://github.com/AUTOMATIC1111/stable-diffusion-webui.git
<span class="token function" style="color: #dd4a68; print-color-adjust: exact;">du</span> -sh stable-diffusion-webui</code></pre><div style="background-color: white; caret-color: rgb(0, 0, 0); font-family: Helvetica, arial, sans-serif; font-size: 14px;"><pre class="language-r" style="background: rgb(245, 242, 240); border-radius: 3px; border: 1px solid rgb(204, 204, 204); font-family: Consolas, Monaco, "Andale Mono", "Ubuntu Mono", monospace; font-size: 13px; line-height: 1.5; margin-bottom: 0.5em; margin-top: 0.5em; overflow-wrap: normal; overflow: auto; padding: 1em; tab-size: 4; text-shadow: white 0px 1px; word-break: normal; word-spacing: normal;"><code class="language-r" style="background: none; border-radius: 3px; border: medium; font-family: Consolas, Monaco, "Andale Mono", "Ubuntu Mono", monospace; line-height: 1.5; margin: 0px; overflow-wrap: normal; padding: 0px; tab-size: 4; text-shadow: white 0px 1px; word-break: normal; word-spacing: normal;">37M stable<span class="token operator" style="background: rgba(255, 255, 255, 0.5); color: #a67f59; print-color-adjust: exact;">-</span>diffusion<span class="token operator" style="background: rgba(255, 255, 255, 0.5); color: #a67f59; print-color-adjust: exact;">-</span>webui</code></pre></div><p>這樣就有WebUI的程式碼了,但還需要下載模型檔案指定位置。這部分要請各位自己大顯神通了,以下顯示在網路上抓到的一些模型:</p><pre class="language-bash" style="background: rgb(245, 242, 240); border-radius: 3px; border: 1px solid rgb(204, 204, 204); font-family: Consolas, Monaco, "Andale Mono", "Ubuntu Mono", monospace; font-size: 13px; line-height: 1.5; margin-bottom: 0.5em; margin-top: 0.5em; overflow-wrap: normal; overflow: auto; padding: 1em; tab-size: 4; text-shadow: white 0px 1px; word-break: normal;"><code class="language-bash" style="background: none; border-radius: 3px; border: medium; font-family: Consolas, Monaco, "Andale Mono", "Ubuntu Mono", monospace; line-height: 1.5; margin: 0px; overflow-wrap: normal; padding: 0px; tab-size: 4; text-shadow: white 0px 1px; word-break: normal; word-spacing: normal;"><span class="token function" style="color: #dd4a68; print-color-adjust: exact;">cd</span> ~/Pictures/stable-diffusion-webui/models/Stable-diffusion
<span class="token function" style="color: #dd4a68; print-color-adjust: exact;">ls</span> *.safetensors <span class="token operator" style="background: rgba(255, 255, 255, 0.5); color: #a67f59; print-color-adjust: exact;">|</span> <span class="token function" style="color: #dd4a68; print-color-adjust: exact;">cat</span></code></pre><pre class="language-none" style="background: rgb(245, 242, 240); border-radius: 3px; border: 1px solid rgb(204, 204, 204); font-family: Consolas, Monaco, "Andale Mono", "Ubuntu Mono", monospace; font-size: 13px; line-height: 1.5; margin-bottom: 0.5em; margin-top: 0.5em; overflow-wrap: normal; overflow: auto; padding: 1em; tab-size: 4; text-shadow: white 0px 1px; word-break: normal;"><code class="language-none" style="background: none; border-radius: 3px; border: medium; font-family: Consolas, Monaco, "Andale Mono", "Ubuntu Mono", monospace; line-height: 1.5; margin: 0px; overflow-wrap: normal; padding: 0px; tab-size: 4; text-shadow: white 0px 1px; word-break: normal; word-spacing: normal;">chilloutmix_.safetensors
chilloutmix_NiPrunedFp16.safetensors
chilloutmix_NiPrunedFp16Fix.safetensors
chilloutmix_NiPrunedFp32.safetensors
chilloutmix_NiPrunedFp32Fix.safetensors
diffusion_pytorch_model.safetensors
v1-5-pruned-emaonly.safetensors</code></pre><p><br /></p><h3 style="text-align: left;"><span style="color: #93c47d;"> Step 3 </span>:用Python來創建執行Stable Diffusion WebUI的虛擬環境</h3><pre class="language-bash" style="background: rgb(245, 242, 240); border-radius: 3px; border: 1px solid rgb(204, 204, 204); font-family: Consolas, Monaco, "Andale Mono", "Ubuntu Mono", monospace; font-size: 13px; line-height: 1.5; margin-bottom: 0.5em; margin-top: 0.5em; overflow-wrap: normal; overflow: auto; padding: 1em; tab-size: 4; text-shadow: white 0px 1px; word-break: normal;"><code class="language-bash" style="background: none; border-radius: 3px; border: medium; font-family: Consolas, Monaco, "Andale Mono", "Ubuntu Mono", monospace; line-height: 1.5; margin: 0px; overflow-wrap: normal; padding: 0px; tab-size: 4; text-shadow: white 0px 1px; word-break: normal; word-spacing: normal;">python -m venv ~/Pictures/stable-diffusion-webui
<span class="token function" style="color: #dd4a68; print-color-adjust: exact;">source</span> ~/Pictures/stable-diffusion-webui/bin/activate
<span class="token function" style="color: #dd4a68; print-color-adjust: exact;">cd</span> ~/Pictures/stable-diffusion-webui
./webui.sh</code></pre><p>以上指令講的是用Step 1裡面安裝的python把<span style="font-family: Ubuntu;">~/Pictures/stable-diffusion-webui</span>這個資料夾變成一個虛擬環境,第二行指令就是把執行背景變成這個虛擬環境。</p><p>環境改好以後,跳到這個虛擬環境的資料夾<span style="font-family: Ubuntu;">~/Pictures/stable-diffusion-webui</span>,去執行Stable Diffusion的WebUI程式叫做webui.sh。第一次執行的時候會比較久,因為要去把相關的套件都給裝到這個虛擬環境裡面。要停止這個網站則是要按Ctrl-C,然後用下面的指令跳出虛擬環境</p><pre class="language-none" style="background: rgb(245, 242, 240); border-radius: 3px; border: 1px solid rgb(204, 204, 204); font-family: Consolas, Monaco, "Andale Mono", "Ubuntu Mono", monospace; font-size: 13px; line-height: 1.5; margin-bottom: 0.5em; margin-top: 0.5em; overflow-wrap: normal; overflow: auto; padding: 1em; tab-size: 4; text-shadow: white 0px 1px; word-break: normal;"><code class="language-none" style="background: none; border-radius: 3px; border: medium; font-family: Consolas, Monaco, "Andale Mono", "Ubuntu Mono", monospace; line-height: 1.5; margin: 0px; overflow-wrap: normal; padding: 0px; tab-size: 4; text-shadow: white 0px 1px; word-break: normal; word-spacing: normal;">deactivate</code></pre><p><span style="font-family: inherit;"><br /></span></p><h3 style="text-align: left;"><span style="color: #93c47d;"> Step 4 </span>:開始使用Stable Diffusion WebUI</h3><pre class="language-bash" style="background: rgb(245, 242, 240); border-radius: 3px; border: 1px solid rgb(204, 204, 204); font-family: Consolas, Monaco, "Andale Mono", "Ubuntu Mono", monospace; font-size: 13px; line-height: 1.5; margin-bottom: 0.5em; margin-top: 0.5em; overflow-wrap: normal; overflow: auto; padding: 1em; tab-size: 4; text-shadow: white 0px 1px; word-break: normal;"><code class="language-bash" style="background: none; border-radius: 3px; border: medium; font-family: Consolas, Monaco, "Andale Mono", "Ubuntu Mono", monospace; line-height: 1.5; margin: 0px; overflow-wrap: normal; padding: 0px; tab-size: 4; text-shadow: white 0px 1px; word-break: normal; word-spacing: normal;"><span class="token function" style="color: #dd4a68; print-color-adjust: exact;">source</span> ~/Pictures/stable-diffusion-webui/bin/activate
<span class="token function" style="color: #dd4a68; print-color-adjust: exact;">cd</span> ~/Pictures/stable-diffusion-webui
<span class="token function" style="color: #dd4a68; print-color-adjust: exact;">time</span> ./webui.sh</code></pre><p>然後去連線 <span style="color: #6fa8dc; font-family: Ubuntu;"><b><a href="http://127.0.0.1:7860"><span style="color: #6fa8dc;">http://127.0.0.1:7860</span></a> </b></span>,開始享用AI出圖<br />跑完以後回到終端機按下Ctrl-C後,就會終止此網站。</p><p><span style="font-family: inherit;"><br /></span></p><h2 style="text-align: left;"><span style="font-family: inherit;">參考資料與相關資料</span></h2><p></p><ul style="text-align: left;"><li><a href="https://2formosa.blogspot.com/2023/09/Install-MacPorts-on-M2-Mac.html" target="_blank">在M2 Mac上安裝MacPorts</a>:安裝第三方軟體的macports安裝方式</li><li><a href="https://2formosa.blogspot.com/2017/05/puthon-package-index.html" target="_blank">Python的套件管理程式PyPI(pip)</a>:安裝python套件的指令pip</li><li><a href="https://2formosa.blogspot.com/2019/01/python-built-in-virtual-environment.html" target="_blank">Python 3.3之後的虛擬環境virtualenv</a>:Python執行虛擬環境</li><li><a href="https://ivonblog.com/posts/stable-diffusion-webui-manuals/installation/macos-installation/" target="_blank">Stable Diffusion WebUI使用手冊@Ivon的部落格</a>:很完整的安裝說明</li><li><a href="https://chrislee0728.medium.com/stable-diffusion%E6%A8%A1%E5%9E%8B%E7%9A%84%E5%AE%89%E8%A3%9D%E8%88%87%E4%BD%BF%E7%94%A8%E6%95%99%E7%A8%8B-12cbeeee7430" target="_blank">Stable Diffusion模型的安裝與使用教程</a> by Chris Lee</li><li><a href="https://vocus.cc/article/646dac3ffd897800010015f4" target="_blank">Stable Diffusion基礎 -- 文生圖(txt2img)</a></li><li><a href="https://www.apple.com/tw/newsroom/2023/06/apple-introduces-m2-ultra/" target="_blank">M2 Ultra 具備更快速的 CPU 和 GPU,以及支援更大的統一記憶體</a>:<br />M2晶片的CPU與GPU共用記憶體,稱之為Unified Memory Architecture (UMA)</li></ul><p></p><p><span style="font-family: inherit;">_EOF_</span></p><p><span style="font-family: Bookman Old Style;">A birds eye view overlooking an ancient fantasy city surrounded by mountains and trees of greens and browns, rivers and lakes by Jordan Grimmer, Asher Brown Durand and Ryan Dening, 8k, artstation, beautiful color pallette, Japanese style.</span></p><p><span style="font-family: Inconsolata;">Steps: <b>41</b>, Sampler: <b>DPM++ 2M Karras</b>, CFG scale: 7, Seed: 2258181, Size: 512x256, Model hash: fc2511737a, Model: chilloutmix_NiPrunedFp32Fix, <b>Denoising strength: 0.7, Hires upscale: 2, Hires upscaler: Latent</b>, Version: v1.6.0-2-g4afaaf8a</span></p><p><span style="font-family: Inconsolata;"></span></p><p>Time taken: 1 min. 29.1 sec. on M2MBP</p><p><span style="font-family: Bookman Old Style;"></span></p><div class="separator" style="clear: both; text-align: center;"><span style="font-family: Bookman Old Style;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiwsMo6SmlzaIYB_njNvR349I3sMQ8ZbpGog7sZsjFtB5beTPuLJZO1MOqhmhyphenhyphen5KuFK_nf3dra6VJOWZ4pYwvmYjYM2B31EHHhs_WInq3e_T2_IlGL0lLfcjp4zsGeHx1_Ueeyc4pQMoHfYZGIfDkkvzOYFUB42s-uCZ6jmrEifqVaFFAJYaMz5SB8BpgWP/s512/00065-2258181.png" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="256" data-original-width="512" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiwsMo6SmlzaIYB_njNvR349I3sMQ8ZbpGog7sZsjFtB5beTPuLJZO1MOqhmhyphenhyphen5KuFK_nf3dra6VJOWZ4pYwvmYjYM2B31EHHhs_WInq3e_T2_IlGL0lLfcjp4zsGeHx1_Ueeyc4pQMoHfYZGIfDkkvzOYFUB42s-uCZ6jmrEifqVaFFAJYaMz5SB8BpgWP/s16000/00065-2258181.png" /></a></span></div><p><span style="font-family: Bookman Old Style;">a birds eye view overlooking an ancient fantasy city surrounded by mountains and trees of greens and browns, rivers and lakes by Jordan Grimmer, Asher Brown Durand and Ryan Dening, 8k, artstation, beautiful color pallette, Japanese style</span></p><p></p><p><span style="font-family: Inconsolata;">Steps: <b>20</b>, Sampler: <b>DPM++ 2M Karras</b>, CFG scale: 7, Seed: 2258181, Size: 512x256, Model hash: 95afa0d9ea, Model: <b>chilloutmix_NiPrunedFp32</b>, Version: v1.6.0-2-g4afaaf8a</span></p><p><span style="font-family: Inconsolata;"></span></p><p><span style="font-family: courier;">Time taken: <b>5.3 sec.</b></span></p>阿操http://www.blogger.com/profile/12449760480609795429noreply@blogger.com0tag:blogger.com,1999:blog-2385389280209790743.post-16988395722844703462023-12-08T10:00:00.001+08:002024-01-06T11:50:05.273+08:00Winows 11上裝Stable Diffusion來出圖<div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjljZk6zGPLIFdOmx7Kstp6C7pJ5juZdb-j1JET1FRn-Fl1OpY2b0qiiGPjmKpc5uAcfwpYwtBA58axmCxAX7dIgeq1j8FmVSHrydwgR2bztcS5EFcuiSVva7Bi7qUAZ3XdHT84s7_L4-7QgHnAJ5f9DvSQiavahGupjs6y6StefQhv2kItWuig45QSX1-g/s1024/00009-4275108189.png" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="512" data-original-width="1024" height="256" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjljZk6zGPLIFdOmx7Kstp6C7pJ5juZdb-j1JET1FRn-Fl1OpY2b0qiiGPjmKpc5uAcfwpYwtBA58axmCxAX7dIgeq1j8FmVSHrydwgR2bztcS5EFcuiSVva7Bi7qUAZ3XdHT84s7_L4-7QgHnAJ5f9DvSQiavahGupjs6y6StefQhv2kItWuig45QSX1-g/s320/00009-4275108189.png" width="512" /></a></div><p>上個月底才剛完成<a href="https://2formosa.blogspot.com/2023/11/Install-Stable-Diffusion-WebUI-on-M2-MB.html" target="_blank">M2 Mac裝Stable Diffusion WebUI來出圖</a>,最近剛好手邊的Windows被弄壞,重灌完Windows 11 23H2之後,也就在上面順手安裝了一下AUTOMATIC1111的Stable Diffusion WebUI,在安裝前要先知道幾件事情:</p><p></p><ol style="text-align: left;"><li>AUTOMATIC1111放在<a href="https://github.com/AUTOMATIC1111/stable-diffusion-webui" target="_blank">GitHub上面的Stable Diffusion WebUI</a>是個用Python寫出來的程式碼,所以必須要先安裝Git與Python</li><li>這程式可以用GPU加速,也就是說要安裝特定的驅動程式,如果是N牌的還需要安裝CUDA toolkit;A牌手上沒有硬體可以測試</li><li>顯卡硬體<span style="color: red;"><b>搭配的GPU驅動程式版本,配套的CUDA包版本,還有Python的版本</b>對於能不能夠順利執行Stable Diffusion WebUI</span>有著極其重大的影響。</li></ol><p></p><span><a name='more'></a></span><p>以上說完了注意事項,再來就是開始安裝各種東西,寫出來的版本是目前在GeForce MX550可以順利跑的配置:</p><p></p><ol style="text-align: left;"><li>安裝GPU驅動程式:用<a href="https://www.nvidia.com/zh-tw/geforce/geforce-experience/" target="_blank">GeForce Experience</a>安裝驅動程式,<span style="color: #6fa8dc;">Nvidia顯卡驅動裝的版本是<b>546.29</b></span></li><li>除了GPU驅動程式以外,<span style="color: #6fa8dc;">PhysX的版本是<b>09.21.0713</b></span></li><li>手動安裝CUDA:安裝的<span style="color: #93c47d;">toolkit版本是<b>11.8</b></span>,太高的12.3裝起來會出問題</li><ul><li>用指令 <span style="font-family: Roboto Mono;">nvcc --version</span> 來檢查,輸出如下<br /><span style="font-family: courier;">nvcc: NVIDIA (R) Cuda compiler driver<br />Copyright (c) 2005-2022 NVIDIA Corporation<br />Built on Wed_Sep_21_10:41:10_Pacific_Daylight_Time_2022<br />Cuda compilation tools, release 11.8, V11.8.89<br />Build <b>cuda_11.8.r11.8</b>/compiler.31833905_0<br /><br /></span></li><li>用指令 <span style="font-family: Roboto Mono;">(Get-Command nvcc).Source</span> 來檢查,輸出會是<br /><span style="font-family: courier;">C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\<b>v11.8</b>\bin\nvcc.exe<br /><br /></span></li></ul><li>手動安裝Python 3.10:安裝的<span style="color: #93c47d;">python版本是<b>3.10.11</b></span>,看來只要是3.10的可能都不會出問題</li><ul><li>用指令 <span style="font-family: Roboto Mono;">python --version</span> 來檢查,輸出如下<br /><span style="font-family: courier;"><b>Python 3.10.11<br /><br /></b></span></li><li>用指令<span style="font-family: Roboto Mono;">(Get-Command python).Source</span> 檢查,輸出如下<br /><span style="font-family: courier;">C:\Users\使用者名稱\AppData\Local\Programs\Python\<b>Python310</b>\python.exe<br /><br /></span></li></ul><li><span style="font-family: inherit;">安裝<a href="https://gitforwindows.org/" target="_blank">git for windows</a>,使用的版本是2.43.0.windows.1</span></li></ol><p></p><p><br /></p><p>上述的準備工作都做好以後就是依序安裝上述的東西後,然後開powershell執行下列指令</p><p></p><ol style="text-align: left;"><li><span style="font-family: Roboto Mono;">cd ~/Pictures/</span></li><li><span style="font-family: Roboto Mono;">git clone https://github.com/AUTOMATIC1111/stable-diffusion-webui.git</span></li><li><span style="font-family: Roboto Mono;">pip install --upgrade pip</span></li><li><span style="font-family: Roboto Mono;">pip install xformers=0.0.22</span></li><li><span style="font-family: Roboto Mono;">cd ~/Pictures/stable-diffusion-webui/</span></li><li><span style="font-family: Roboto Mono;">./<span style="color: #ffa400;">webui-user.bat</span></span></li></ol><p></p><p>在執行第6步之前記得要先修改<span style="color: #ffa400; font-family: Roboto Mono;">webui-user.bat</span>這個檔案,設定如下</p><p></p><ul style="text-align: left;"><li><span style="font-family: Source Code Pro;">set COMMANDLINE_ARGS=--medvram --opt-split-attention --enable-insecure-extension-access --xformers --no-half-vae</span></li></ul><p></p><p><br /></p><h2 style="text-align: left;">參考資料</h2><div><ul style="text-align: left;"><li><a href="https://ivonblog.com/posts/stable-diffusion-webui-manuals/installation/windows-installation/" target="_blank">安裝Stable Diffusion WebUI on Windows@Ivon的部落格</a>:<br />安裝的過程主要看這邊,寫得很詳細但還是需要一些微調</li><li><a href="https://developer.nvidia.com/cuda-11-8-0-download-archive" target="_blank">CUDA Toolkit 11.8 Downloads</a>:CUDA包的下載連結,怕麻煩選 exe(local)</li><li><a href="https://www.python.org/downloads/release/python-31011/" target="_blank">Python 3.10.11 Downloads</a>:找Windows installer (64-bit)的下載來用</li><li><a href="https://2formosa.blogspot.com/2022/06/Dell-Latitude-5431-hardware.html" target="_blank">Dell Latitude 5431硬體規格</a>:拿來出圖的筆電,GPU是N牌GeForce MX550,上面的VRAM只有2G</li><li><a href="https://vocus.cc/article/6423ef9ffd897800011688b1" target="_blank">AI繪圖-實測:比較目前20種採樣方式的速度與圖片生成結果(stable diffusion webui)</a></li><li><a href="https://zhuanlan.zhihu.com/p/374238080" target="_blank">Gradio:轻松实现AI算法可视化部署</a>:介面是用Gradio刻的</li><li><a href="https://blog.256pages.com/stable-diffusion-basic-prompt-tutorial/" target="_blank">Stable Diffusion Prompt (基本篇)</a>:Prompt, Sampler, Hires.fix生大圖<br />光源、影子及光追,用權重風力、相片效果</li><li><a href="https://mspoweruser.com/best-stable-diffusion-prompts" target="_blank">30 Best Stable Diffusion Prompts for Great Images</a>:30張厲害的圖</li><li><a href="https://vocus.cc/article/646fdd27fd897800014aa584" target="_blank">Stable Diffusion基礎 -- 高解析度修復(Hires. fix)</a>:圖片放大</li></ul></div><p>_EOF_</p><p><span style="font-family: Bookman Old Style;">Authentic illustrations of different cities in The Lord of the Rings. Magnificent super wide angle,high quality, 8k,high resolution, city landscape, side scrolling, Rule of Thirds, 4K, Retrofuturism,by Makoto Shinkai, Anton Fadeev, Thomas Kinkade, Greg Rutkowski</span></p><p><span style="font-family: Inconsolata;">Steps: <b>41</b>, Sampler: Euler, CFG scale: 7, Seed: 4275108189, Size: 512x256, Model hash: fc2511737a, Model: chilloutmix_NiPrunedFp32Fix, Denoising strength: 0.7, Hires upscale: <b>2</b>, Hires upscaler: <b>Latent</b>, Version: v1.6.0-2-g4afaaf8a</span></p><p><span style="font-family: courier;">Time taken: <b>1 min. 17.6 sec.</b> on M2 MBP</span></p><p><br /></p><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiKAiEkk6yGjF1sWD8bBrtSuylOVMK0toMpiOOZfN8qSKjh0AKEdYPP11PiHiQMUgfnEI4wDuitqfSx__91-xrS99payO2ivdpfu5_Th6YWwu0Q0nOUeBLhwkZUqVE5J4KezRqIbsoZBn8DrWKysJUti3AkFLGegH6LtdNgkqfswHaLfUGyOVrgBLeu5UVD/s512/00008-4275108189.png" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="256" data-original-width="512" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiKAiEkk6yGjF1sWD8bBrtSuylOVMK0toMpiOOZfN8qSKjh0AKEdYPP11PiHiQMUgfnEI4wDuitqfSx__91-xrS99payO2ivdpfu5_Th6YWwu0Q0nOUeBLhwkZUqVE5J4KezRqIbsoZBn8DrWKysJUti3AkFLGegH6LtdNgkqfswHaLfUGyOVrgBLeu5UVD/s16000/00008-4275108189.png" /></a></div><p><span style="font-family: Bookman Old Style;">Authentic illustrations of different cities in The Lord of the Rings. Magnificent super wide angle,high quality, 8k,high resolution, city landscape, side scrolling, Rule of Thirds, 4K, Retrofuturism,by Makoto Shinkai, Anton Fadeev, Thomas Kinkade, Greg Rutkowski</span></p><p><span style="font-family: Inconsolata;">Steps: <b>20</b>, Sampler: Euler, CFG scale: 7, Seed: <b>4275108189</b>, Size: 512x256, Model hash: fc2511737a, Model: <b>chilloutmix_NiPrunedFp32Fix</b>, Version: v1.6.0-2-g4afaaf8a</span></p><p><span style="font-family: courier;">Time taken: <b>5.3 sec.</b> on M2 MBP</span></p>阿操http://www.blogger.com/profile/12449760480609795429noreply@blogger.com0tag:blogger.com,1999:blog-2385389280209790743.post-27279211908912129212023-12-07T22:11:00.140+08:002023-12-10T00:20:30.704+08:00調整Firefox看Facebook的字型<p></p><p><span style="font-family: inherit;">裝好Firefox版本120.0.1,到了2023年底了拿來看Facebook臉書用的預設字型還是新細明體,看起來很不適應。其他的一些網頁看起來也醜,解決方案就是將中文字型改成雅黑(YaHei)或是正黑體(JhengHei)。設定方式如下:</span></p><p></p><ol style="text-align: left;"><li>在網址列輸入<span style="color: #ffa400; font-family: Roboto Mono;">about:config</span></li><li>在『搜尋偏好設定』裡面輸入<span style="color: #ffa400; font-family: Roboto Mono;">font.name-list.*.zh</span></li></ol><p>然後會出現12列,依照下面的說明針對不同的字體做修改。CN代表的是中國用的簡體中文、<span style="color: #6fa8dc;">HK</span>是<span style="color: #6fa8dc;">香港繁體</span>中文、<span style="color: #93c47d;">TW</span>則是<span style="color: #93c47d;">台灣繁體</span>中文</p><p><span></span></p><a name='more'></a><p></p><p><br />對於<b>cursive書寫體</b>修改如下:</p><p></p><ul style="text-align: left;"><li><span style="font-family: Ubuntu;">font.name-list.cursive.zh-CN </span>的值改成 <span style="font-family: Ubuntu Mono;">Microsoft YaHei, KaiTi</span></li><li><span style="font-family: Ubuntu;">font.name-list.cursive.zh-<span style="color: #6fa8dc;">HK</span> </span>的值改成 <span aria-hidden="true"><span style="color: #6fa8dc; font-family: Ubuntu Mono;">Microsoft JhengHei, DFKai-SB</span></span></li><li><span style="font-family: Ubuntu;">font.<wbr></wbr>name-list.<wbr></wbr>cursive.<wbr></wbr>zh-<span style="color: #93c47d;">TW</span> </span>的值改成 <span aria-hidden="true"><span style="color: #93c47d; font-family: Ubuntu Mono;">Microsoft JhengHei, DFKai-SB</span></span></li></ul><p></p><p>對於<b>monospace等寬字體</b>不要修改</p><p>對於<b>sans-serif無襯線體</b>修改成:</p><p></p><ul style="text-align: left;"><li><span style="font-family: Ubuntu;">font.<wbr></wbr>name-list.<wbr></wbr>sans-serif.<wbr></wbr>zh-CN</span> 的值改成 <span style="font-family: Ubuntu Mono;">Microsoft YaHei, 新細明體,PMingLiU,細明體,MingLiU</span></li><li><span style="font-family: Ubuntu;">font.<wbr></wbr>name-list.<wbr></wbr>sans-serif.<wbr></wbr>zh-<span style="color: #6fa8dc;">HK</span></span> 的值改成 <span style="color: #6fa8dc; font-family: Ubuntu Mono;">Microsoft JhengHei, Arial, MingLiU_HKSCS, Ming(for ISO10646), MingLiU, MingLiU_HKSCS-ExtB</span></li><li><span style="font-family: Ubuntu;">font.<wbr></wbr>name-list.<wbr></wbr>sans-serif.<wbr></wbr>zh-<span style="color: #93c47d;">TW</span></span><span style="color: #93c47d;"> </span>的值改成 <span style="color: #93c47d; font-family: Ubuntu Mono;">Microsoft JhengHei, Arial, PMingLiU, MingLiU, MingLiU-ExtB</span></li></ul><p></p><p><span style="font-family: inherit;">對於<b>serif</b></span><b>襯線體</b>則修改成:</p><p></p><ul style="text-align: left;"><li><span style="font-family: Ubuntu;">font.<wbr></wbr>name-list.<wbr></wbr>serif.<wbr></wbr>zh-CN</span> 的值改成 <span aria-hidden="true"><span style="font-family: Ubuntu Mono;">Microsoft YaHei, 新細明體,PMingLiu,細明體,MingLiU</span></span></li><li><span style="font-family: Ubuntu;">font.<wbr></wbr>name-list.<wbr></wbr>serif.<wbr></wbr>zh-<span style="color: #6fa8dc;">HK</span></span> 的值改成 <span aria-hidden="true"><span style="color: #6fa8dc; font-family: Ubuntu Mono;">Microsoft JhengHei, Times New Roman, MingLiu_HKSCS, Ming(for ISO10646), MingLiU, MingLiU_HKSCS-ExtB</span></span></li><li><span style="font-family: Ubuntu;">font.<wbr></wbr>name-list.<wbr></wbr>serif.<wbr></wbr>zh-<span style="color: #93c47d;">TW</span></span> 的值改成 <span aria-hidden="true"><span style="color: #93c47d; font-family: Ubuntu Mono;">Microsoft JhengHei, Times New Roman, PMingLiu, MingLiU, MingLiU-ExtB</span></span></li></ul><p></p><p>修改完之後的設定如下圖,點即可以放大:</p><p></p><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi2N_IdY_Gf2zpxyPIt6Xg-mS2Uzn2WlNMgYPPRoI1L6BeNCEbW1Q_4992Ryr_6XQ8MRAPOOOqR8FTikdY6AdWH666-dZ93yiZmIFuOpgcjQH_Z_NaXyJ8CdFl0I0plcMV3X_3aZ3TAHHmXCSNZhD4oYCsqtG9_tvCBDepEjVqsERBOH4Y4YGfiu0n5qLTH/s1685/%E8%9E%A2%E5%B9%95%E6%93%B7%E5%8F%96%E7%95%AB%E9%9D%A2%202023-12-09%20225909.png" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="802" data-original-width="1685" height="190" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi2N_IdY_Gf2zpxyPIt6Xg-mS2Uzn2WlNMgYPPRoI1L6BeNCEbW1Q_4992Ryr_6XQ8MRAPOOOqR8FTikdY6AdWH666-dZ93yiZmIFuOpgcjQH_Z_NaXyJ8CdFl0I0plcMV3X_3aZ3TAHHmXCSNZhD4oYCsqtG9_tvCBDepEjVqsERBOH4Y4YGfiu0n5qLTH/w400-h190/%E8%9E%A2%E5%B9%95%E6%93%B7%E5%8F%96%E7%95%AB%E9%9D%A2%202023-12-09%20225909.png" width="400" /></a></div><br /><p></p><h2 style="text-align: left;"><span style="font-family: inherit;">參考資料:</span></h2><p></p><ul style="text-align: left;"><li><a href="https://www.everybbs.com/show1.php?o=t&f=233&t=35" target="_blank">都2023年了,火狐Firefox esr預設中文字型還在用XP時代的新細明體!? 這就教你怎麼改成微軟正黑體(或雅黑體)</a>:本文的設定都是看這邊</li></ul><p></p><p><span style="font-family: inherit;">_EOF_</span></p><p><span style="font-family: Bookman Old Style;"></span></p><div class="separator" style="clear: both; text-align: center;"><span style="font-family: Bookman Old Style;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhGmtbYjQSybe2LFmoCOnpLtH7na2gR0SCGy3gULn_pIBwLGEJji1dWVbO_3g1IMNiSBNaw-Nc-uvmwXpfpFHseXLnGd1Eu9AIfCLm0RC2_GxCNhiUvm2q660HxwenTpTJHd1PFzF6b8cFN93hFYoWBueTfQnHJxvajBWHEBynewHRUys0KeE-2D57WYO9O/s512/00001-1111031091.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="256" data-original-width="512" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhGmtbYjQSybe2LFmoCOnpLtH7na2gR0SCGy3gULn_pIBwLGEJji1dWVbO_3g1IMNiSBNaw-Nc-uvmwXpfpFHseXLnGd1Eu9AIfCLm0RC2_GxCNhiUvm2q660HxwenTpTJHd1PFzF6b8cFN93hFYoWBueTfQnHJxvajBWHEBynewHRUys0KeE-2D57WYO9O/s16000/00001-1111031091.png" /></a></span></div><span style="font-family: Bookman Old Style;"><br />Dark sci-fi, a small radar on mountain ,sunset, concept art, high detail, warm lighting, volumetric godrays, vivid beautiful</span><p></p><p><span style="font-family: Inconsolata;">Steps: 20, Sampler: DPM++ 2M Karras, CFG scale: 7, Seed: <b>1111031091</b>, Size: 512x256, Model hash: 6ce0161689, Model: <b>v1-5-pruned-emaonly</b>, Version: v1.6.1</span></p><p><span style="font-family: Inconsolata;">Time taken: <b>2 min. 8.7 sec.</b><br />A: 2.33 GB, R: 2.83 GB, Sys: 2.0/2 GB (100.0%)</span></p>阿操http://www.blogger.com/profile/12449760480609795429noreply@blogger.com0tag:blogger.com,1999:blog-2385389280209790743.post-61615060707268552272023-12-03T14:59:00.034+08:002024-01-06T11:50:05.281+08:00《破壊前夜のこと》by asmi<p><span style="font-family: inherit;">「破壊前夜のこと」asmi - 🐈《能幹貓今天也憂鬱》片尾曲【Ani-One】</span></p><iframe allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" allowfullscreen="" frameborder="0" height="345" src="https://www.youtube.com/embed/qjdu2xcsGws" title="🎵「破壊前夜のこと」asmi - 🐈《能幹貓今天也憂鬱》片尾曲【Ani-One】" width="543"></iframe><p><span></span></p><a name='more'></a><p></p><p>(TV動畫《能幹貓今天也憂鬱》片尾曲)<br />歌手:asmi <br />作詞・作曲:asmi 編曲:Taro Ishida</p><p>溫馨又可愛的片尾動畫,應該蠻多人都想要這樣一隻寵物吧。</p><p>インスタグラムにも載ってない 私の奥のこと見せたい<br />貴方だけの私に なってみたいなりたいなりたいよ<br />朝焼けの眼差しは冷たい タバコが染みた服臭い<br />夜が終わってもまだ どこにも行けない帰さないで don't leave me</p><p>Ooh, yes, we can do, yes<br />Ooh, we can do this, we can do this (簡単だ)</p><p>これは どうしようもなくしょーもない恋<br />これもまた 好きになっちゃダメとわかっていても ってやつです</p><p>I know もうね 年頃ってやつが悪さをしていて<br />よくない男に惹かれちゃって もっと もっとで欲しくなって<br />摂氏0度で燃える青い東京</p><p>夜の端くれだってそこそこに 私とあなたの真ん中で<br />要らないアイテム消して 冬の花と咲いてみたかったの</p><p>始発の電車は太陽より 強く私はずかしめる<br />もうこれ以上朝にならないで 永遠に昨日でいい</p><p>Yes, we can do, yes<br />Ooh, we can do this, we can do this (簡単だ)</p><p>がらんどう冷めた空気が 胸の奥 おっきなナイフで突き刺すの<br />あなたの笑う顔が愛しいわ 目と目合わせてなんでもない話を<br />もっともっとしてたかった あなたのもうちょっと奥に触れたかったの</p><p>Oh, oh (簡単だ)<br />叶わないなら滅んでまえ東京</p><p>雪が私を濡らすのは何故と 馬鹿にするなちょっと待てと<br />むせび泣いた雫さえ凍らせるか 冬が嫌いだ</p><p>コンビニ入ってなんとなく選んで しじみの味噌汁なんでや<br />肝臓に心臓 ぬくもりが溶かしてく</p><p>インスタグラムにも載ってない 私の奥のこと<br />見せたい貴方だけの私に なってみたいなりたいなりたいよ</p><p>朝焼けの眼差しは冷たい タバコが染みた服臭い<br />夜が終わってもまだ どこにも行けない帰さないで don't leave me</p><p>Yes, we can do, yes<br />Ooh, we can do this, we can do this (簡単だ)<br />Ooh, we can do, yes<br />Ooh, we can do this, we can do this (簡単だ)</p><p>能幹貓今天也憂鬱 ED_破壊前夜のこと [中日羅馬歌詞], 3m42s</p><p><iframe allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" allowfullscreen="" frameborder="0" height="345" src="https://www.youtube.com/embed/zr-BdQq56WQ" title="能幹貓今天也憂鬱 ED_破壊前夜のこと [中日羅馬歌詞]" width="543"></iframe></p><p>破壊前夜のこと - asmi (Official Music Video)</p><p><iframe allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" allowfullscreen="" frameborder="0" height="345" src="https://www.youtube.com/embed/nxnFNuCF2o4" title="破壊前夜のこと - asmi (Official Music Video)" width="543"></iframe></p><p><span style="font-family: inherit;">_EOF_</span></p>阿操http://www.blogger.com/profile/12449760480609795429noreply@blogger.com0tag:blogger.com,1999:blog-2385389280209790743.post-79335163149254160972023-12-01T17:08:00.029+08:002024-01-06T11:50:05.283+08:00MobaXterm存放sessions的位置<p><span style="font-family: inherit;"></span></p><div class="separator" style="clear: both; text-align: center;"><span style="font-family: inherit;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgbTiqn3H5DP6JxPhV5v4GZN6YpZ32BKAUXCJYOxmTa_k6jmy2po57tM_96EwlKYodIQoI_O83LqsSwHbldHcxYfdxXdgos3jWON8WnOLV0uStgvRUi3YyhzoJ_vuz5a0YNfY62Mj-Hth2HPMfzOVBWRVS0Gk-OHRLN91xvqByzW7hj91A9YBdNko5pjAiH/s512/00049-2248194366.png" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="256" data-original-width="512" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgbTiqn3H5DP6JxPhV5v4GZN6YpZ32BKAUXCJYOxmTa_k6jmy2po57tM_96EwlKYodIQoI_O83LqsSwHbldHcxYfdxXdgos3jWON8WnOLV0uStgvRUi3YyhzoJ_vuz5a0YNfY62Mj-Hth2HPMfzOVBWRVS0Gk-OHRLN91xvqByzW7hj91A9YBdNko5pjAiH/s16000/00049-2248194366.png" /></a></span></div><p></p><p><span style="font-family: inherit;">MobaXterm在Windows上設定的存放資料夾在:</span></p><p></p><ul style="text-align: left;"><li><span style="color: #6fa8dc; font-family: Roboto Mono;">C:\Users\%username%\AppData\Roaming\MobaXterm</span></li></ul><p></p><p>至於Session還有其他一堆設定則放在上述資料夾裡面的檔案:<span></span></p><a name='more'></a><p></p><p></p><ul style="text-align: left;"><li><span style="color: #93c47d; font-family: Roboto Mono;">MobaXterm.ini</span></li></ul><p></p><p><span style="font-family: inherit;"><br /></span></p><h2 style="text-align: left;"><span style="font-family: inherit;">參考資料</span></h2><p></p><ul style="text-align: left;"><li><a href="https://blog.mobatek.net/post/mobaxterm-configuration-settings/" target="_blank">MobaXterm configuration settings</a>:官網的說明</li></ul><p></p><p><span style="font-family: inherit;">_EOF_</span></p><p><span style="font-family: Bookman Old Style;">photo of 8k ultra realistic castle on cliff surrounded by swirling clouds and lighting, dark, menacing, full of colour, cinematic lighting, battered, trending on artstation, 4k, hyperrealistic, focused, extreme details,unreal engine 5, cinematic, masterpiece, art by Peter Mohrbacher</span></p><p><span style="font-family: Inconsolata;">Steps: 36, Sampler: <b>Euler</b>, CFG scale: 7, Seed: <b>2248194366</b>, Size: 512x256, Model hash: 6ce0161689, Model: <b>v1-5-pruned-emaonly</b>, Version: v1.6.1</span></p><p><span style="font-family: courier;">Time taken: <b>2 min. 30.8 sec.</b><br />A: 1.70 GB, R: 2.26 GB, Sys: 2.0/2 GB (100.0%)</span></p>阿操http://www.blogger.com/profile/12449760480609795429noreply@blogger.com0tag:blogger.com,1999:blog-2385389280209790743.post-42764218092190983762023-11-30T17:13:00.044+08:002024-02-21T14:13:53.993+08:00Windows用指令產生隨機密碼<p></p><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgVHrd0qRefAAie0SXPMHkZ8ZL3Qz39MMXFziitfhCII1SGy0oZ8C44deCH4JdLt-R_Z8U7irKuhP8-mCqUJJXLbMa8LIJ6LafjA0cIn2Di7rUym5hYMwvdYTiHpHsHMcd04z2t_70Zh5B4HX8PQ4ikYUcw_zeL5ooZEAhn4jj7K5n0N7B1gVFe5M7nL4TA/s512/00053-718520804.png" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="512" data-original-width="512" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgVHrd0qRefAAie0SXPMHkZ8ZL3Qz39MMXFziitfhCII1SGy0oZ8C44deCH4JdLt-R_Z8U7irKuhP8-mCqUJJXLbMa8LIJ6LafjA0cIn2Di7rUym5hYMwvdYTiHpHsHMcd04z2t_70Zh5B4HX8PQ4ikYUcw_zeL5ooZEAhn4jj7K5n0N7B1gVFe5M7nL4TA/s16000/00053-718520804.png" /></a></div><p></p><p><span style="font-family: inherit;">在Windows上可以下面的PowerShell產生長度為12個字元的隨機密碼:</span></p><p><span style="font-family: inherit;"></span></p><pre class="language-powershell" style="background: rgb(245, 242, 240); border-radius: 3px; border: 1px solid rgb(204, 204, 204); font-family: Consolas, Monaco, "Andale Mono", "Ubuntu Mono", monospace; font-size: 13px; hyphens: none; line-height: 1.5; margin-bottom: 0.5em; margin-top: 0.5em; overflow-wrap: normal; overflow: auto; padding: 1em; tab-size: 4; text-shadow: white 0px 1px; word-break: normal;"><code class="language-powershell" style="background: none; border-radius: 3px; border: medium; font-family: Consolas, Monaco, "Andale Mono", "Ubuntu Mono", monospace; hyphens: none; line-height: 1.5; margin: 0px; overflow-wrap: normal; padding: 0px; tab-size: 4; text-shadow: white 0px 1px; word-break: normal; word-spacing: normal;"><span class="token variable" style="color: #ee9900; print-color-adjust: exact;">$Password</span> = <span class="token function" style="color: #dd4a68; print-color-adjust: exact;">New-Object</span> <span class="token operator" style="background: rgba(255, 255, 255, 0.5); color: #a67f59; print-color-adjust: exact;">-</span>TypeName PSObject
<span class="token variable" style="color: #ee9900; print-color-adjust: exact;">$Password</span> <span class="token punctuation" style="color: #999999; print-color-adjust: exact;">|</span> <span class="token function" style="color: #dd4a68; print-color-adjust: exact;">Add-Member</span> <span class="token operator" style="background: rgba(255, 255, 255, 0.5); color: #a67f59; print-color-adjust: exact;">-</span>MemberType ScriptProperty <span class="token operator" style="background: rgba(255, 255, 255, 0.5); color: #a67f59; print-color-adjust: exact;">-</span>Name <span class="token string" style="color: #669900; print-color-adjust: exact;">"Password"</span> <span class="token operator" style="background: rgba(255, 255, 255, 0.5); color: #a67f59; print-color-adjust: exact;">-</span>Value <span class="token punctuation" style="color: #999999; print-color-adjust: exact;">{</span> <span class="token punctuation" style="color: #999999; print-color-adjust: exact;">(</span>"<span class="token operator" style="background: rgba(255, 255, 255, 0.5); color: #a67f59; print-color-adjust: exact;">!</span>@<span class="token comment" spellcheck="true" style="color: slategrey; print-color-adjust: exact;">#$%^&*123456789ABCDEFGHJKLMNOPQRSTUVWXYZ_abcdefghijkmnopqrstuvwxyz".tochararray() | sort {Get-Random})[0..12] -join '' }</span>
<span class="token function" style="color: #dd4a68; print-color-adjust: exact;">echo</span> <span class="token variable" style="color: #ee9900; print-color-adjust: exact;">$Password</span></code></pre><p><span style="font-family: inherit;">使用方式為開啟Windows的PowerShell後,貼上上述的指令即可產生密碼。上述的</span><span style="color: slategrey; font-family: Consolas, Monaco, "Andale Mono", "Ubuntu Mono", monospace; font-size: 13px; word-spacing: normal;">0..12</span><span style="font-family: inherit;">這邊可以調整</span><span style="color: slategrey; font-family: Consolas, Monaco, "Andale Mono", "Ubuntu Mono", monospace; font-size: 13px;">12</span><span style="font-family: inherit;">這個數字,密碼的長度就是12+1=13個字元。為了避免麻煩,把0(數字</span>零<span style="font-family: inherit;">)、I(大寫i)、l(小寫L)從產生密碼的列表裡面拿走避免一些麻煩</span></p><p><span style="font-family: inherit;"><span></span></span></p><a name='more'></a><span style="font-family: inherit;"><span></span></span><p></p><p><span style="font-family: inherit;"></span></p><pre class="language-none" style="background: rgb(245, 242, 240); border-radius: 3px; border: 1px solid rgb(204, 204, 204); font-family: Consolas, Monaco, "Andale Mono", "Ubuntu Mono", monospace; font-size: 13px; hyphens: none; line-height: 1.5; margin-bottom: 0.5em; margin-top: 0.5em; overflow-wrap: normal; overflow: auto; padding: 1em; tab-size: 4; text-shadow: white 0px 1px; word-break: normal;"><code class="language-none" style="background: none; border-radius: 3px; border: medium; font-family: Consolas, Monaco, "Andale Mono", "Ubuntu Mono", monospace; hyphens: none; line-height: 1.5; margin: 0px; overflow-wrap: normal; padding: 0px; tab-size: 4; text-shadow: white 0px 1px; word-break: normal; word-spacing: normal;">Password
--------
ayOi$hUmE7H5k</code></pre><p><span style="font-family: inherit;">_EOF_</span></p><p><span style="font-family: Bookman Old Style;">Kawaii low poly bunny character, 3d isometric render, white background, ambient occlusion, unity engine, square image</span></p><p><span style="font-family: Inconsolata;">Steps: 20, Sampler: Euler, CFG scale: 7, Seed: <b>718520804</b>, Size: 512x512, Model hash: 5765695e8f, Model: <b>Dall-e_3_0.3-v2</b>, Version: v1.6.0-2-g4afaaf8a<br />這邊發現</span><b style="font-family: Inconsolata;">Dall-e_3_0.3-v2</b><span style="font-family: Inconsolata;">和</span><span style="font-family: Inconsolata;">chilloutmix和diffusion_pytorch_model生成的圖片一樣</span></p><p><span style="font-family: Inconsolata;"></span></p><p><span style="font-family: courier;">Time taken: <b>14.3 sec.</b> on Apple M2 Pro</span></p>阿操http://www.blogger.com/profile/12449760480609795429noreply@blogger.com0tag:blogger.com,1999:blog-2385389280209790743.post-11143680313229106662023-11-24T19:33:00.074+08:002024-01-06T11:50:05.271+08:00調整多核心數目,編譯MacPorts上的軟體<p></p><p></p><p></p><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiAQJCisNu9LzskD_Qy-rtTpr3ypFa_oz14jYwkTrS9N_QlooJBVjGMndR5IXdvEv_md8_O0pDSBvyz7O5oaqBXpNRw6xLvNPbrRwbWhnu4nLVciSu0fEPf80cpNgy9Z_-oYpWV8Tsv4ytOTJp4cCgFxTetQAFakMT1qeypRaUhNGPp6i7vf8lDzsRwvObM/s1024/00027-2398360620.png" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="1024" data-original-width="1024" height="512" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiAQJCisNu9LzskD_Qy-rtTpr3ypFa_oz14jYwkTrS9N_QlooJBVjGMndR5IXdvEv_md8_O0pDSBvyz7O5oaqBXpNRw6xLvNPbrRwbWhnu4nLVciSu0fEPf80cpNgy9Z_-oYpWV8Tsv4ytOTJp4cCgFxTetQAFakMT1qeypRaUhNGPp6i7vf8lDzsRwvObM/s320/00027-2398360620.png" width="512" /></a></div><p></p><p><span style="font-family: inherit;">預設MacPorts在編譯軟體的時候,會使用所有的核心,設定放在</span><span style="color: #6fa8dc; font-family: Source Code Pro;">/opt/local/etc/macports/macports.conf</span><span style="font-family: inherit;">,設定則是:</span></p><p></p><ul style="text-align: left;"><li><span style="color: #6fa8dc; font-family: Source Code Pro;"><b>buildmakejobs 0</b> </span></li></ul><p></p><p><span style="font-family: inherit;">這時候可以調整數目,像只想要用8個核心編譯則可以把設定改成下面:<span></span></span></p><a name='more'></a><p></p><p></p><ul style="text-align: left;"><li><b><span style="color: #6fa8dc; font-family: Source Code Pro;">buildmakejobs 8</span></b></li></ul><p></p><p><span style="font-family: inherit;"><br /></span></p><p><span style="font-family: inherit;">以上的修改是永久的,如果只是要暫時在編譯某個軟體僅用單核心,則用下列指令:</span></p><p></p><ul style="text-align: left;"><li><span style="font-family: Roboto Mono;">sudo port install PORT <span style="color: #93c47d;">build.jobs=1</span></span></li></ul><p></p><p><span style="font-family: inherit;">這樣就只會在這次的編譯中使用1個核心</span></p><p><span style="font-family: inherit;"><br /></span></p><h2 style="text-align: left;"><span style="font-family: inherit;">參考資料</span></h2><p></p><ul style="text-align: left;"><li><span style="font-family: inherit;"><a href="https://trac.macports.org/wiki/howto/ParallelBuilding" target="_blank">How to disable parallel building</a>:MacPorts官網的說明文件</span></li></ul><p></p><p><span style="font-family: inherit;">_EOF_</span></p><p><span style="font-family: Bookman Old Style;">Impressionist landscape of a Japanese garden in autumn, with a bridge over a koi pond. 4k, masterpiece</span></p><p><span style="font-family: Inconsolata;">Steps: 36, Sampler: <b>Euler</b>, CFG scale: 7, Seed: <b>2398360620</b>, Size: 512x512, Model hash: 6ce0161689, Model: <b>v1-5-pruned-emaonly</b>, VAE hash: 3f5d1d23e1, VAE: <b>ClearVAE_V2.3_fp16.safetensors</b>, Denoising strength: 0.7, Hires upscale: <b>2</b>, Hires upscaler: None, Version: v1.6.0-2-g4afaaf8a</span></p><p><span style="font-family: courier;">Time taken: <b>3 min. 31.8 sec.</b> on Apple M2 Pro</span></p><p></p><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjzG7Avvit1IGrPblE7r3zwImvCMSh3wI9KN3fL-l3huA1JBQpr_VG_6BQg69K6DubO77fKsQl9Qv1GtEl6JjRI1ugHVAU_5d4asl-_7yscMVNEEiz9dcBZmLX5-v-WriY2jWsyRglJ15dkzmaiq2eToEdj_yilKPslPoH2G9w3AES9AeZPDS6gkIbqL1Jr/s512/00018-2398360620.png" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="512" data-original-width="512" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjzG7Avvit1IGrPblE7r3zwImvCMSh3wI9KN3fL-l3huA1JBQpr_VG_6BQg69K6DubO77fKsQl9Qv1GtEl6JjRI1ugHVAU_5d4asl-_7yscMVNEEiz9dcBZmLX5-v-WriY2jWsyRglJ15dkzmaiq2eToEdj_yilKPslPoH2G9w3AES9AeZPDS6gkIbqL1Jr/s16000/00018-2398360620.png" /></a></div><p></p><p><span style="font-family: Bookman Old Style;">Impressionist landscape of a Japanese garden in autumn, with a bridge over a koi pond. 4k, masterpiece</span></p><p><span style="font-family: Inconsolata;">Steps: 41, Sampler: <b>Euler</b>, CFG scale: 7, Seed: <b>2398360620</b>, Size: 512x512, Model hash: 6ce0161689, Model: <b>v1-5-pruned-emaonly</b>, Version: v1.6.0-2-g4afaaf8a</span></p><p><span style="font-family: Inconsolata;"></span></p><p style="text-align: left;"><span style="font-family: courier;">Time taken: <b>24.7 sec. </b>on Apple M2 Pro</span></p>阿操http://www.blogger.com/profile/12449760480609795429noreply@blogger.com0tag:blogger.com,1999:blog-2385389280209790743.post-39295687905849845312023-11-23T11:39:00.114+08:002024-01-06T11:50:05.275+08:00到ArtHub.ai上找AI生成的圖和提示詞<p></p><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiwCQ52t_r_eFxZg_YzitHum60oHLdH5qtPoX1E7Npt1ZrRxEtracF5MIIjyUi9AYh1fMJJXJzVJMAM-UiE-ZD49l8c9mFvLL-iefeQG8TCP2S18uef8D9C_RjpZhFA98lyJ-g0-V_Y5LSJyEX5P0UIBF5BngDlkh8q247xauvm8j02tF99O7BNt6aGbQH4/s512/00009-2753863585.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="256" data-original-width="512" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiwCQ52t_r_eFxZg_YzitHum60oHLdH5qtPoX1E7Npt1ZrRxEtracF5MIIjyUi9AYh1fMJJXJzVJMAM-UiE-ZD49l8c9mFvLL-iefeQG8TCP2S18uef8D9C_RjpZhFA98lyJ-g0-V_Y5LSJyEX5P0UIBF5BngDlkh8q247xauvm8j02tF99O7BNt6aGbQH4/s16000/00009-2753863585.png" /></a></div><p></p><p><span style="font-family: inherit;">AI生圖很方便,<a href="http://ArtHub.ai">ArtHub.ai</a>是個蒐集用AI生成的設計、圖片與藝品的網站</span></p><p></p><ul style="text-align: left;"><li><a href="https://arthub.ai/" target="_blank"><span style="color: #6fa8dc;"><b>首頁</b></span></a>:ArtHub.ai的首頁就有許多圖</li><ul><li><a href="https://arthub.ai/tags/stable%20diffusion" target="_blank">Stable Diffusion</a>:用Stable Diffusion生成的圖,大部分有人</li><li><a href="https://arthub.ai/tags/diffusion%20bee" target="_blank">Diffusion Bee</a>:用Diffusion Bee生成的圖,有些擬人化的動物</li><li><a href="https://arthub.ai/library/tags/fantasy" target="_blank">Fantasy Library</a>:都是奇幻的風景圖</li></ul><li><a href="https://arthub.ai/community" target="_blank">Community Art</a>:社群出的圖,有多種風格也有很像照片的圖</li><li><a href="https://arthub.ai/library" target="_blank"><span style="color: #93c47d;"><b>Prompt Library</b></span></a>:根據不同風格分類,標籤包含了 <span><a name='more'></a></span></li><ul><li><a href="https://arthub.ai/library/tags/fantasy" target="_blank">Fantacy</a>:奇幻風格風景圖</li><li><a href="https://arthub.ai/library/tags/architecture" target="_blank">Architecture</a>:各種2D, 3D的建築,也有一些概念建築</li><li><a href="https://arthub.ai/library/tags/food" target="_blank">Food</a>:主要是西方人對食物的概念,插入了一些奇妙的圖</li><li><a href="https://arthub.ai/library/tags/furniture" target="_blank">Furniture</a>:家具圖,也有一些室內設計圖放在裡面</li><li><a href="https://arthub.ai/library/tags/fashion" target="_blank">Fasion</a>:各種穿搭,衣服鞋子等</li><li><a href="https://arthub.ai/library/tags/magic" target="_blank">Magic</a>:人使用魔法,哈利波特那種想像圖</li><li><a href="https://arthub.ai/library/tags/doodles" target="_blank">Doodles</a>:各種草稿,塗鴉</li><li><a href="https://arthub.ai/library/tags/watercolor" target="_blank">Watercolor</a>:水彩畫</li><li><a href="https://arthub.ai/library/tags/logo" target="_blank">Logos</a>:標誌、徽章</li><li><a href="https://arthub.ai/library/tags/sci-fi" target="_blank">Sci-Fi</a>:科幻圖</li><li><a href="https://arthub.ai/library/tags/psychedelic" target="_blank">Psychedelic</a>:迷幻風格</li><li><a href="https://arthub.ai/library/tags/tattoos" target="_blank">Tattoo</a>:刺青</li><li><a href="https://arthub.ai/library/tags/characters" target="_blank">Characters</a>:角色,大部分都是動畫或是動漫的風格</li><li><a href="https://arthub.ai/library/tags/jewelry" target="_blank">Jewelry</a>:寶石與首飾,但一半是帶著裝飾的人</li><li><a href="https://arthub.ai/library/tags/oil-painting" target="_blank">Oil Painting</a>:油畫風格</li><li><a href="https://arthub.ai/library/tags/color-pencil" target="_blank">Color Pencil</a>:彩色鉛筆畫</li><li><a href="https://arthub.ai/library/tags/low-poly" target="_blank">Low Poly</a>:簡化的圖,這部分還不錯可以試試看</li><li><a href="https://arthub.ai/library/tags/lego" target="_blank">Legos</a>:用樂高拼出來的圖</li><li><a href="https://arthub.ai/library/tags/interior-design" target="_blank">Interior Design</a>:室內設計</li></ul></ul><p><span style="font-family: inherit;">_EOF_</span></p><p><span style="font-family: Bookman Old Style;">Authentic illustrations of different cities in The Lord of the Rings,Magnificent super wide angle,high quality, 8k,high resolution, city landscape, side scrolling, Rule of Thirds, 4K, Retrofuturism,by makoto shinkai,Anton Fadeev, thomas kinkade,greg rutkowski</span></p><p><span style="font-family: Ubuntu;">Steps: 20, Sampler: DPM++ 2M SDE Karras, CFG scale: 7, Seed: <b>2753863585</b>, Size: 512x256, Model hash: 6ce0161689, Model: <b>v1-5-pruned-emaonly</b>, Version: v1.6.0-2-g4afaaf8a</span></p><p><span style="font-family: courier;">Time taken: <b>4 min. 36.1 sec.</b><br />A: 3.36 GB, R: 3.69 GB, Sys: 2.0/2 GB (100.0%)</span></p>阿操http://www.blogger.com/profile/12449760480609795429noreply@blogger.com0tag:blogger.com,1999:blog-2385389280209790743.post-19509747429312011692023-11-16T00:12:00.013+08:002024-01-06T11:50:05.273+08:00WSL2看不到新插入的隨身碟<p></p><span style="font-family: Roboto Mono;"><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhMOLbr1id-_8PGlLcOrnKoEwkR80biG_c7Lr8t0hO739fRp2ua_jPgmg6yCQny1-6Zlty373gcgryg-8F_-4614Ra-2lBu1SCqmohYfcRdngMGQ4H9CIMyXJQvkdQWuRkY58eMISYHK4JpAclHY8FXFUxD1PTp2xIl4kS92DXWs-ZZMMNUALK8mmVrxmxK/s1280/00029-2949520826.png" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="640" data-original-width="1280" height="256" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhMOLbr1id-_8PGlLcOrnKoEwkR80biG_c7Lr8t0hO739fRp2ua_jPgmg6yCQny1-6Zlty373gcgryg-8F_-4614Ra-2lBu1SCqmohYfcRdngMGQ4H9CIMyXJQvkdQWuRkY58eMISYHK4JpAclHY8FXFUxD1PTp2xIl4kS92DXWs-ZZMMNUALK8mmVrxmxK/s320/00029-2949520826.png" width="512" /></a></div><div class="separator" style="clear: both; text-align: center;"><br /></div><span style="font-family: "Times New Roman";"><div><span style="font-family: Roboto Mono;"><span style="font-family: "Times New Roman";">新插上去的隨身硬碟在WSL2裡面無法在</span>/mnt</span>下面看到。如果插入的硬碟的編號是<span style="color: #93c47d; font-family: Roboto Mono;"><b>U</b></span>,那麼依序執行下面的指令就可以掛載: </div></span></span><p></p><p></p><ol style="text-align: left;"><li><span style="font-family: Roboto Mono;">sudo mkdir <span style="color: #6fa8dc;">/mnt/u</span></span></li><li><span style="font-family: Roboto Mono;">sudo mount -t <b>drvfs</b> <span style="color: #93c47d;"><b>U:</b></span> <span style="color: #6fa8dc;">/mnt/u</span></span></li></ol><p></p><p>使用完以後記得用下面指令退出,不然隨身碟無法安全退出:<span></span></p><a name='more'></a><p></p><p></p><ol style="text-align: left;"><li><span style="font-family: Roboto Mono;">sudo umount <span style="color: #6fa8dc;">/mnt/u</span></span></li><li><span style="font-family: Roboto Mono;">sudo umount <b>-f</b> <span style="color: #6fa8dc;">/mnt/u</span></span></li><li><span style="font-family: Roboto Mono;">sudo umount <b>-lf</b> <span style="color: #6fa8dc;">/mnt/u</span></span></li></ol><p></p><p>寫三個指令是第一個不行才用後面的去執行</p><p><br /></p><h2 style="text-align: left;">參考資料</h2><p></p><ul style="text-align: left;"><li><a href="https://learn.microsoft.com/zh-tw/archive/blogs/wsl/file-system-improvements-to-the-windows-subsystem-for-linux" target="_blank">File System Improvements to the Windows Subsystem for Linux</a></li><li><a href="https://kheresy.wordpress.com/2021/04/22/access-removable-media-storage-in-wsl/" target="_blank">在 WSL 存取可移除儲存裝置(記憶卡、隨身碟)</a></li></ul><div><span style="font-family: inherit;">_EOF_</span></div><p><span style="font-family: Bookman Old Style;">Aquatint of a landscape of a Sexy desktop wallpaper from inside of a Dagobah, at Sunset, Peaceful, Gadgetpunk, MOBA style, absurdres, highly detailed, art by Jonas De Ro, perfection, masterpiece</span></p><p><span style="font-family: Inconsolata;">Steps: <b>36</b>, Sampler: DPM++ 2M Karras, CFG scale: 7, Seed: 2949520826, Size: 512x256, Model hash: 5765695e8f, Model: Dall-e_3_0.3-v2, Denoising strength: 0.7, Hires upscale: <b>2.5</b>, Hires upscaler: <b>None</b>, Version: v1.6.0-2-g4afaaf8a</span></p><p><span style="font-family: courier;">Time taken: <b>2 min. 22.7 sec.</b> on M2 MBP</span></p><p><span style="font-family: courier;"><br /></span></p><p style="text-align: left;"></p><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg8NQEVkX67MToTCcu1yM1zAupiQDP_NY5YdG7Q89kXB51BLkmQc3K_J7kn0mTuJ_dCee5wtVDWRubdSMvJSemv1XXCGDzdljzg4ejXmbUkuEMGmoRtSWirtVn_HimJWBSfyTao5EBQQoeTWDQOo3yTo-XmxNrMYq3ySHdyd5iIgxcAMiPFoUM28Peg7iXi/s512/00016-2949520826.png" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="256" data-original-width="512" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg8NQEVkX67MToTCcu1yM1zAupiQDP_NY5YdG7Q89kXB51BLkmQc3K_J7kn0mTuJ_dCee5wtVDWRubdSMvJSemv1XXCGDzdljzg4ejXmbUkuEMGmoRtSWirtVn_HimJWBSfyTao5EBQQoeTWDQOo3yTo-XmxNrMYq3ySHdyd5iIgxcAMiPFoUM28Peg7iXi/s16000/00016-2949520826.png" /></a></div><br /><p></p><p><span style="font-family: Bookman Old Style;">Aquatint of a landscape of a Sexy desktop wallpaper from inside of a Dagobah, at Sunset, Peaceful, Gadgetpunk, MOBA style, absurdres, highly detailed, art by Jonas De Ro, perfection, masterpiece</span></p><p><span style="font-family: Inconsolata;">Steps: 20, Sampler: <b>DPM++ 2M Karras</b>, CFG scale: 7, Seed: <b>2949520826</b>, Size: 512x256, Model hash: 5765695e8f, Model: <b>Dall-e_3_0.3-v2</b>, Version: v1.6.0-2-g4afaaf8a</span></p><p><span style="font-family: Inconsolata;"></span></p><p><span style="font-family: courier;">Time taken: <b>5.5 sec.</b> on M2 MBP</span></p>阿操http://www.blogger.com/profile/12449760480609795429noreply@blogger.com0tag:blogger.com,1999:blog-2385389280209790743.post-10360082235308597412023-11-09T11:00:00.091+08:002024-01-06T11:50:05.271+08:00用whatsmydns檢查DNS是否設定成功<div><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjksBX4SsE7mCNCpA2c2I3QuY76-Sx99fXn5LFPAiqcE-FHFWwTBEVh7VnA5wiYM4dntc2Fy6AO6cPDrinAxx4VRta7XgmAUGNIcgg4kwXz5hF016_pKlVwyO54YVjxYpWpE-zyPwOe7pDK5HxTR4ZMRy0_LzknMb6gKBl3V3sPC8Ik-ZJxOBZMYjUalllz/s512/00000-3717791013.png" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="256" data-original-width="512" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjksBX4SsE7mCNCpA2c2I3QuY76-Sx99fXn5LFPAiqcE-FHFWwTBEVh7VnA5wiYM4dntc2Fy6AO6cPDrinAxx4VRta7XgmAUGNIcgg4kwXz5hF016_pKlVwyO54YVjxYpWpE-zyPwOe7pDK5HxTR4ZMRy0_LzknMb6gKBl3V3sPC8Ik-ZJxOBZMYjUalllz/s16000/00000-3717791013.png" /></a></div></div><p style="text-align: left;">設定完自建的DNS,或是根據域名供應商(Domain Name provider)上面介面修改完後,若不想用指令的方式檢查,可以使用<a href="https://www.whatsmydns.net/" target="_blank">whatsmydns.net</a>提供的global DNS propagation checker來檢查下列不同型態的DNS紀錄:</p><p></p><p></p><ul style="text-align: left;"><li><a href="https://www.whatsmydns.net/#A/www.nctu.edu.tw" target="_blank">A</a>:<span style="color: #6fa8dc;">DNS正向解析</span>,從domain name去問IP address</li><li><a href="https://www.whatsmydns.net/#AAAA/www.edu.tw" target="_blank">AAAA</a>:IPv6的DNS正向解析</li><li><a href="https://www.whatsmydns.net/#CNAME/ps2v3.life.nctu.edu.tw" target="_blank">CNAME</a>:別名可以寫在這邊<span><a name='more'></a></span></li><li><a href="https://www.whatsmydns.net/#MX/nycu.edu.tw" target="_blank">MX</a>:某個網域的郵件伺服器在哪邊<br />以陽明交大為例查出來放在google上</li><li><a href="https://www.whatsmydns.net/#NS/moda.gov.tw" target="_blank">NS</a>:某個網域的域名伺服器在哪邊<br />以數位發展部為例查出來在cloudflare上</li><li><a href="https://www.whatsmydns.net/#PTR/8.8.8.8" target="_blank">PTR</a>:<span style="color: #93c47d;">DNS反向解析</span>,從IP address反查domain name</li><li><a href="https://www.whatsmydns.net/#SOA/gov.tw" target="_blank">SOA</a>:以gov.tw為例</li><li><a href="http://_autodiscover._tcp.jupiterweb.me" target="_blank">SRV</a>:除了指向一個IP以外,還會指定port<br /></li><li><a href="https://www.whatsmydns.net/#TXT/cc.nthu.edu.tw" target="_blank">TXT</a>:以清華大學的Sender Policy Framwork為例</li><li><a href="https://www.whatsmydns.net/#CAA/dnsimple.com" target="_blank">CAA</a>:以dnsimple.com為例,有篇文章<a href="https://support.dnsimple.com/articles/caa-record/" target="_blank">What’s a CAA record?</a>在說明CAA (Certification Authority Authorization (CAA) record)</li></ul><p></p><p>_EOF_</p><p><span style="font-family: Bookman Old Style;">Dark sci-fi, a small radar on mountain ,sunset, concept art, high detail, warm lighting, volumetric godrays, vivid beautiful</span></p><p><span style="font-family: Inconsolata;">Steps: 20, Sampler: DPM++ 2M Karras, CFG scale: 7, Seed: 3717791013, Size: 512x256, Model hash: 6ce0161689, Model: v1-5-pruned-emaonly, Version: v1.6.0-2-g4afaaf8a</span></p><p><span style="font-family: courier;">Time taken: <b>5 min. 45.9 sec.</b> on Nvidia MX550<br />A: 3.35 GB, R: 3.42 GB, Sys: 2.0/2 GB (100.0%)</span></p><div><div><p><br /></p></div></div>阿操http://www.blogger.com/profile/12449760480609795429noreply@blogger.com0tag:blogger.com,1999:blog-2385389280209790743.post-78239864010863693092023-11-09T06:15:00.000+08:002023-11-16T00:10:02.751+08:00將bash和zsh共用的設定放到~/.oshrc<p><span style="font-family: inherit;">Mac現在預設的終端機(Terminal)使用的login shell是<span style="color: #6fa8dc;">zsh</span>,另外安裝的iTerm2則是因為習慣而設定成<span style="color: #93c47d;">bash</span>如下圖顯示:</span></p><p></p><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjlCwxGFp0hJodgq-L0F5gghPUOLCAAyOMXc8RWz-ZDB1QpdFQGzpyrZLZOSPZH70TqpDxvUlnqWcqviEAUAFiiGbKrRMqxHVyGQkSlVP0y4Aas6qi2gABJaM2Iua9ZjJXn9smMoX7okx0RtKC_w5p7QPEpQvDhuhN33kN4vdgx6IPlf5JWU-FL0wNCAr7f/s1838/Screenshot%202023-11-13%20at%206.21.32%20AM.png" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="1238" data-original-width="1838" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjlCwxGFp0hJodgq-L0F5gghPUOLCAAyOMXc8RWz-ZDB1QpdFQGzpyrZLZOSPZH70TqpDxvUlnqWcqviEAUAFiiGbKrRMqxHVyGQkSlVP0y4Aas6qi2gABJaM2Iua9ZjJXn9smMoX7okx0RtKC_w5p7QPEpQvDhuhN33kN4vdgx6IPlf5JWU-FL0wNCAr7f/w400-h270/Screenshot%202023-11-13%20at%206.21.32%20AM.png" width="512" /></a></div><br /><span style="font-family: inherit;">同時使用zsh與bash會造成有些設定需要寫兩次很麻煩:</span><div><ul style="text-align: left;"><li>Terminal用的<span style="color: #6fa8dc;">zsh</span>設定放在 <span style="color: #6fa8dc; font-family: Roboto Mono;">$HOME/.zshrc</span></li><li>iTerm2用的<span style="color: #93c47d;">bash</span>設定放在 <span style="color: #93c47d; font-family: Roboto Mono;">$HOME/.bashrc</span></li><li>解決方案則是把zsh與bash共用的設定放在 <span style="color: #ffa400; font-family: Roboto Mono;">$HOME/.oshrc</span></li></ul><span style="font-family: inherit;"><span><a name='more'></a></span><br /></span><p></p><p>操作步驟如下:</p><p></p><ol style="text-align: left;"><li>在 <span style="color: #6fa8dc; font-family: "Roboto Mono";">$HOME/.zshrc</span> 加入一行:<br /><span style="font-family: courier;">[ -r "$HOME/.oshrc" ] && . "$HOME/.oshrc"</span></li><li>在 <span style="color: #93c47d; font-family: "Roboto Mono";">$HOME/.bashrc</span> 加入一行:<br /><span style="font-family: courier;">[ -r "$HOME/.oshrc" ] && . "$HOME/.oshrc"</span></li><li>在共用的設定檔加入需要設定,例如說:<br /><span style="font-family: courier;">alias ls='ls --color'<br />alias ll='ls -lF'<br />alias textedit='open -a TextEdit'<br />alias vscode='open -a Visual\ Studio\ Code'<br />alias sublime='open -a Sublime\ Text'<br />alias sudo='sudo '</span></li></ol><p></p><p><span style="font-family: inherit;"><br /></span></p><h2 style="text-align: left;"><span style="font-family: inherit;">參考資料</span></h2><p></p><ul style="text-align: left;"><li><a href="https://2formosa.blogspot.com/2019/10/sudo-with-alias.html" target="_blank">sudo的時候可用到alias的資訊</a></li><li><a href="https://2formosa.blogspot.com/2018/06/bash-test-in-one-line.html" target="_blank">Bash一行文:if-else變形</a></li><li><a href="https://2formosa.blogspot.com/2023/10/Choose-Editor-to-Open-Text-Files-on-Mac.html" target="_blank">Mac用open指令選擇編輯器開啟文字檔</a></li></ul><p></p><p><span style="font-family: inherit;">_EOF_</span></p></div>阿操http://www.blogger.com/profile/12449760480609795429noreply@blogger.com0tag:blogger.com,1999:blog-2385389280209790743.post-40077685036948108002023-11-02T22:23:00.008+08:002024-01-06T11:50:05.276+08:00Bash一行文:文本第一行不參與sort排序<p></p><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhpxOq3_BsD_kWOUW_6qNl8LEG5kr6YdBGVYpa0fWgiLdTbsKeXrnJEyOdcGheJelJ3p9L4YpFnxJJlJcWEsROHQJJhqDvfDtFd1t7w95BynWHXa-_N4S9DJxMCdEwjZAoRNVb8XUpENQRk_FQSufGK2J707SqLNO18iFTXe9MILRlQorm81L7LWnRnnhP2/s512/00006-4137951745.png" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="256" data-original-width="512" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhpxOq3_BsD_kWOUW_6qNl8LEG5kr6YdBGVYpa0fWgiLdTbsKeXrnJEyOdcGheJelJ3p9L4YpFnxJJlJcWEsROHQJJhqDvfDtFd1t7w95BynWHXa-_N4S9DJxMCdEwjZAoRNVb8XUpENQRk_FQSufGK2J707SqLNO18iFTXe9MILRlQorm81L7LWnRnnhP2/s16000/00006-4137951745.png" /></a></div><p></p><p><span style="font-family: inherit;">在處理文本資料,尤其是像csv格式的表格,第一列通常是表格每個欄位的標題(header),在排序的時候通常不會處理,但又會需要印出來看。例如說:</span></p><p></p><ol style="text-align: left;"><li><span style="font-family: Roboto Mono;">df -Th</span></li><li><span style="font-family: Roboto Mono;">df -Th | <span style="color: #6fa8dc;">awk 'NR<2{print $0;next}{print $0| "sort"}'</span></span></li><li><span style="font-family: Roboto Mono;">df -Th | <span style="color: #93c47d;">{ sed -u 1q; sort; }</span></span></li><li><span style="font-family: Roboto Mono;">df -Th | <span style="color: #93c47d;">(sed -u 1q; sort)</span></span></li></ol><p></p><p>第1個指令是印出目前系統上的掛載點與使用空間,2, 3, 4三個指令結果一樣,都是將<b>掛載點依照名稱排序</b>,但第一行的欄位不參與排序。每個指令的詳細說明如下:<span></span></p><a name='more'></a><p></p><p></p><ol style="text-align: left;"><li><span style="font-family: Roboto Mono;">df -Th</span>:參數T代表mount type,小寫h代表人讀得懂的格式<br /></li><li><span style="color: #6fa8dc; font-family: "Roboto Mono";">awk 'NR<2{print $0;next}{print $0| "sort"}'<br /></span>使用awk指令,在number of row (NR)小於2也就是第1行的時候印出來,剩下的內容則是印出後pipe到sort指令來做排序。awk的這個寫法比起後面的sed要容易懂</li><li><span style="color: #93c47d; font-family: Roboto Mono;">{ sed -u 1q; sort; }</span><br />使用sed指令,-u參數代表unbuffered,後面的結果直接塞給sort指令。1q則是代表印出第一行以後就跳開,讓剩下的東西給sort指令去處理</li><li><span style="color: #93c47d; font-family: Roboto Mono;">(sed -u 1q; sort)</span><br />跟範例3很像,但是使用小括號會產生subshell,比較吃資源</li></ol><p></p><p><span style="font-family: inherit;"><br /></span></p><p>最後整理一下習慣看掛載點的空間指令,根據不同的需求排序:</p><p></p><ul style="text-align: left;"><li><span style="font-family: Roboto Mono;">df -Th | grep -v "/run/user" | <span style="color: #93c47d;">{ sed -u 1q; sort; }</span></span></li><li><span style="font-family: Roboto Mono;">df -Th | grep -v "/run/user" | <span style="color: #93c47d;">{ sed -u 1q; sort -k2; }</span></span></li><li><span style="font-family: Roboto Mono;">df -Th | grep -v "/run/user" | <span style="color: #93c47d;">{ sed -u 1q; sort -k7; }</span></span></li></ul><div>可以把長長的指令用alias轉成一個短指令dfh</div><ul style="text-align: left;"><li><span style="font-family: Roboto Mono;">alias dfh='df -Th | grep -v "/run/user" | { sed -u 1q; sort -k7; }'</span></li><li><span style="font-family: Roboto Mono;">dfh</span></li></ul><p></p><p><span style="font-family: inherit;"><br /></span></p><h2 style="text-align: left;"><span style="font-family: inherit;">參考資料</span></h2><p></p><ul style="text-align: left;"><li><a href="https://stackoverflow.com/questions/14562423/is-there-a-way-to-ignore-header-lines-in-a-unix-sort" target="_blank">Is there a way to ignore header lines in a UNIX sort?</a></li><li><a href="https://unix.stackexchange.com/questions/104525/sort-based-on-the-third-column" target="_blank">Sort based on the third column</a></li></ul><p></p><p><span style="font-family: inherit;">_EOF_</span></p><p></p><span><div><span style="font-family: Bookman Old Style;">a birds eye view overlooking an ancient fantasy city surrounded by mountains and trees of greens and browns, rivers and lakes by Jordan Grimmer, Asher Brown Durand and Ryan Dening, 8k, artstation, beautiful color pallette</span></div><div><span style="font-family: Ubuntu Mono;">Steps: 20, Sampler: DPM++ 2M Karras, CFG scale: 7, Seed: <b>4137951745</b>, Size: 512x256, Model hash: 6ce0161689, Model: v1-5-pruned-emaonly, Version: v1.6.0-2-g4afaaf8a</span></div><div><span style="font-family: courier;">Time taken: 4 min. 3.6 sec.</span></div><div><span style="font-family: courier;">A: 3.36 GB, R: 3.68 GB, Sys: 2.0/2 GB (100.0%)</span></div></span><p></p>阿操http://www.blogger.com/profile/12449760480609795429noreply@blogger.com0