分類
好用軟體

如何利用vi快速刪除所有文字檔案內容?

在 linux 下最常用, 最好用, 最快速的文字編輯器是 vi, 不過要如何快速地將所有檔案內容刪除呢?

大家應該都知道指令 dd, 就是刪去一行, 刪去全部行則為先進入指令模式, 並下達 :1,$d 即可, 說明如下:

: 指令

1,$ 為指定行, 由 1 到 $ (指最後一行)

d 指令為刪除

所以若是要保留前 3行與最後 2行, 可以使用指令 :4,$-2d 即可.

參考資料:

https://unix.stackexchange.com/questions/161821/how-can-i-delete-all-lines-in-a-file-using-vi

Spotify Premium Family小小漲價了-不過有回饋一個月耶

收到了這封 mail:

你好:

 

自 2021 年 4 月 30 日起,我們將調漲 Premium Family 的價格,以便持續為你帶來全新內容與功能,如此一來,無論你是自己使用,或與家人一同使用,都能享受其中的便利*。

Premium Family 的價格將由每月 NT$240.00 調整至每月 NT$268.00。由於你已是 Premium Family 訂閱者,因此能以現有價格額外再使用 1 個月的服務**。 也就是說,新價格在 6 月的收費日期才會生效。
感謝你持續使用 Premium。

 

Spotify 團隊

原來是 Spotify Premium Family 漲價, 由於原來就是用家庭方案的 240元每月, 也就漲到了 268元每月, 不過官網上還沒有更新, 可以參考這裡: https://www.spotify.com/tw/premium/#plans

這次漲幅不算大約 11.67%, 但 Spotify 的服務真的很棒. (倒是不知個人版本有沒有漲到..)

分類
程式技術

因為url過長而導致破版的調整方式

由於在現行 css 預設結構下, url 不會主動斷行, 也就是有時過長的 url 會導致破版或出版的狀況.

如何解決這個問題, 可以利用 css 的手法來調整, 利用以下參數:

.dont-break-out {

  /* These are technically the same, but use both */
  overflow-wrap: break-word;
  word-wrap: break-word;

  -ms-word-break: break-all;
  /* This is the dangerous one in WebKit, as it breaks things wherever */
  word-break: break-all;
  /* Instead use this non-standard one: */
  word-break: break-word;

  /* Adds a hyphen where the word breaks, if supported (No Blink) */
  -ms-hyphens: auto;
  -moz-hyphens: auto;
  -webkit-hyphens: auto;
  hyphens: auto;

}

參考資料: https://css-tricks.com/snippets/css/prevent-long-urls-from-breaking-out-of-container/

分類
好用軟體

CapRover – 快速建立開發環境的 opensource PaaS

在架構系統時, 尤其現在有許多 opensource 程式架構, 可以很方便快速地部署環境, 不過若想要更容易、更方便一些, 可以參考這個架構 – CapRover: https://caprover.com/

基於快速建立開發環境與管理, 使用 CapRover 這個 PaaS 架構是十分方便好用的, 官網上寫著:

CapRover is an extremely easy to use app/database deployment & web server manager for your NodeJS, Python, PHP, ASP.NET, Ruby, MySQL, MongoDB, Postgres, WordPress (and etc…) applications!

而對於一個開發者來說:

  1. A developer who does not like spending hours and days setting up a server, build tools, sending code to server, build it, get an SSL certificate, install it, update nginx over and over again.
  2. A developer who uses expensive services like Heroku, Microsoft Azure and etc. And is interested in reducing their cost by 4x (Heroku charges 25$/month for their 1gb instance, the same server is 5$ on DigitalOcean!!)
  3. A developer who prefers to write more of showResults(getUserList()) and not much of apt-get install libstdc++6 > /dev/null
  4. A developer who enjoys a platform where installing MySQL, MongoDB and etc on their server is done by selecting from a dropdown and clicking on install!
  5. A developer who likes to enjoy the power of Docker and nginx without having to learn them or deal with their settings scripts to make things work!!
  6. A developer who knows Docker and nginx inside out, and enjoys a platform where basic operations are done, yet allowing them to customize any specific settings if they need to

以上的情境都是適合用這個 CapRover 來達成的測試與開發環境的建置的, 不需要花太多時間管理與維護, 隨時可以打開與關閉這些環境.

來看看介紹的影片:

(引用自: https://www.youtube.com/watch?v=VPHEXPfsvyQ)

很不錯吧, 快來試看看囉:

https://caprover.com/docs/get-started.html

分類
好用軟體

更輕量的CMS

在找看有沒有更輕量的CMS時, 發現有完全不用資料庫型態的CMS, 目前試了兩個:

其中 pico cms 還不是 html 而是使用了 md (markdown) 的靜態檔案的內容上架方式, 沒有管理介面.

而 WonderCMS 則是有管理介面, 可以做 page / blog post 型態的內容管理.

基本上這兩組 CMS 都不依賴資料庫, 訴求為快速又方便地做內容管理, 除了程式很小外, 也都有 theme / plugin 可供安裝擴充使用.