<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/"><channel><title>Linux on Lin's Blog</title><link>http://coder.tw/tags/linux/</link><description>Recent content in Linux on Lin's Blog</description><generator>Hugo</generator><language>zh-tw</language><lastBuildDate>Sat, 16 Jun 2018 01:12:08 +0000</lastBuildDate><atom:link href="http://coder.tw/tags/linux/index.xml" rel="self" type="application/rss+xml"/><item><title>Why Python No Output With Tee</title><link>http://coder.tw/posts/why-python-no-output-with-tee/</link><pubDate>Sat, 16 Jun 2018 01:12:08 +0000</pubDate><guid>http://coder.tw/posts/why-python-no-output-with-tee/</guid><description>&lt;p&gt;最近用 Python 寫了個 Slack Bot，因為偷懶所以我把 log 訊息直接 print 出來後用 tee 指令存到檔案裡，這樣就可以同時在 console 看到運作的資訊，又能將這些資訊保留到檔案裡，不過在用 Python print() 搭配 tee 時我卻發現我指定的 log File 常常沒有內容，或是該出現的訊息很晚才出現，研究後才知道原來 Python 的 print 函式會判斷輸出的環境，如果是輸出到 Shell 的話會立刻輸出，但如果不是輸出到 Shell 則會先存在 Buffer，等緩衝區滿了再一次輸出，當你把 Python 搭配 tee 使用時就會遇到緩衝區的問題，導致預期的輸出沒有及時出現在螢幕和檔案中。&lt;/p&gt;</description></item><item><title>bash: warning: setlocale: LC_ALL: cannot change locale</title><link>http://coder.tw/posts/bash-warning-setlocale-lc_all-cannot-change-locale/</link><pubDate>Wed, 22 Feb 2017 10:01:41 +0000</pubDate><guid>http://coder.tw/posts/bash-warning-setlocale-lc_all-cannot-change-locale/</guid><description>&lt;p&gt;用 SSH 登入遠端伺服器時，看到「-bash: warning: setlocale: LC_ALL: cannot change locale」的錯誤訊息嗎？ 會遇到它是因為 SSH 連線上遠端主機時，會自動將本機的 LC_* 變數（locale）傳送一份到遠端主機，如果伺服器上不支援你指定的語系，就會出現「-bash: warning: setlocale: LC_ALL: cannot change locale」錯誤啦！&lt;/p&gt;</description></item><item><title>當 GitLab 誤刪資料庫，我們該如何管好 rm 指令？</title><link>http://coder.tw/posts/gitlab-deleted-database-rm-command/</link><pubDate>Wed, 01 Feb 2017 23:58:28 +0000</pubDate><guid>http://coder.tw/posts/gitlab-deleted-database-rm-command/</guid><description>&lt;p&gt;不小心把根目錄刪除這種慘劇，我們從小都當笑話聽，但可千萬別以為這只是個笑話！ 光小弟自己就看過無數朋友的電腦發生這種慘劇，而今天 GitLab （類似 Github 的服務）的工程師也親身示範了 rm -rf 指令的莫大威力&amp;hellip;&amp;hellip; 他們把 Production Server 的 Database 砍掉了&amp;hellip;&amp;hellip; 過去一直覺得這種慘劇不會發生在自己身上，但現在連 GitLab 這種有上萬人在用的服務，都因為大意而發生這種事情，也讓我研究了一下該如何避免，這邊就來聊聊我們該如何把 rm 指令管好吧！&lt;/p&gt;</description></item><item><title>Generate Large File on Linux/macOS</title><link>http://coder.tw/posts/generate-large-file-on-linuxmacos/</link><pubDate>Fri, 27 Jan 2017 23:59:59 +0000</pubDate><guid>http://coder.tw/posts/generate-large-file-on-linuxmacos/</guid><description>&lt;p&gt;有時候為了測試網路速度、硬碟讀寫，或是程式的運作效能等等，我們會需要產生指定大小的檔案作為測試之用，這時大家肯定腦海都浮現出 dd 這傢伙對吧！ 但使用 dd 產生檔案時，是否覺得很慢呢？ 此外你知道除了 dd 之外，還有 truncate、fallocate 這兩個傢伙可以使用嗎？ 這邊會簡單說明如果要產生大檔案，你有哪些方法可以使用、如何使用，以及他們之間的差異。要特別注意，這邊產生的檔案其內容都是無意義的。&lt;/p&gt;</description></item><item><title>如何在 Terminal 計算指令執行的時間？</title><link>http://coder.tw/posts/time-command-execution-in-terminal/</link><pubDate>Fri, 27 Jan 2017 23:58:26 +0000</pubDate><guid>http://coder.tw/posts/time-command-execution-in-terminal/</guid><description>&lt;p&gt;你有想過幫你在 Terminal 執行的指令計算執行時間嗎？ 前陣子因為工作上的需求，用各種指令兜了一個檔案分類工具出來，但因為對效能有嚴格的要求，需要在指定時間內完成，所以查到 time 這個好用的指令可以幫我們計算指令的執行時間。&lt;/p&gt;</description></item><item><title>Linux Grep Tips - 搜尋有指定字串的列</title><link>http://coder.tw/posts/linux-grep-tips/</link><pubDate>Fri, 20 Jan 2017 18:32:31 +0000</pubDate><guid>http://coder.tw/posts/linux-grep-tips/</guid><description>&lt;p&gt;在 Linux 裡面有時我們會需要從檔案中快速的搜尋帶有關鍵字的「列」，例如在看 log 時可能會想找出某個時間發生的錯誤，打開檔案一行行找實在不怎麼經濟實惠，這時你就會需要 grep 的幫助啦！&lt;/p&gt;</description></item><item><title>如何確認我的 Crontab 正常運作？</title><link>http://coder.tw/posts/check-crontab-working/</link><pubDate>Fri, 20 Jan 2017 18:16:15 +0000</pubDate><guid>http://coder.tw/posts/check-crontab-working/</guid><description>&lt;p&gt;不知道大家是否都有同樣的煩惱？ 剛學會 crontab 時，始終不確定自己的設定是否正確，每次設定完都不確定是否有照預期的跑，在這我分享兩招可以讓大家確定自己的 crontab 是否正確設定！&lt;/p&gt;</description></item><item><title>手動編譯、安裝PHP Extension （Linux）</title><link>http://coder.tw/posts/compile-install-php-extension-linux/</link><pubDate>Thu, 26 Jan 2012 16:53:57 +0000</pubDate><guid>http://coder.tw/posts/compile-install-php-extension-linux/</guid><description>&lt;p&gt;如果要幫PHP安裝Extension的話要怎麼做呢？很多人都會回答Pecl，這的確是一個很方便的安裝Extension的方式，不過如果你的Server上面沒有Pecl怎麼辦呢？ 然後又因為某些原因不能安裝Pecl，這時候你就只好手動去編譯、安裝囉～ 而這篇文章也就是要教大家如何手動編譯PHP Extension在Linux上面&lt;/p&gt;</description></item><item><title>Mongodb 文件式的NoSQL系統 ＆ Windows、Linux安裝教學</title><link>http://coder.tw/posts/mongodb-nosql-install-windows-linux/</link><pubDate>Tue, 24 Jan 2012 14:26:45 +0000</pubDate><guid>http://coder.tw/posts/mongodb-nosql-install-windows-linux/</guid><description>&lt;p&gt;前一陣子因為Ben大的指導，所以踏進了我一直很有興趣可是都沒有實際常試過的NoSQL世界，而我接觸到的第一個NoSQL System（也是目前唯一會的）就是Mongodb，原本看了很多介紹NoSQL的文章，我還以為NoSQL跟一般的SQL差很多，實際接觸Mongodb之後才發現其實兩者很像，只是在原理上有點不同，還有效能更好，不過鄉對應的，有些SQL可以做到的事情，NoSQL就不能達到，這部份就要看大家的取捨、需求，NoSQL的部份不是這篇文章要講的，這篇文章要講的是介紹Mongodb還有教大家怎麼安裝在Windows上面&lt;/p&gt;</description></item><item><title>如何在Linux裡面手動安裝Python並且避免yum不能運作的問題</title><link>http://coder.tw/posts/linux-install-python-manually-keep-yum/</link><pubDate>Fri, 19 Aug 2011 08:00:45 +0000</pubDate><guid>http://coder.tw/posts/linux-install-python-manually-keep-yum/</guid><description>&lt;p&gt;之前曾經寫過一個程式可以自動備份Linux裡的重要資料並且上傳到Google Storage，當時用的語言是Python 2.7，但是Linux裡面內建的Python是2.4，而且就算你用yum去進行升級，最高也只會到2.4，這時候你如果想要安裝更新版的Python就只能自行編譯了，下面將用Python 3.2進行教學&lt;/p&gt;</description></item><item><title>如何修改SSH預設的22連接埠改走其他Port？</title><link>http://coder.tw/posts/change-ssh-default-port-22/</link><pubDate>Sat, 16 Apr 2011 10:56:20 +0000</pubDate><guid>http://coder.tw/posts/change-ssh-default-port-22/</guid><description>&lt;p style="text-align: center;"&gt;&lt;a href="https://pub-6c026d2742d14927bfa2d850c31eac91.r2.dev/wp-content/uploads/2011/04/2011-04-16_105528.jpg"&gt;&lt;img class="size-large wp-image-5027 aligncenter" title="2011-04-16_105528" src="https://pub-6c026d2742d14927bfa2d850c31eac91.r2.dev/wp-content/uploads/2011/04/2011-04-16_105528-520x437.jpg" alt="" width="520" height="437" /&gt;&lt;/a&gt;▲▲透過SSH，可以遠端幫主機進行很多工作&lt;/p&gt;
SSH幾乎是所有Linux系統都會內建的程式了，因為他可以讓你很方便的去連線、管理你的主機，只要連線到SSH就能對你的Server進行很多工作，但也因為這樣，SSH很有可能被人攻擊，預設的SSH Port都是22，只要別人猜到你的密碼，那你的Server就會變得很危險，因此這裡要教大家做第二層的防護，也就是修改掉預設的Port，這樣子別人在攻擊時除了要知道密碼，還必須知道你走哪個連接埠</description></item><item><title>【Linux】如何修改使用者密碼（適用iOS系統修改SSH密碼）</title><link>http://coder.tw/posts/linux-change-user-password/</link><pubDate>Fri, 18 Mar 2011 15:59:06 +0000</pubDate><guid>http://coder.tw/posts/linux-change-user-password/</guid><description>&lt;p&gt;&lt;a href="https://pub-6c026d2742d14927bfa2d850c31eac91.r2.dev/wp-content/uploads/2011/03/2011-03-18_160128.jpg"&gt;&lt;img class="size-large wp-image-4913 aligncenter" title="2011-03-18_160128" src="https://pub-6c026d2742d14927bfa2d850c31eac91.r2.dev/wp-content/uploads/2011/03/2011-03-18_160128-520x395.jpg" alt="" width="520" height="395" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;在Linux系統裡面為了安全性問題，我們一定要幫每個帳戶都設下一道密碼，使用者必須持有正確的密碼才能登入系統，而再這篇文章中就是要教大家在管理Linux類的主機、VPS時如何修改帳戶密碼，另外這個方法同樣可以應用在JB之後的iPad、iPhone等使用iOS的系統上，因為iOS預設的密碼是Alpine，如果你沒有去修改然後你的iOS裝置又有JB，那就有可能被別人攻擊&lt;/p&gt;
&lt;h2&gt;</description></item><item><title>【VPS】什麼是VPS? 使用VPS有什麼好處嘛?</title><link>http://coder.tw/posts/what-is-vps-benefits/</link><pubDate>Sat, 05 Feb 2011 09:00:59 +0000</pubDate><guid>http://coder.tw/posts/what-is-vps-benefits/</guid><description>&lt;p style="text-align: center;"&gt;&lt;a href="https://pub-6c026d2742d14927bfa2d850c31eac91.r2.dev/wp-content/uploads/2011/01/2011-01-30_140229.jpg"&gt;&lt;img class="size-large wp-image-4535 aligncenter" title="2011-01-30_140229" src="https://pub-6c026d2742d14927bfa2d850c31eac91.r2.dev/wp-content/uploads/2011/01/2011-01-30_140229-520x391.jpg" alt="" width="520" height="391" /&gt;&lt;/a&gt;&lt;/p&gt;
如果各位大大們常看本站的【關於本站】頁面，或是有在看小弟的Plurk、Facebook那就應該知道本站最近也換用VPS了吧～ 其實換VPS到這篇文章出現已經有3週左右了，沒有在換VPS的那天就寫文章跟大家介紹VPS是因為那時快要段考了，所以時間上來不及，段考結束之後我又去北商上課，就一直給他拖到現在才有時間寫文章0.0</description></item><item><title>OpenOffice 免費開源的辦公室應用軟體,文書處理、簡報、試算表通通都有～</title><link>http://coder.tw/posts/openoffice-free-office-suite/</link><pubDate>Thu, 23 Dec 2010 09:00:52 +0000</pubDate><guid>http://coder.tw/posts/openoffice-free-office-suite/</guid><description>&lt;p style="text-align: center;"&gt;&lt;a href="https://pub-6c026d2742d14927bfa2d850c31eac91.r2.dev/wp-content/uploads/2010/12/2010-12-22_213203.jpg"&gt;&lt;img class="size-large wp-image-4290 aligncenter" title="2010-12-22_213203" src="https://pub-6c026d2742d14927bfa2d850c31eac91.r2.dev/wp-content/uploads/2010/12/2010-12-22_213203-520x304.jpg" alt="" width="520" height="304" /&gt;&lt;/a&gt;&lt;/p&gt;
你知道嗎? 其實這世界上不是只有Microsoft office一套軟體可以進行文書處理的工作,還有很多軟體也可以達到一樣的功能,而OpenOffice則是其中的翹楚,OpenOffice他跟Microsoft office功能幾乎一樣,可以幫你進行文書處理、簡報、試算表、資料庫等等的工作,最重要的是他是免費的軟體,除此之外它還支援擴充功能,可以安裝一些外掛程式讓它功能變的更多更符合自己需求</description></item><item><title>【Ubuntu】ADSL(PPPoE)上網教學 - pppoeconf</title><link>http://coder.tw/posts/ubuntu-adsl-pppoe-pppoeconf/</link><pubDate>Wed, 15 Dec 2010 08:00:40 +0000</pubDate><guid>http://coder.tw/posts/ubuntu-adsl-pppoe-pppoeconf/</guid><description>&lt;p style="text-align: center;"&gt;&lt;a href="https://pub-6c026d2742d14927bfa2d850c31eac91.r2.dev/wp-content/uploads/2010/12/2010-12-13_231404.jpg"&gt;&lt;img class="size-full wp-image-4199 aligncenter" title="2010-12-13_231404" src="https://pub-6c026d2742d14927bfa2d850c31eac91.r2.dev/wp-content/uploads/2010/12/2010-12-13_231404.jpg" alt="" width="402" height="330" /&gt;&lt;/a&gt;&lt;/p&gt;
幾乎現在一般人的家裡都是使用PPPoE這種連線方式,如果你家是去申請ADSL,或是你家要透過一台數據機才能上網的話那你都需要先設定PPPoE才能讓Ubuntu連上網路,如果沒記錯的話之前的Ubuntu要設定PPPoE十分麻煩,可是最近又回鍋Ubuntu 10.04,才發現新一代的Ubuntu已經有pppoeconf這個命令可以快速設定PPPoE了
&lt;p&gt;補充：聽說其實pppoeconf的方式還是很慢,有更快的方式orz&amp;hellip;&amp;hellip; 不過跟我之前用得版本起來ppoeconf算蠻快了XD&lt;/p&gt;</description></item><item><title>Ubuntu 10.10 安裝教學(新版介面的安裝教學)</title><link>http://coder.tw/posts/ubuntu-10-10-shotwell-fast-boot/</link><pubDate>Fri, 26 Nov 2010 22:54:10 +0000</pubDate><guid>http://coder.tw/posts/ubuntu-10-10-shotwell-fast-boot/</guid><description>&lt;p style="text-align: center;"&gt;&lt;a href="https://pub-6c026d2742d14927bfa2d850c31eac91.r2.dev/wp-content/uploads/2010/11/2010-11-13-19-21-56.jpg"&gt;&lt;img class="alignnone size-large wp-image-4024" title="2010-11-13-19-21-56" src="https://pub-6c026d2742d14927bfa2d850c31eac91.r2.dev/wp-content/uploads/2010/11/2010-11-13-19-21-56-520x292.jpg" alt="" width="520" height="292" /&gt;&lt;/a&gt;&lt;/p&gt;
這次&lt;strong&gt;&lt;a href="http://www.ubuntu-tw.org/"&gt;ubuntu 10.10&lt;/a&gt;&lt;/strong&gt;的更新沒有增加什麼新功能,主要是把之前10.4版的一些問題修補好,還有把美工軟體換成Shotwell,除此之外沒有看到什麼功能的增加,還有不知道是哪一版開始好像安裝介面有改了,所以在這篇文章中會把安裝也教一次,比較讓我讚賞的是這次Ubuntu 10.10有幫我自動下載語言包還有需要用的程式,不用等我安裝完在去下載,可是這樣做的壞處就是安裝時間會變很長
&lt;h2&gt;</description></item></channel></rss>