李俊諭 JYUN-YU LI

@JYU

Joined on Mar 19, 2020

  • Visual Studio偵錯WSL內.Net Core API容器無Docker Desktop輔助 Windows環境未安裝Docker Desktop,運行WSL2+Ubuntu子系統有安裝Docker Enginer環境下,Visual studio附加串接至容器進行偵錯配置筆記。 如果使用情境比較複雜,此筆記紀錄方法不確定是否可適用,需再自行評估是否還是需要Docker Desktop來輔助。 使用環境: Windows作業系統。 WSL2使用Ubuntu 22.04。 Visual Studio 2022。
     Like  Bookmark
  • Docker建立資料庫筆記 MySQL https://hub.docker.com/_/mysql Image Windows docker pull mysql Linux
     Like 1 Bookmark
  • Window10 建置Ubuntu(WSL2)與GUI桌面配置筆記 此筆記內容為紀錄筆者在建置WSL2過程中操作與問題。 關於 Windows 子系統 Linux 版 https://docs.microsoft.com/zh-tw/windows/wsl/about 系統要求 要使用WSL2必須要先符合要求條件 Windows 版本為 2004,組建為19041版本或更高。
     Like 25 Bookmark
  • Git自訂常用指令配置 紀錄筆者常用指令簡化操作配置,不定期更新內容。 使用git config進行設置。 設置命令規格: git config <font class='red'>--global</font> <font class='orange'>alias</font>.<font class='orange'><自訂命令名稱></font> <font class='blue'> <command> </font> <font class=red>--global</font> 代表全域通用,針對範圍限制在當前git目錄,可以改為<font class=red>--local</font>。 如果對應git命列有待入參數,需使用單引號將整個<font class='blue'> <command> </font>包覆起來。
     Like 2 Bookmark
  • Kubernetes - minikube安裝Windows環境 Install Tools https://kubernetes.io/docs/tasks/tools/ minikube start https://minikube.sigs.k8s.io/docs/start/ 系統需求可參考 https://minikube.sigs.k8s.io/docs/start/#what-youll-need minikube GitHub https://github.com/kubernetes/minikube Install Docker Desktop on Windows
     Like  Bookmark
  • 程式碼: https://github.com/s123600g/AuthorizeErrorEFCoreSample 此筆記為紀錄個人開發驗證權限遇到問題,在自訂Token驗證權限過程中,因不小心把DBContext給釋放掉,導致後面頁面Controller-Action內DBContext物件實際上是變成空物件參考狀態,在調用查詢時會噴出以下錯誤 ObjectDisposedException: Cannot access a disposed context instance. A common cause of this error is disposing a context instance that was resolved from dependency injection and then later trying to use the same context instance elsewhere in your application. This may occur if you are calling 'Dispose' on the context instance, or wrapping it in a using statement. If you are using dependency injection, you should let the dependency injection container take care of disposing context instances. Object name: 'NorthwindContext'. Sartup.cs 在Pipline管道上,路由進入到對應頁面Controller-Action內之前,會先跑第一道中繼站 app.Use(async (context, next) =>
     Like  Bookmark
  • 使用OpenXml產生Excel筆記 使用微軟官方提供Open XML SDK來產生Excel檔案,此篇筆記主要紀錄簡易產生操作。 相關參考: ASP.NET Core 教學 - Open XML SDK 匯出 Excel Create a spreadsheet document by providing a file name (Open XML SDK) OpenXML Multiple Sheets 簡易範例
     Like 1 Bookmark
  • 使用Lotify建立一個簡單LINE Notify筆記 前言 參加今年MOPCON 2020 剛好聽到LINE自家工程師演講開發Python套件Lotify,此套件已經整合LINE API呼叫操作部份, 來試試看發送基本文字訊息與訂閱基本實作。 此筆記範例 GitHub: https://github.com/s123600g/LINENotifyDemo_Lotify 環境建置 使用Flask做一個簡單網站框架,搭配Vue3來做一個簡單資料操作(這只是作者個人自己還在學習Vue,套入簡單練習應用),在Ubuntu 20.04環境下實作。 第一步 安裝Python 套件
     Like  Bookmark
  • 使用Docker建置Nginx結合uWSGI映像檔 此筆記為筆者學習建立一個Nginx整合uWSGI Server服務 Docker映像檔,紀錄建立一個Dockerfile檔案到建置完成過程。 Docker Contianer → 在筆記稱為容器。 Docker Image →在筆記稱為映像檔。 相關參考資源: https://blog.techbridge.cc/2018/03/17/docker-build-nginx-tutorial/ https://philipzheng.gitbook.io/docker_practice/dockerfile/basic_structure
     Like  Bookmark
  • 使用Docker運行Nginx與uWSGI容器服務 此筆記內容記錄著依據Nginx整合uWSGI Server服務映像檔,建立一個運行Nginx與uWSGI容器服務。 有關於Nginx整合uWSGI Server服務映像檔可參考-->使用Docker建置Nginx結合uWSGI映像檔。 相關參考資源: https://docs.docker.com/engine/reference/commandline/run/ https://medium.com/@VisonLi/docker-%E5%85%A5%E9%96%80-%E7%AD%86%E8%A8%98-part-2-91e4dfa2b365 https://medium.com/@honglong/%E7%94%A8-docker-%E8%B7%91-mysql-d09c95c91da3
     Like  Bookmark
  • Flask 建置 Resful API 關於使用Docker建置映像檔與容器服務可參考 使用Docker建置Nginx結合uWSGI映像檔 使用Docker運行Nginx與uWSGI容器服務 下載專案包 https://github.com/s123600g/FlaskDemoNotes/tree/master/Restful_API 建立完成後請記得在專案目錄內新增一個uwsgi目錄,此為用來放置uWSGI運行Log檔案。
     Like  Bookmark
  • Flask 基本框架配置 GitHub: https://github.com/s123600g/FlaskDemoNotes/ 在Flask網站基礎框架上預設會有以下結構: . ├── BaseData │   ├── BaseData.py │   ├── __init__.py
     Like 1 Bookmark
  • ASP.NET Core Web Api實作JWT驗證筆記 此為紀錄筆者實作JWT驗證過程筆記。 專案使用.Net 5,並使用.Net Core CLI進行建置 使用Visual Code作為開發工具 有關.Net Core CLI 可參考 https://docs.microsoft.com/zh-tw/dotnet/core/tools/ GitHub https://github.com/s123600g/jyu.lab.jwt
     Like  Bookmark
  • Dotnet Core 3.1 Console App使用NLog筆記 使用 Microsoft Visual Studio Community 2019 使用 .Net Core 3.1 相關參考: https://github.com/NLog/NLog https://github.com/nlog/nlog/wiki/Configuration-file#rules https://nlog-project.org/download/ https://github.com/NLog/NLog/wiki/Getting-started-with-.NET-Core-2---Console-application
     Like  Bookmark
  • 應用在資料來源不固定包含欄位不固定,需要手動作動態更新情況下。 需要判斷當前Datatables實體是否已經有存在 如果有存在才要進行銷毀程序 以下語法出現Datatable_ID為HTML Table元件 ID屬性值 Step1. 判斷DataTables實體是否存在 關於Datatables $.fn.dataTable.isDataTable: https://datatables.net/reference/api/%24.fn.dataTable.isDataTable()
     Like 1 Bookmark
  • 關於Datatables套件下載 https://datatables.net/ 語法結構 結構上有分為以下區塊 屬性區塊 ajax區塊 資料欄位區塊(columns) 語言區塊(language)
     Like 8 Bookmark
  • Export Image 輸出tar檔案 docker save --output "輸出檔案資訊(.tar)" image name:tag Ex: docker save --output my_image.tar my_image:first Import Image docker load --input "檔案資訊(.tar)"
     Like  Bookmark
  • https://docs.docker.com/engine/reference/commandline/export/ Export Container 輸出tar檔案 docker export container_id/container names > 輸出檔案資訊(.tar) Ex: docker export my_container > my_container.tar 第二種方式
     Like  Bookmark
  • Docker開啟Remote API與遠程管理設置筆記 Configure where the Docker daemon listens for connections https://docs.docker.com/engine/install/linux-postinstall/#configure-where-the-docker-daemon-listens-for-connections 在官方說明文件內有提到兩種方式 使用systemd unit file <-- 此筆記主要使用此方式 使用daemon.json 需要注意兩種方式一起設置使用的話,會造成docker.service啟動時衝突導致服務無法啟動。
     Like 5 Bookmark
  • 在下載Datatables 套件包時,在Extensions內部Buttons項目記得要勾選 [x] HTML5 export 這樣才會把必要模組功能一起包進套件包裡。 關鍵參數設置 Datatables 主體渲染樣式設置 dom: 'Bfrtip'
     Like 2 Bookmark