2021年11月30日 星期二

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: {lowest}, closing: {closing}, volume: {volume}"); readsize += sizeof(Int32) * 6; } } }

https://ez1data.blogspot.com/2024/11/ezchart-1131127.html?m=1

2021年3月3日 星期三

Install Jupyterlab on Cygwin

 setup-x86_64.exe -q --packages=libzmq-devel,libffi-devel,python37-devel

pip3.7 install jupyterlab

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

2021年1月16日 星期六

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/




預測2031/1/1可能 TWCA 憑證 IOS會出現不信任

緣由: TWCA CYBER Root CA 有兩張、兩個效期 (2030、2047年到期) 推測TWCA 預計 2030年12月會停用: TWCA CYBER Root CA (2030 年到期) TWCA Global Root CA 改用啟用: TWCA CYBER ...