關於網路那些事...

Marketing, SEO, Web trends, Programming tutorial, Web design, and Life event...

CentOS7 安裝 PyAudio 發生錯誤[解決]

CentOS7 安裝 PyAudio 發生錯誤[解決] 執行 pip install PyAudio 如果出現以下次錯誤 Collecting PyAudio Downloading https://files.pythonhosted.org/packages/ab/42/b4f04721c5c5bfc196ce156b3c768998ef8c0ae3654ed29ea5020c749a6b/PyAudio-0.2.11.tar.gz Building wheels for collected packages: PyAudio Building wheel for PyAudio (setup.py) ... error ERROR: Complete output from command /opt/rh/rh-python36/root/usr/bin/python3 -u -c 'import setuptools, tokenize;__file__='"'"'/tmp/pip-install-aqdgoicv/PyAudio/setup.

Continue Reading

CentOS7 安裝 Python3

CentOS7 安裝 Python3

在這裡紀錄如何在 CentOS7 安裝 Python3 ,主要透過 Software Collections(SCL)來安裝 python3

vim  /etc/yum.repos.d/CentOS-Base.repo

尋找 extras

Continue Reading

Command line 快捷鍵

Command Editing Shortcuts Ctrl + a – go to the start of the command line Ctrl + e – go to the end of the command line Ctrl + k – delete from cursor to the end of the command line Ctrl + u – delete from cursor to the start of the command line Ctrl + w – delete from cursor to start of word (i.

Continue Reading

Golang - Gin router 基本介紹

Go - Gin router 基本介紹

這裡針對 Gin routers 進行基本介紹,後續會針對個部分進行探討。

Gin 基本的一個架構如下方代碼:

Continue Reading

Golang - Go Module 套件管理 & 初始化及安裝 gin

Go - go module 初始化及安裝 gin

Gin 是一個 Golang 網頁架構,具有相當好的效能,高於 httprouter 40 倍的速度,是一個兼具效能與實用的架構。

這裡首先會針對 go module 初始化 如何透過 Go Module 管理套件,以及說明如何透過 Go Module 安裝 gin 的流程。

Continue Reading

AWS 與 Google 語音辨識費用比較

AWS 與 Google 語音辨識費用比較 這裡找了一下 AWS 跟 Google 語音辨識的計費比較. 目前評估兩家換算的金額都很接近, 如果使用一次單字平台測驗,其中包括單字加上老師補充單字 以每次使用 30次及 60 次口說題,大致會花費 $NT 6~11 塊 AWS Google 產品名稱 Transcribe speech-to-text 網址 https://aws.

Continue Reading

Mac Install Vim 外掛 - NERDTree

Mac Install NERDTree 安裝 pathogen.vim mkdir ~/.vim/autoload mkdir ~/.vim/bundle curl -LSso ~/.vim/autoload/pathogen.vim https://tpo.pe/pathogen.vim 開啟 vim ~/.vimrc 加入 execute pathogen#infect() 安裝 NEDRTree cd ~/.vim/bundle git clone https://github.com/scrooloose/nerdtree.git 可以先試著開啟 vim 並且輸入 :NERDTree

Continue Reading

在 CentOS7 安裝 Protocol Buffer

這裡記錄在 CentOS7 安裝 Protocol Buffer 流程 sudo yum install autoconf automake libtool unzip gcc-c++ -y git clone https://github.com/google/protobuf.git cd protobuf ./autogen.sh ./configure make make install protoc --version

Continue Reading

Failed to decode response: zlib_decode(): data error 解法

Failed to decode response: zlib_decode(): data error 解法 composer clear-cache 把下方這段加到 composer.json "repositories": [ { "type": "composer", "url": "https://packagist.org" }, { "packagist": false } ], 執行

Continue Reading

Golang 技術方向紀錄

簡記一些學習 Go 的技術方向 Web Framework Gin https://github.com/gin-gonic/gin Echo https://echo.labstack.com/guide BeeGo https://beego.me/ Gin Websocket https://github.com/gin-gonic/gin/issues/1305 example: https://github.com/gin-gonic/gin/issues/1305 go module 類似 php vender 動套件管理工具: 透過 go mod init 會產生 go.mod Drone CI/CD 透過 Drone 來實現 Go CI/CD https://drone.

Continue Reading

DDoS/Dos 之 SYN 攻擊

DDoS/Dos 之 SYN 攻擊 DDoS/Dos 攻擊通常可以用不同模式來達成,這裡介紹其中常見的 SYN 攻擊 SYN 攻擊 主機資源在 Client 端訪問時,通常會透過三次交握來溝通。主機第一次收到 Client 的 SYN 請求,會先處於 SYN_RCVD 的半連結狀態,並且發送封包給 Client 端進行第二次交握,Client 收到確認後,第三次才會正式攜帶參數及資料與主機溝通。而如果攻擊方透過 Client 端發送大量的偽造 IP 發送 SYN 封包給主機,每一個封包都會建立一個等待 Client 回覆確認,由於是偽造IP,因此 Server 端會持續的重複嘗試與 Client 溝通,直到主機設定的超時時間抵達才終止程序。當主機存在大量的半連結狀態連結時,並且這些連結都是隨機IP形式存在,超過主機可負荷的量就會讓主機掛掉。

Continue Reading

解決:Yum 執行發生 Error: rpmdb open failed 錯誤

解決:Yum 執行發生 Error: rpmdb open failed 錯誤

在一次執行 yum 相關指令時,會爆出 Error: rpmdb open failed 錯誤 錯誤的原因是過去執行 yum install 或 update 過程中,可能有不正常中斷的情況發生,導致rpm 資料庫毀損。

Continue Reading

EC2 安裝 composer

EC2 安裝 composer 這裡記錄如何在 AWS EC2 安裝 composer cd ~ sudo curl -sS https://getcomposer.org/installer | sudo php sudo mv composer.phar /usr/local/bin/composer sudo ln -s /usr/local/bin/composer /usr/bin/composer sudo componstall composer -v

Continue Reading

解決 xxx Packages excluded due to repository priority protections

解決 xxx Packages excluded due to repository priority protections 在 EC2 進行 PHP 升級過程中,發生 xxx Packages excluded due to repository priority protections 此狀況發生原因是,啟用了 priorities ,讓 plugin 安裝會選擇高優先權的 packages 解決方式,可直接開啟 priorities.conf 將設定關閉即可

Continue Reading

GCP 輪動更新流程

GCP 輪動更新流程

這裡記錄一下在 GCP 如何進行輪動更新的流程:

建立映像檔

  1. Computer Engine > 映像檔 > 建立映像檔
  2. 輸入“名稱”、選取”來源“選項點選磁碟,以及“來源磁碟”選取實例
  3. 勾選讓執行個體繼續執行
  4. 輸入 “系列”、“說明”
  5. 點選建立

Continue Reading

Vimeo / 403 Forbidden 解決方式

Vimeo / 403 Forbidden 解決方式

在過去學習系統的影片為了避免被濫用,緊急情況下採用了 Vimeo 上架我們的線上學習影片,好處是可以直接針對影片設定允許IP及網域。

但最近前線反應在 Vimeo 上傳影片後,無法從後台同步回來。

後台檢查發現有 403 的錯誤,描述如下:

Continue Reading

Golang 入門教學 tutorial

Golang - 語言基礎 Slice

Golang 入門教學 tutorial

Go 是現代化、速度相當快且擁有豐富的標準庫 透過 goroutine 併發非常有效率,單一線程可以執行多個 goroutine。 在設計併發架構最困難的部分在於如何確保多個併發進程、線程及groutine 不會同時針對同一資料進行操作。透過 Go 可以簡單地實現併發過程數據一致性。 Go 提倡組合(composition),而不是傳統繼承方式;因此,可直接多個類型組合成類型,並且引用這個類型就能使用整個組合的功能。 Go 在內存管理也處理得相當好,使用現代化的回收機制。

Continue Reading

Go - Hello world

首先,建立第一個 Hello world

建立資料夾 hello-go/

mkdir hello-go

cd hello-go

Continue Reading

Go - CentOS 安裝 golang

這裡指令皆使用 root 身分執行,若其他身分請使用 sudo

安裝環境為 CentOS 7 以上版本

這裡會介紹兩種安裝方式,第一種較為簡單,是直接透過 yum 安裝,另一種方式是直接下載安裝(推薦)

方法一、直接使用 yum 安裝

yum 安裝方式

# yum install golang

Continue Reading

SSH 限制用戶訪問指定目錄指令

SSH 限制用戶訪問指定目錄指令

以下指令都是以 root 身分執行,其他用戶請加上 sudo

在Linux 設定用戶,並且開放 ssh 連線後,有時為了系統安全,需限制用戶僅能訪問指定目錄及指令

可以透過 chrooted 來進行設定

Continue Reading