跳到主要內容

發表文章

目前顯示的是 2021的文章

EZChart Data

意外看到EZChart臺灣股市歷史資料 寫一下程式把資料爬出來 static void Main ( string [ ] args ) { var file = File . OpenRead ( @"C:\Program Files (x86)\ezChart\Data\0050.dat" ) ; var size = file . Length ; using ( var br = new BinaryReader ( file ) ) { long readsize = 0 ; while ( size > readsize ) { int date = br . ReadInt32 ( ) ; decimal opening = ( decimal ) br . ReadInt32 ( ) / 100 ; decimal highest = ( decimal ) br . ReadInt32 ( ) / 100 ; decimal lowest = ( decimal ) br . ReadInt32 ( ) / 100 ; decimal closing = ( decimal ) br . ReadInt32 ( ) / 100 ; int volume = br . ReadInt32 ( ) ; Console . WriteLine ( $"date: { date } ,opening: { opening } , highest: { highest } , lowest:

Offline Install Ansible on Windows using Cygwin

1.  Downloading setup-x86_64.exe(https://www.cygwin.com/) 2. if no admin  Comment setup-x86_64.exe --no-admin 3. search ansible and download 4. Offline install 5. search ansible and install 6. 直接安裝 setup-x86_64.exe -q --packages=ansible

Grafana 筆記

handling NULL values in Query-based variable  PostgreSQL query 變數空值處理 WHERE "my_field" IN (${my_variable}) 當變數出現空值時 Templating Template variables could not be initialized: pq: syntax error at or near ")" 變數格式改用 pipe WHERE "my_field" ~ ('${my_variable:pipe}') 解決~ key/value pairs as template variables on grafana 寫法 SELECT hostname AS __text, id AS __value FROM host https://grafana.com/docs/grafana/latest/datasources/postgres/ LDAP - Active Directory server setup 公司環境再設定綁定不希望設定檔上出現帳密 調整設定如下: [註:]內部Ldap 查詢功能會不能使用 bind_dn = "CORP\\%s" # or "%s@corp.local" search_filter = "(sAMAccountName=%s)" search_base_dns = ["dc=corp,dc=local"] # 註解group mappings # [[servers.group_mappings]] https://grafana.com/docs/grafana/latest/auth/ldap/