Marketing, SEO, Web trends, Programming tutorial, Web design, and Life event...
當 Volumes 容量不足時,可以直接在 Volumes 容量,
調整容量後,實際容量還不會增加,這時還必須再進行系統指令進行擴容
這裡分別說明針對分割區 及 檔案系統 進行擴容的方式:
提醒,再增加容量前,建議先建立快照
在開始前,先透過 lsblk
查看目前磁碟區,以及確認你要擴充的磁碟
接著檢查你磁碟的類型,例如:
sudo file -s /dev/xvda
接著,請針對磁碟的類型,進行對應的擴容方式
以下說明三種類型的擴充方法:
Continue ReadingHTTPS 超文本傳輸安全協定(HyperText Transfer Protocol Secure)是一種讓HTTP傳輸過程可透過 SSL/TLS 來對封包進行加密的安全傳輸協定,預設使用的是 443 port。
也就是在不安全的傳輸,額外建立安全機制。
在敏感及機密性的網路傳輸,都必須使用 HTTPS 避免身份及隱私被劫持。
Continue Reading在 Linux 維護專案時,有時遇到檔案權限問題,這裡說明如何一次處理的方式
例如,要將 /var/www/ 底下所有檔案及資料夾進行權限變更,作法如下:
一次修改資料夾權限為 755
find /var/www/ -type d -exec chmod 2775 {} \;
一次修改檔案權限為 644
find /var/www/ -type f -exec chmod 0664 {} \;
Continue Reading
Interface 類別主要用於定義一些關鍵字及 public 的抽象方法,不需要定義方法的 body 及參數。
<?php
interface Logger{
public function excute();
}
首先,針對未使用 Interface 的情況進行說明,
如果在大型專案只有使用 Class,例如以下範例,當我們要切換不同的 Log 方式時,就要透過手動方式在多處 constructor 處進行 hard-coded 變更,例如
<?php
class LogToDatabase {
public function execute($message)
{
var_dump('log the message to a database :'.$message);
}
}
class LogToFile {
public function execute($message)
{
var_dump('log the message to a file :'.$message);
}
}
class UsersController {
protected $logger;
public function __construct(LogToFile $logger)
{
$this->logger = $logger;
}
public function show()
{
$user = 'nahid';
$this->logger->execute($user);
}
}
$controller = new UsersController(new LogToFile);
$controller->show();
例如,目前在 UsersController 使用 LogToFile,
Continue Reading在 NAS 建立對外網站,通常會使用 proxy 方式來做轉導
本篇會預設你已經對於 Docker, NAS 有基礎的了解,並且知道如何在 NAS 新增 Docker 服務,以及設定網域指向的知識。
Continue ReadingSynology NAS 預設都會使用 80 port,且會轉導到 500x port
這裡將說明如何變更 80 port 。
變更 Synology 預設 80 port 的方式很簡單
首先 ssh 登入到 NAS
接著,修改 nginx 設定
vi /usr/syno/share/nginx/WWWService.mustache
vi /usr/syno/share/nginx/DSM.mustache
vi /usr/syno/share/nginx/server.mustache
接著 重啟服務
synoservicecfg --restart nginx
Continue Reading
在 GitLab 強制 push 到 master 時,
git push -f origin master
出現錯誤訊息:
remote: GitLab: You are not allowed to force push code to a protected branch on this project.
Continue ReadingLazyCollection 可以調用 Memy() ,能記取計算過的值,在運算大數據過程,能避免大量消耗內存的狀況。
範例:
<?php ...
$users = User::cursor()->remember();
// No query has been executed yet.
$users->take(5)->all();
// The query has been executed, and the first 5 users have been streamed from the DB.
$users->take(20)->all();
// The first 5 users came from the cache. The rest continued the stream from the DB.
afterLast 可以取得字串中,“最後一個”指定字符 之後的文字
beforeLast 可以取得字串中,“最後一個”指定字符 之前的文字
Continue Reading這裡記錄 Vue 初始設定會用到的一些基本設定
包括語法亮潔以及代碼自動風格化設定.
另外會提到如何在 VSCode settings.json 設定儲存自動將語法進行整理,風格化
Continue Reading在Terminal 使用vim 之後,若出現複製貼上會出現 00~, 01~ 或 0~, 1~
原因可能是你的Terminal 正處於bracketed黏貼模式( bracketed paste mode)
在一些尚未更新或較為老舊的terminal可能會出現00~ 01~ 的字段
解決方式是直接透過以下語法將 bracketed paste mode 關閉
printf "\e[?2004l"
ElasticSearch 可以把數據透過 Index 索引的方式來儲存。
通常,一台機器可以運行多個 ElasticSearch,每一個都視為一個節點(Node)。
在 ElasticSearch 主要結構與關聯資料庫做對比的話,關係大致如下:
ElasticSearch | 關聯資料庫 |
---|---|
索引(Index) | 資料庫(Database) |
類型(Type) | 資料表(Table) |
文檔(Document) | 數據行紀錄(Row) |
域(Field) | 數據列(Column) |
參數映射(Mapping) | 模式(Schema) |
在內部測試機測試瀏覽器錄音功能需要用到 Https,在這裡記錄如何在 localhost 環境安裝憑證及設定 https
Continue Reading透過 GCP Storage 儲存檔案,在前端呈現時出現了 CORS 問題
錯誤訊息: Access to fetch at url from origin url has been blocked by CORS policy: NO ‘Access-Control-Allow-Origin’ header is present on the requested resource. …
原因是在於,GCP Storage 為了預防惡意取用而預設不開啟。
這裡紀錄如何透過 Gsutil 開啟 GCP storage 跨域請求
Continue Reading在某些作業系統,Git 會忽略檔名或資料夾名稱大小寫。這樣的設定會造成在同專案若修改檔案或資料夾大小寫,在執行 ```git
針對這狀況有幾個建議做法
Continue Reading符號 | 解釋 |
---|---|
⌘ | Command |
⇧ | Shift |
⌃ | Control |
↩ | Enter/Return |
⌥ | Option / Alt |
在 Bitbucket 設定 ssh 如果沒有在帳號 ssh 綁定,而是直接在 repository 綁定
但是,直接綁定在 Repository 的 SSH key ,該組 Key 只能用於 pull ,不能執行 push。
在後續維護專案需要在帳號綁定 ssh 時,會出現以下警示
Someone has already registered that SSH key
Continue Reading在中国的 Zoom 软件安装后,会分别有国内及国外两种选项,在近期因中国国家安全政策,考量Zoom 软件对外沟通方面因为无法确定是谁对国外发起会议,因此进行屏蔽。针对这个变动,在第一时间进行处理,帮助排除问题的解决方式进行纪录
请检查相关装置的 Zoom 版本有高于以下版本: Windows 软件: 5.0.41687.0910 Apple 软件: 5.0.41687.0910 苹果 APP Store: 4.5.2 安卓: 4.5.3
可以点选 Windows > 控制面板 > 卸载程序 > 在软件滑鼠右键点击出现卸载弹窗 > 点击卸载
https://jingyan.baidu.com/article/5d368d1eb2270f3f60c057b0.html
首先,卸载本地的 Zoom 软件,前往官方下载最新软件。 下载安装 Zoom : https://www.zoomvip.cn/download.html
(1) 请家长提供 Zoom 软件登入会议的画面。 (2) 使用的装置型号,在提供给技术判断。 (3) 询问家长是否有其他装置可以先进入会议。
(1) 请家长提供 Zoom 软件登入会议的画面。 (2) 手机或平板请检查是否关到静音键。 (3) 桌机请开启扬声器设置,检查 Zoom 软件扬声器是否开启。 (4) 询问家长是否有其他装置可以先进入会议。
Continue Reading