Github Security Alert
最近信箱會出現來自 Github 的信件 Github 現在會檢查你的專案中是否有用到有漏洞的套件版本,如果都沒有處理的話,還會一天來一封… 這只是個測試用專案,好像應該來處理一下,不然那信件有點煩人。 ...
最近信箱會出現來自 Github 的信件 Github 現在會檢查你的專案中是否有用到有漏洞的套件版本,如果都沒有處理的話,還會一天來一封… 這只是個測試用專案,好像應該來處理一下,不然那信件有點煩人。 ...
增加 source list debian testing (buster, 10) 要選擇 bionic 版本, 避免套件相依問題 1 echo "deb https://download.virtualbox.org/virtualbox/debian bionic contrib" | sudo tee /etc/apt/sources.list.d/virtualbox.list 增加 apt key 1 2 wget -q https://www.virtualbox.org/download/oracle_vbox_2016.asc -O- | sudo apt-key add - wget -q https://www.virtualbox.org/download/oracle_vbox.asc -O- | sudo apt-key add - 安裝 Virtualbox 1 2 sudo apt update sudo apt install virtualbox-5.2 ps. Virtualbox 6.0 在 2018/12/18 發佈了 ...
SSD 優化的幾個要點 啟用 SSD 的 Trim 功能 減少非必要的寫入動作 掛載暫存資料夾到 Ram 上 啟用排程 Trim 1 2 $ sudo systemctl enable fstrim.timer Created symlink /etc/systemd/system/timers.target.wants/fstrim.timer → /lib/systemd/system/fstrim.timer. ps. 不建議使用 /etc/fstab 的 discard 選項 增加 Mount Options 修改前備份 fstab ...
每台機器都會有一些自己唯一的 id 在開發程式中,可能會有需要用來分辨機器 machine-id 1 2 3 $ cat /etc/machine-id $ cat /var/lib/dbus/machine-id product_uuid 1 $ sudo cat /sys/class/dmi/id/product_uuid MAC address 1 $ ip link Hard Disk UUID 1 2 3 $ blkid $ ls -l /dev/disk/by-uuid random UUID 1 2 3 $ cat /proc/sys/kernel/random/uuid $ uuidgen Reference https://www.thegeekdiary.com/centos-rhel-7-how-to-change-the-machine-id/ http://0pointer.de/blog/projects/ids.html https://liquidat.wordpress.com/2013/03/13/uuids-and-linux-everything-you-ever-need-to-know/ ...
入手 ThinkPad X1c 來當工作機 在使用了幾天不習慣的 windows 10 確定機器沒有什麼問題之後, 就把 OS 換成 Debian 了 安裝 Debian 之前 更新 BIOS 到目前最新的版本 1.34 調整以下的設定: Security -> Secure Boot - Set to “Disabled” Config -> Power -> Sleep State - Set to “Linux” Config -> Thunderbolt BIOS Assist Mode - Set to “Enabled” 安裝 Debian Linux Distribute: Debian testing ...
記錄一下目前會用的 Extensions Gnome Shell Extensions 網址: https://extensions.gnome.org/ 增加操作性 Top Panel Workspace Scroll https://extensions.gnome.org/extension/701/top-panel-workspace-scroll/ 外觀調整 User Themes https://extensions.gnome.org/extension/19/user-themes/ Hide Activities Button https://extensions.gnome.org/extension/744/hide-activities-button/ Panel OSD https://extensions.gnome.org/extension/708/panel-osd/ Remove Dropdown Arrows https://extensions.gnome.org/extension/800/remove-dropdown-arrows/ 實用功能 Caffeine https://extensions.gnome.org/extension/517/caffeine/ Lock Keys https://extensions.gnome.org/extension/36/lock-keys/ Extensions https://extensions.gnome.org/extension/1036/extensions/ Suspend Button https://extensions.gnome.org/extension/826/suspend-button/ Night Light Slider https://extensions.gnome.org/extension/1276/night-light-slider/ Clipboard Indicator https://extensions.gnome.org/extension/779/clipboard-indicator/ OpenWeather https://extensions.gnome.org/extension/750/openweather/
Go 原生的 Error Type 先認識 go 的 error interface 1 2 3 type error interface { Error() string } 只要 struct 實作 Error() 方法,就會是 error type,例如 os package 裡面的 PathError https://golang.org/pkg/os/#PathError 1 2 3 4 5 6 7 8 // PathError records an error and the operation and file path that caused it. type PathError struct { Op string Path string Err error } func (e *PathError) Error() string { return e.Op + " " + e.Path + ": " + e.Err.Error() } 建立自己程式裡的 Error struct 依照使用情境 error strcut ...
語言/框架: 前端: react/redux/Semantic UI React 設計元件,不再是過去設計模版的方式 後端: php/lumen, golang/echo php 快速開發 go 效能優秀,善於處理並發工作 編輯器 vim: 工程師最好的伙伴 vscode: 第三方套件對 javascript 有很完整的支援 開發環境 vagrant: 用配置檔來管理虛擬機器 docker: 輕量化,快速啟動服務 測試工具 postman: 方便測試 RESTful API 工作管理 gitlab: 有 private repo,可以考慮自行架設的 git service trello: 把工作項目放到看板上,更容易看清工作的全樣 文件 hackmd: 共筆用 draw.io: 畫流程圖很好用 evernote: 個人筆記,有跨平台,可以在手機上做筆記 imgur: 上傳圖檔用 Summary 整理完有一種在寫履歷的感覺,還有一些在尋找跟試用的工具就沒列上來了 ...
用 curl 找一隻鸚鵡來跳舞 1 $ curl parrot.live 來源 curl 版: https://github.com/hugomd/parrot.live terminal 版: https://github.com/jmhobbs/terminal-parrot
什麼是 gRPC Google 推出的 RPC framework 採用 Google 制定的 protocol buffers 當作資料傳輸格式 有 proto 工具可以把你寫好的 proto file 直接生成程式碼 比 RESTful API 更快、更有效率 更多請參考官網: grpc / grpc.io 安裝 開始寫 gRPC 服務之前,要先安裝一些 protocol buffer 的工具 ...
Evernote 官方沒有出 Linux Application,只有在網站上介紹 NixNote,在 Linux 上,我都是直接用 web client。 web client 的基本功能已經很好用了,只是想要整理筆記的時候覺得有點不夠力 ...
安裝好基本款的 debian 是沒有 sudo 指令可以使用的,需要自行安裝設定 安裝 sudo 切換到 root 安裝 1 2 # su - # apt install sudo 設定 sudoer 1 # usermod -aG sudo nyo 設定好之後,登入並用 sudo 隨意打個指令試試 ...
被稱作 Linux 神器的工具 入門之後我也愛上它了,讓 terminal 變得非常的靈活 安裝 mac 1 $ brew install tmux ubuntu / debian apt 上裝的可能會太舊,直接裝 github 上最新 release 的 參考別人寫好的腳本: https://gist.github.com/P7h/91e14096374075f5316e 1 2 3 4 5 6 7 8 9 10 11 12 13 VERSION=2.6 sudo apt -y remove tmux sudo apt -y install wget tar libevent-dev libncurses-dev wget https://github.com/tmux/tmux/releases/download/${VERSION}/tmux-${VERSION}.tar.gz tar xf tmux-${VERSION}.tar.gz rm -f tmux-${VERSION}.tar.gz cd tmux-${VERSION} ./configure make sudo make install cd - sudo rm -rf /usr/local/src/tmux-* sudo mv tmux-${VERSION} /usr/local/src tmux.conf 放上幾個我覺得實用的設定 ...
使用目前最強大的 vim 套件包 spf13-vim 安裝 vim 需要支援 lua 版本的 vim mac 1 2 $ brew install macvim --with-cscope --with-lua --override-system-vim $ brew install ctags debian 1 $ sudo apt install vim vim-gnome vim-doc ctags windows 我不知道 安裝 spf13-vim 有一鍵無腦安裝的指令 ...
某次旅遊到了不同的時區,但是相機沒有調時間,拍到後來才發現,自己差點沒暈倒 只能回家想辦法再修正時間,畢竟照片不能重拍啊 要在 Linux 上處理 EXIF 的話,有個工具叫 exiftool 可以用 ...
發現了可以快速複製 key 到別台機器的好工具 可以不用再傻傻的 copy paste 了 產生 key 首先自己要有 ssh key 1 $ ssh-keygen 複製 key 到另一台遠端機器 快速複製的好工具是 ssh-copy-id 指令加上 -i 指令要複製的 key ...
想要跑當前專案下的所有 test 1 $ go test ./... Reference How to go test all testings in my project? - Stack Overflow
身為 vi 跟 terminal 的主要使用者,Ctrl 是重要的夥伴 要提高 Ctrl 的地位,減輕左手小指的負擔 ps. 以前的鍵盤配置,Ctrl 在 a 的左邊 Ubuntu 16.04 安裝 gnome-tweak-tool 1 $ sudo apt install gnome-tweak-tool 開啟 gnome-tweak-tool 選單 Typing -> Ctrl key position 選擇 Swap Ctrl and Caps Lock Mac 開啟 System Preferences 選 Keyboard -> Modifier Keys Ctrl 換 CapsLock, CapsLock 換 Ctrl Windows 7 下載 SharpKeys ...
Hugo 是用 Go 開發的靜態網站產生器 我為了把 blog 文章改放到 Github Page 上,一開始是想到 Jekyll 這個超熱門的工具 稍微研究一下後,發現是用 Ruby 寫的,讓我不太想用 最後是發現了 Hugo,評估過上手難易度後,決定就用他來試試了 ...
Hello Hugo This is my first post using hugo.