2023/12/26

solidworks 2015 無法點兩下檔案直接開啟 swshellfilelauncher 嘗試開啟您的檔案時發生錯誤

 solidworks 2015 安裝好之後,程式可正常開啟,開啟舊檔/新檔都正常。

但是如果在資料夾內對著檔案直接連點兩下開啟時,solidworks有啟動,但會跳出一個swshellfilelauncher 的錯誤視窗,內容是嘗試開啟您的檔案時發生錯誤


解法就是對著檔案按右鍵,選擇用"solidworks launcher"開啟檔案。
如果還是不行,一樣是對著檔案按右鍵,選擇預設程式,然後到solidworks的安裝目錄中找到swshellfilelauncher ,設定用該程式來開啟圖檔,就可以了。




After installing SolidWorks 2015, the program opens successfully, and both opening existing files and creating new files work as expected. However, if you double-click a file directly within a folder, SolidWorks launches but displays an error window titled "swshellfilelauncher," stating that an error occurred while trying to open your file.

The solution is to right-click on the file, choose "Open with SolidWorks Launcher." If this doesn't resolve the issue, right-click on the file again, select "Open with," and navigate to the SolidWorks installation directory to find swshellfilelauncher . Set it as the default program for opening image files, and the problem should be resolved.






2023/12/21

Shioaji 觸價停損

 Shioaji的官網上有提到怎麼做觸價停損: https://sinotrade.github.io/zh_TW/tutor/advanced/quote_binding/#_3

但我連callback都不懂的人,裡面寫的我實在無法理解,所以就想了另一個解法。

因為我只當沖小台,所以就一直snapshot小台目前的價格,每0.5秒一次,並不會超過流量限制。

如果價格有到我的停利或停損價,就馬上執行市價平倉單,來達到觸價停損的機制。

因為市價單必須是IOC,所以要馬上檢查庫存還有沒有單,確認是否已平倉,如果沒有,就繼續下市價平倉單,以確保我有把單平掉。

這就是個人一個簡單的觸價停損作法。

另外就是有發現一個問題,如果我平倉是掛當下限價單,用當下snapshot抓到的小台價格,幾乎不會馬上成交,我就要重新抓小台價格,把下單價格在更新重下,大概都要等個30秒才會成交,就會滑價。但改用市價單就直接成交,出場滑價的機會就會比較小,這也是用市價單的好處。


2023/12/08

廣告回復了 但流量好像變少了

自從廣告功能回來後,每日瀏覽量感覺有在下降。
不知是不是剛好也沒什麼新的文章。
要靠廣告賺錢還真是好難啊。

2023/11/29

我的blogger廣告回來了

 大概三四個月前發現google adsense一直沒收入,雖然收入本來就超少,但完全是零也蠻怪的。

後來在google adsense後台發現有找不到ads.txt的錯誤訊息。

這個也很怪,我直接在網址列去輸入,都能正常顯示ads.txt,但google adsense卻一直說找不到。

後來就是在帳戶設定裡重新驗證商家網域,google adsense就顯示ads.txt正常了。

但沒多久google adsense又說找不到ads.txt了。就一樣的方式重新驗證。

重覆發生了三四次,最後卻說我太久沒有廣告登入,要重新申請審查,所以就又重新申請審查,等了兩三個星期終於通過了。

然後又等了兩三個星期,就在今天看到有廣告了.......想要賺點小錢真的好難。

2023/11/28

無法使用IP連線共用資料夾 錯誤訊息 0x80004005

 某台win2012的電腦使用本機登入,要連到一個共用資料夾。

使用 \\電腦名稱\ 連線,會跳出帳號密碼驗證,接著輸入 網域\使用者帳號 做登入,沒問題。

但使用 \\IP\ 連線,會跳出帳號密碼驗證,接著輸入 網域\使用者帳號 做登入,會跳錯誤,代碼是 0x80004005。

查了網路上一些方法,改機碼,改gpedit安全性都沒用。

後來是會跳出帳號密碼驗證時,輸入 使用者帳號@網域,就成功了,很特別的狀況。


A Windows 2012 computer logged in locally attempts to connect to a shared folder.

When connecting to \\HostName\, a username and password prompt appears. Entering Domain\Username works without issue.

However, when connecting to \\IP\, a username and password prompt appears. Entering Domain\Username results in an error code of 0x80004005.

After trying some methods found online, such as changing registry keys and Group Policy security, the issue was not resolved.

Finally, entering Username@Domain at the username and password prompt resolved the issue.


2023/11/27

centos執行指令出現錯誤 cannot execute binary file

 在centos上安裝好不斷電系統的agent後,執行程式時,會出現 cannot execute binary file的錯誤訊息。

但這個agent在其他台linux系統安裝都沒問題。

後來查發現是系統架構不同。

先執行uname -m,查到系統是i686的。

接著執行 file 執行檔名稱,結果該檔案是x86-64,所以不相容,只好放棄。


After installing the uninterruptible power supply (UPS) system agent on CentOS, an error message "cannot execute binary file" is encountered when attempting to run the program.

It was later discovered that the issue arises from a different system architecture. When executing uname -m, it was found that the system is i686. Subsequently, running the file command on the executable revealed that the file is x86-64, indicating an incompatibility issue. As a result, the execution had to be abandoned.

2023/11/21

Edge用IE模式開網頁出現錯誤訊息 "Internet Explorer 已修改這網頁以協助防止跨網站指令碼攻擊"

 



在透過Edge的IE模式開啟某個內部網頁時,無法正常顯示內容,下方出現"Internet Explorer 已修改這網頁以協助防止跨網站指令碼攻擊"的錯誤訊息。
這時就到控制台裡的網際網路選項,在安全性裡面,找到這個網頁所屬的區域,開啟自訂層級,在裡面找到啟用xss篩選器,把它停用就行了。



When opening an internal web page in IE mode of Edge, the content cannot be displayed normally. The error message "Internet Explorer has modified this page to help prevent cross-site scripting attacks" appears below.

At this time, go to the Internet Options in Control Panel, find the area to which this page belongs in Security, open the Custom Level, find Enable XSS Filter, and disable it.



2023/11/08

學會程式交易~開啟穩定賠錢的旅程

 為了打造自動化交易工具,產生穩定的被動收入,就開始學python,要來打程式交易。

程式做出來了,但交易策略不太行,所以反而變成穩定的被動失血。

策略還是最重要的東西,想不出一個正期望值的策略,有沒有程式交易其實也沒什麼意義。


2023/10/31

kaspersky endpoint protection(KES) 造成chatgpt 無法回應答案

 去年在使用chatgpt時,可登入,但輸入問題後按下enter,都不會有任何回應。

後來把防毒kes關閉後,就正常了,那時因為版本比較舊,升級後就正常了。

但這幾天又發生了,雖然kes有出比較新的版本了,但跟現在的版本差異不太,所以就先問廠商。

廠商判斷應該是被憑證影響了,要把幾個chatgpt相關的網址加到信任網域內,就可以正常chatgpt的回覆就可以正常顯示。

在政策裡面的一般設定-->網路設定-->受信任網域 裡面,把下列幾個網址加進去即可。

chat.openai.com

auth0.openai.com

cdn.openai.com

cdn.auth0.com

tcr9i.chat.openai.com

cdn.oaistatic.com

events.statsigapi.net


Last year, when I used ChatGPT, I was able to log in, but after entering a question and pressing Enter, there was no response.

I later turned off the antivirus software Kes, and it worked normally. At the time, the version was older, so upgrading it fixed the problem.

However, the issue has occurred again in the past few days. Although Kes has a newer version, it is not much different from the current version. So, I contacted the support vendor.

The vendor determined that the issue was caused by a certificate. Adding the following URLs to the trusted domain will allow ChatGPT responses to be displayed normally.

chat.openai.com
auth0.openai.com
cdn.openai.com
cdn.auth0.com
tcr9i.chat.openai.com
cdn.oaistatic.com
events.statsigapi.net

2023/10/17

POWERSHELL 結果匯出成csv 國字變亂碼問號

在用powershell把一些安全性log匯出成csv時,國字 都會變成問號,這時只要把最後匯出成csv的指令,後面在加個用utf8編碼的指令就可以正常顯示了。

原指令

 Export-Csv d:\eventlog.csv

修正後

 Export-Csv  d:\eventlog.csv -NoTypeInformation -encoding utf8


2023/10/06

Word插入物件出現錯誤-此物件是使用程式Acrobat建立。您的電腦並未安裝此程式

 在WORD程式內,透過插入物件的功能,要插入一個PDF檔,卻跳出"此物件是使用程式Acrobat建立。您的電腦並未安裝此程式......請安裝Acrobat或確定已關閉Acrobat中任何的對話"



先確認PDF檔都是可直接用Acrobat PDF Reader開啟,WORD試著插入EXCEL物件也正常。

所以就決定先重裝Acrobat PDF Reader,結果就解決問題了。


When trying to insert a PDF file into a Word document using the "Insert Object" function, the following error message appears: "This object was created using the Acrobat program. This program is not installed on your computer. Please install Acrobat or make sure that all Acrobat dialog boxes are closed."

I confirmed that the PDF files could be opened directly using Acrobat Reader. I also tried inserting an Excel object into a Word document, and that worked fine.

Based on these findings, I decided to reinstall Acrobat Reader. After doing so, the problem was resolved.

2023/09/27

有些筆電接HDMI無法投影 接D-SUB卻正常

 近期買的筆電在用HDMI連接會議室投影機時,都會顯示沒有連接到設備,接D-SUB卻正常投影。其他舊筆電兩種連接方式都正常。

本來以為是中間有連接一些轉接頭的關係,後來才發現,是因為新筆電解析度很高,但投影機的太低,如果接上投影機時,是在"同步顯示"的狀態下,投影機的畫面就無法投影,要改成"僅第二個螢幕顯示",或是把筆電的解析度降低,就可以正常投影了。


Recently purchased laptops using HDMI to connect to the projector will display "No device connected". D-SUB can be connected normally. Other old laptops can connect normally in both ways.

At first, I thought it was because of the adapters in the middle. Later, I found out that it was because the new laptop has a high resolution, while the projector is old and has a low resolution. If the projector is connected in "Synced display" mode, the projector's image cannot be projected. You need to change to "Only second monitor display" or lower the laptop's resolution to be able to project normally.

2023/09/26

linux mount 沒反應 後來出現 mount.nfs input/output error

 有一台linux主機在重開機後要重新mount其他機器的分享資料夾,執行執令後,畫面上沒任何反應。

過了一下子才會出現 mount.nfs input/output error,這是因為 /etc/init.d/portmap 這個服務沒有啟動的關係,

 先 執行/etc/init.d/portmap status, 確認該服務是stop。

接著用執行啟用的指令/etc/init.d/portmap start,就可以再執行mount的動作了。


A Linux host fails to mount a shared folder from another machine after a reboot. After executing the mount command, the screen is blank.

After a while, an error message "mount.nfs input/output error" appears. This is because the service "/etc/init.d/portmap" is not running.

First, execute the command "/etc/init.d/portmap status" to confirm that the service is stopped.

Then, execute the command "/etc/init.d/portmap start" to start the service. After that, you can mount the shared folder again.

2023/09/25

VMWARE匯入OVA失敗-硬體系列 vmx-18 不受支援

在新建虛擬機,從esxi要匯入一個 ova檔時,最後一步出現錯誤:硬體系列 vmx-18 不受支援



原因是此ova是比較新的esxi建的,現在要匯入到比較舊的esxi所以無法支援,只要在esxi升級就行了。



When creating a new virtual machine, an error occurs in the last step when importing an ova file from ESXi: "Hardware series vmx-18 is not supported."

The reason for this error is that the ova was created with a newer version of ESXi and is now being imported to an older version of ESXi, which does not support the vmx-18 hardware series. The solution is to upgrade ESXi to a version that supports the vmx-18 hardware series.


2023/09/18

更新KESS到最新版3.2後 無法連線到中控台Server

將KESS升級到最新版後,連同Network Agent也一起更新到14版。

裝好後卻一直無法跟中控台連線,測了一下發現是Network Agent 有啟用,但連不到中控台。

原來是Network Agent 14版不支援比較舊的作業系統了,規格可參考下列的kaspersky官網說明

https://support.kaspersky.com/KSC/14.2/en-US/255797.htm


After upgrading KESS to the latest version, the Network Agent  were also updated to version 14.

After installation, the connection to the central console was not possible. Testing revealed that the Network Agent were running, but could not connect to the central console.

It turned out that Network Agent version 14 no longer supports older operating systems. The specifications can be found in the following Kaspersky website documentation:

https://support.kaspersky.com/KSC/14.2/en-US/255797.htm


2023/09/13

WIN10筆電突然麥克風無法收音

 筆電突然無法收音,但裝置都還在。

重上驅動也沒用。

可以換個帳號登入試試,有時後是profile的問題,如果換個帳號登入,麥克風是正常的,重把有問題的使用者profile重建即可。




The Windows10 laptop microphone suddenly stopped working, but the device is still there.

Reinstalling the driver did not work.

You can try logging in with a different account. Sometimes it is a profile issue. If the microphone works normally when you log in with a different account, you can rebuild the user profile with the problem.

2023/09/11

Office2010安裝 錯誤1402

 Office突然不能用,無法移除,安裝也跳這個錯誤1402的錯誤。


執行 secedit /configure /cfg %windir%\inf\defltbase.inf /db defltbase.sdb /verbose 
就可重新安裝。




Office suddenly stopped working, could not be removed, and the installation failed with error code 1402.

Executing the following command will allow you to reinstall Office

secedit /configure /cfg %windir%\inf\defltbase.inf /db defltbase.sdb /verbose


2023/09/08

選擇權操作-停止所有組合單策略

雙買只有明顯趨勢下才能賺,雙賣是一有趨勢就慘了。

價差單也差不多,看你怎麼組,也是有上面的問題,怎麼做都不順。

追蹤一個長期獲利的雙賣交易者對帳單,是用大口數來產生比較好的收益,如果只看單口的獲利,可能都不到50塊,過程中要一直調整部份,這個實在難做。

趨勢就是這樣,做賣方,他就很愛動,做買方就不太動,總是常在小賠,偶爾小賺一點點,期望值依然是負的,所以還是先暫停吧,專心做買方當沖。


2023/08/29

OCS Inventory 多筆重複電腦

 OCS Inventory 是一套免費的資產盤點軟體。

在使用的時後,會發現,同一台電腦會重複多次,這樣就會造成軟體盤點數量不準。

明明只有裝1套,但因為該台電腦重覆了3次,就會以為是裝了3套。

可以在"Manage"-->"Duplicates"功能中,設定要用什麼條件把重覆的電腦合併。

裡面已經有幾個定義好的,想要用哪個,就去點選後面的數字。

進去後可以看到列出的清單,每個都可以點開,看到相關的電腦資訊,看要合併哪一個,就打勾,選好後,最下面有一個merge的按鈕,按下去系統就會把重覆的合併。



OCS Inventory is a free asset inventory software.

When using it, you may notice that the same computer is listed multiple times. This can lead to inaccurate software inventory quantities.

For example, if you only have one copy of a software installed on a computer, but that computer is listed three times in the inventory, the software will think you have three copies installed.

To fix this, you can use the "Manage"-->"Duplicates" function to merge duplicate computers.

This function lets you choose the criteria you want to use to merge computers. There are a few pre-defined criteria, or you can create your own.

Once you've selected the criteria, you'll see a list of all the duplicate computers. You can click on each one to see more information.

To merge a duplicate computer, check the box next to it. Once you've selected all the computers you want to merge, click the "Merge" button.

The system will then merge the duplicate computers into a single entry.









安裝Kaspersky 的KESS,出現電腦上遺失SHA-256(SHA-2)數位簽章支援的錯誤訊息。

 



安裝Kaspersky 的KESS防毒軟體時,出現電腦上遺失SHA-256(SHA-2)數位簽章支援的錯誤訊息。
可參 考錯誤訊息下方的說明網站。
主要的解法就是去安裝kb4474419的更新即可。

When installing Kaspersky's KESS antivirus software, an error message may appear indicating that the computer is missing SHA-256 (SHA-2) digital signature support. This is because Kaspersky uses SHA-2 to verify the authenticity of its software and files.

To fix this error, you need to install the kb4474419 update. This update is available from Microsoft's website.
Once you have installed the update, you should be able to install Kaspersky's KESS software without any problems.

2023/08/24

GPO佈署EDGE IE瀏覽模式突然失效 被略過

原本有透過GPO在使用者的電腦,佈署EDGE政策,讓EDGE在開啟一些特定網頁時,會啟用IE瀏覽模式。

但這兩天開始有電腦的IE瀏覽模式沒被啟用,查看GPO確定是有套用沒錯,所以不是GPO的問題。

開啟EDGE查看設定,發現套用的政策被略過了,但只有少數人有這個狀況。


查了一下才知道是因為EDGE最近升級後,有一些改變。
如果使用者在EDGE裡登入了私人帳號,GPO佈署的政策就會被略過,只要登出帳號,就會恢愎正常了。



Originally, we deployed EDGE policies via GPO on users' computers to enable IE browsing mode when opening certain websites.


However, in the past two days, some computers have failed to enable IE browsing mode. After checking the GPO, we confirmed that it is being applied correctly. Therefore, the issue is not with the GPO.


When we opened EDGE and checked the settings, we found that the applied policies were being ignored. However, this was only happening for a small number of users.


After some investigation, we learned that this is because EDGE was recently updated. If a user is logged in to a personal account in EDGE, the policies deployed via GPO will be ignored. Simply logging out of the account will restore normal behavior.


2023/08/18

Python Excel書推薦

 Python操作Excel:最強入門邁向辦公室自動化之路 王者歸來

這本書裡面範例多,而且都很簡短,好上手,想要Python來處理Excel資料的很適合。




2023/08/14

Ultravnc viewer 連線設定

 Ultravnc viewer 在連線時,有時後畫面會太大,或速度比較慢。

這是可以去調整設定,讓畫面自動去符合目前的螢幕大小,跟連線速率的狀況。

但每次連線就要調一次太麻煩,要直接去預設值裡面調整,這樣之後就會自動套用。

先隨便找一台電腦連線,連線之前先把"auto scale"打勾,"quick encoder"選擇"LAN",連後就連線,連上後就可以關閉。

這時到 C:\Users\username\AppData\Roaming\UltraVNC\,就會看到剛剛那台電腦的連線設定檔。

接著把這個檔案重新命名為"options",覆蓋原本已存在的檔案,就行了。

這個設定檔可以用記事本開啟,看到裡面的設定,下列兩個設定就是對應到剛剛設定的那兩個值

QuickOption=3 #可將連線速品質預設為MEDIUM,降低連線延遲。

AutoScaling=1 #可自動調整連線視窗大小,符合當前的螢幕尺吋。



UltraVNC viewer may sometimes display too large a screen or be slow when connected.

You can adjust the settings to make the screen automatically fit the current screen size and connection speed.

However, it is too troublesome to adjust it every time you connect. You can directly adjust it in the default values, so it will be automatically applied afterwards.

First, connect to any computer at random. Before connecting, check the "auto scale" and select "LAN" for the "quick encoder". Then connect and close it after connecting.

At this time, go to C:\Users\username\AppData\Roaming\UltraVNC, and you will see the connection settings file for the computer just now.

Then rename this file to "options" and overwrite the existing file.

This settings file can be opened with Notepad to see the settings. The following two settings correspond to the two values ​​that were just set:

QuickOption=3 #Can set the connection speed quality to MEDIUM by default, reducing connection latency.

AutoScaling=1 #Can automatically adjust the size of the connection window to fit the current screen size.

2023/08/11

搭配Google Blogger 的Google Adsense ads.txt一直顯示找不到

 最近Google Blogger流量變多了,但Google Adsense這兩三個月的收入卻都是0,感覺怪怪的。

進到Google Adsense後台看了一下,發現在"網站"這裡面的設定,ads.txt狀態是顯示"找不到"。

看了一下說明,發現設定都對,然後連到 https://網站網址/ads.txt ,資料也有正常顯示。

本來在想是不是Blogger裡面的robots.txt設定有問題,所以把robots.txt關閉,但還是沒用。

後來在論壇上看到有人分享,到Google Adsense後面的"設定-->帳戶資料",裡面有一個"賣家資訊顯示設定",要設定成公開,ads.txt馬上就會馬上生效變成"已授權"。

測試了一下,真的馬上就好了,Google的ads設定都沒提到這個,還好有好心人提供這個方法才得以解決。


Recently, my Google Blogger traffic has increased, but my Google Adsense income for the past two to three months has been 0. I felt strange.

I went to the Google Adsense backend and checked. I found that the status of ads.txt in the "Website" settings is "Not Found".

I read the instructions and found that the settings are correct. Then I went to https://website-url/ads.txt, and the data was also displayed normally.

I thought that the robots.txt setting in Blogger might be wrong, so I turned off robots.txt, but it didn't work.

Later, I saw someone share on the forum that I should go to the "Settings"->"Account Information" in Google Adsense, and there is a "Seller Information Display Settings". I should set it to "Public", then ads.txt will be effective immediately and become "Authorized".

I tested it, and it really worked immediately. 

Python py轉exe的執行檔太大

 Python寫好的執行要直接轉成exe檔在其他沒裝Python直接運行,可是轉出來的exe檔都好大,幾KB的py檔轉成exe變成幾百MB。

原來是因為之前是用Anaconda裝好環 境的,裡面有一大堆套件,在轉換時,也一直被塞進去了。

要解決這個問題,就是建一個新的虛擬環境,裝上所需的套件,再進行轉換,exe檔就變成幾十MB而已。

可以參考下面網站,說的非常清楚。

https://inf.news/zh-hant/technique/0abeedacd79bf29153e82893d9a0e280.html



Converting a Python script into an executable (.exe) file is a convenient way to run the program on systems without Python installed. However, the resulting .exe files tend to be quite large, often several hundred megabytes, even for scripts that are just a few kilobytes in size.

The reason behind this issue is that if you previously developed your code within an Anaconda environment, it likely included a multitude of packages and dependencies. During the conversion process, these dependencies are also bundled into the executable, contributing to its substantial size increase.

To address this problem, a solution involves creating a new virtual environment, installing only the necessary packages, and then proceeding with the conversion process. This approach results in executable files that are only a few tens of megabytes in size.

For a detailed guide on how to accomplish this, you can refer to the following website:

https://inf.news/zh-hant/technique/0abeedacd79bf29153e82893d9a0e280.html

2023/08/08

fortigate log 保留天數調整

 fortigate log 預設保留7天,如果容量夠的話,可以設定保留久一點,若有發生異常,可以查到比較久以前的紀錄。

直接在指令模式下分別輸入下列三個指令就行了,其中第二行就是設定日誌保留的天數,下面的範例是設成30天。

config log disk setting

set maximum-log-age 30     

end


FortiGate logs are stored by default for 7 days. If you have enough disk space, you can configure them to be stored for a longer period of time. This will allow you to view older logs in case of an incident.

To configure FortiGate logs, enter the following three commands in command mode. The second command sets the number of days that logs are stored. In the example below, logs are stored for 30 days.

config log disk setting

set maximum-log-age 30

end

2023/08/07

windows 使用batch 指令匯出dhcp lease位址租用紀錄

 如果是windows2012,powershell 4.0裡面有get-dhcp的指令把DHCP目前租用IP的清單做匯出。

但在windows2008,powershell 1.0沒這個指令,不想升級powershell,可以用netsh來完成,指令如下:


@echo off

netsh dhcp server scope 172.16.11.0 show clients > "%DATE:~0,4%%DATE:~5,2%%DATE:~8,2%_dhcp_clients.txt"

exit

指令會把172.16.11.0這個領域的IP租用匯出到txt中,檔名是會以當天的日期呈現。

如果要把每個領域都匯出,就把指令重覆貼上,改掉scope後面的領域IP就行了。



If you are using Windows 2012, PowerShell 4.0 includes the get-dhcp command to export a list of currently leased IP addresses from DHCP.

However, in Windows 2008, PowerShell 1.0 does not have this command. If you do not want to upgrade PowerShell, you can use netsh to complete the task. The command is as follows:

@echo off

netsh dhcp server scope 172.16.11.0 show clients > "%DATE:~0,4%%DATE:~5,2%%DATE:~8,2%_dhcp_clients.txt"

exit

This command will export the IP leases for the 172.16.11.0 scope to a text file. The file name will be in the format of YYYYMMDD_dhcp_clients.txt.

To export leases for all scopes, simply copy and paste the command, and change the scope IP address after scope.

2023/07/28

APACHE http轉跳https 設定

最近在查怎麼讓web伺服器某些https的網站,在連線時,用http連會自動轉跳到https,查到的設定都好復雜,結果發現有一個人分享一個很簡單的方法,主要是利用連上http沒東西時,會自動幫你轉跳到https的頁面就可以了,只需要一行設定,可參考下列說明

ttps://www.orcy.net.cn/927.html 

2023/07/07

ESXi 6.5 的windows 2012虛擬機傳送ctrl alt del沒反應

在ESXi 6.5架設了一台windows 2012虛擬機,開啟了遠端桌面連線的功能,都可以使用,接著安裝了vmtool重開機後,使用chrome透過esxi的web console要登入主機時,傳送ctrl alt del沒反應。

使用遠端桌面連線,輸入完帳號密碼後,也都連不上,非常奇怪。

查了一下google,vmware有一篇文章是說要升級esxi,這個就先不考慮。

在經過一些測試後發現,是透過windows update進行更新時,會有一個vmware的套件,安裝了這個後,才會有傳送ctrl alt del沒反應的問題,所以在做windows update時不要裝這個套件就好了。


I have set up a Windows 2012 virtual machine on ESXi 6.5 and enabled the Remote Desktop Connection feature, which was working fine. Then I installed vmtools and rebooted the virtual machine. After that, when I tried to log in to the host using Chrome via ESXi's web console and sent Ctrl+Alt+Del, there was no response.

I also tried using Remote Desktop Connection, but after entering the username and password, I couldn't connect, which is very strange.

After searching on Google, I found an article from VMware suggesting upgrading ESXi, but for now, I'm not considering that option.

After some testing, I discovered that when updating through Windows Update, there is a VMware package that, when installed, causes the issue with Ctrl+Alt+Del not working. So, when performing Windows Update, it's advisable not to install this package.

2023/07/06

Excel 下方的分頁頁籤不見了

 EXCEL檔案不同的分頁,通常都在左下方可以做點選切換。

但某些檔案明明就有多個分頁,但下方卻都沒東西,無法切換。

這是設定的問題,只要在進階的設定裡,找到 顯示工作表索引標籤,將此功能打勾就會正常顯示其他分頁了。





Different worksheets in an Excel file are usually switchable by clicking on the tabs located at the bottom left.
However, in some cases, even though a file has multiple worksheets, there is no content displayed at the bottom, and switching between them is not possible.
This is a configuration issue. By going into the advanced settings and enabling the "Show sheet tabs" option, the other worksheets will be displayed correctly.

2023/07/04

IBM x345 亮橘燈

 有一台非常老舊的IBM x345,前面面板出現了硬體故障的橘燈,但這台伺服器的面板沒有其他資訊,就只燈號可以看。

檢查了外觀,硬碟都正常,沒其他亮橘燈的地方,就查不到橘燈是什麼地方異常造成的。

查看原廠文件,有說明主機板上會有其他硬體的燈號,有問題的就會亮橘燈。



所以就關閉系統,但接著電腦線,將上蓋打開,果然看到記憶體插槽上有亮橘燈,終於找到問題。

更妙的時打開上蓋後,發現有一個小面板藏在裡面,上面就有顯示哪個硬體故障,實在想不通為何要把這個面板藏在裡面。

回去查原廠文件,裡面還真的有寫到這個診斷面板是在伺服器裡面。



There is an old IBM x345 server that has a hardware failure indicated by an amber light on the front panel. However, the server's panel does not provide any additional information, only the indicator light is visible.

Upon inspecting the physical appearance, the hard drives appear to be functioning properly, and there are no other areas with illuminated amber lights, making it difficult to determine the source of the issue.

Referring to the manufacturer's documentation, it mentions that there are other hardware indicator lights on the motherboard, which would illuminate if there were any problems.

Therefore, shut down the system, and the computer cables were connected. Upon opening the server's cover, it was discovered that there was indeed an illuminated amber light on one of the memory slots, finally identifying the problem.

Interestingly, upon opening the cover, a small panel was found hidden inside, displaying the specific hardware component that was experiencing the failure. It is weird why this panel was concealed inside the server.

Upon revisiting the manufacturer's documentation, it was confirmed that this diagnostic panel is indeed located inside the server.




Shioaji 1分k轉成其他分k

 永豐shioaji可以把1分k做匯出,然後在自行轉成其他分k。

做法通常就是把1分k資料用pandas轉換成datafram,然後在用resample的方式,轉成其他的分k。

不過在轉成其他分k時,會遇到兩個問題。

第一是轉成其他k分時,會有從左邊算起或右邊算一起的問題,這就會影響到資料的正確性,關於這個,可以參考https://ithelp.ithome.com.tw/articles/10280495 這篇文章,用label跟closed兩個參數去調整資料的正確性。

系統預設是左邊,但在轉換shioaji的資料時,要從右邊算,出來的分k開高收低才會對。

第二個問題是在用resample重把切分1分k時,都是以完整一小時去切,譬如說你要換成30分k,系統就會用x點00分跟x點30分去切,但台指開盤是8點45分,應該要切成x點15分跟x點45分。

這時後就要在加一個base的參考,範例可參考 https://towardsdatascience.com/using-the-pandas-resample-function-a231144194c4 這篇最後面‘Base’ Argument的說明。


另外就是1分k只能用日期 去過濾,但裡面會包含到日跟夜盤的資料,如果只要日盤,或是特定時間,就要用between_time這個參考去過濾,範例可去https://geek-docs.com/pandas/pandas-dataframe/python-pandas-dataframe-between_time.html 看看。

Linux nautilus程序佔用cpu效能

 在執行top查看系統效能狀況時,發現有一支程序nautilus佔用了很高的cpu效能,但整體的cpu效能使用率還是很低,沒影響到系統整體的運作。


nautilus是在圖型介面,像是檔案總管的一個程序,透過"who"指令,確認還有一個透過圖型介面登入的session沒關閉,連上去之後果然發現很多資料夾視窗沒關閉,是其他人員之前在設定一些東西時,設定好就直接中斷沒關掉的。

將這些資料夾關一關,登入圖型介面後,這些程序也就不見了。

The Linux program Nautilus is consuming CPU resources.

While checking the system performance using the "top" command, I noticed that the Nautilus program is utilizing a significant amount of CPU power. However, the overall CPU usage remains low, and it does not affect the overall operation of the system.

Nautilus is a graphical interface program, similar to a file manager. By using the "who" command, I confirmed that there is still an active session logged in through the graphical interface. After connecting to it, I discovered that many folder windows were left open, which were not closed after configuring some settings by other personnel.

By closing these folders and logging into the graphical interface again, these programs disappeared.

2023/06/29

Teams 會議來賓無法文字聊天

 原本在使用Teams會議時,沒帳號的來賓,也可以透過"聊天"功能用文字聊天。但最近突然不能用。

在測試時,卻發現有時後可以,有時後不行,仔細比對操作方式,發現了為何會有這種狀況。

Teams的會議有分頻道會議跟一般會議,發起會議的地方在不同的頁面上,通常發起會議都是頻道會議,因為登入後的畫面就是會在發起頻道會議的地方。

1.在"團隊"裡建立的會議,不管是排程或立即開會,都是頻道會議。來賓是無法使用文字聊天。

2.在"行事曆"裡建立的會議,不管是排程或立即開會,都是一般會議。來賓是可以使用文字聊天。

其他差異可參考 https://atlas.utdallas.edu/TDClient/30/Portal/KB/ArticleDet?ID=300





Guests in Teams meetings are unable to chat via text.

Originally, during Teams meetings, guests without an account could also engage in text chat using the "Chat" feature. However, recently this capability suddenly became unavailable.

During testing, it was observed that sometimes it worked, while other times it didn't. After carefully comparing the steps taken, the reason for this situation was identified.

Teams meetings can be categorized as channel meetings or regular meetings, and the location for initiating a meeting is different on the interface. Typically, meetings are initiated as channel meetings because upon logging in, the interface is directed to the channel meeting initiation section.

Meetings created within "Teams" are always channel meetings, regardless of whether they are scheduled or started immediately. Guests cannot use text chat in these meetings.

Meetings created within the "Calendar" are always regular meetings, regardless of whether they are scheduled or started immediately. Guests can use text chat in these meetings.




2023/06/16

Backup exec 伺服器的 Symantec\Backup Exec\BEDBG 資料夾內有很多佔容易的cab檔

 Backup exec 伺服器的C槽空間快不夠了,看了一下裡面的東西,發現 Backup exec 的程式資料夾中,其中一個BEDBG資料夾用了比較多空間,在裡面看到很多cab檔。

上網查了一下,這是 Backup exec 當掉後就會產生的dump檔,如果有需要查原因就可以去讀取這些cab檔。

不需要查的話,這些檔案就可以砍掉清空間。


The available disk space on the C drive of the Backup Exec server is running critically low. Upon investigating the contents, it was observed that the BEDBG folder within the Backup Exec program directory is consuming a considerable amount of space. Upon further inspection, it was discovered that the folder contains multiple CAB files.

After conducting research online, it was determined that these CAB files are generated as dump files by Backup Exec in the event of a system crash. These files can be accessed for troubleshooting purposes to identify the cause of the crash, if necessary.

If there is no need for further investigation, it is recommended to delete these files in order to reclaim disk space.


2023/06/14

HTTPS 網站的SSL 憑證發行者 變成 Kapersky

HTTPS網站的憑證發行者,通常都是顯示該憑證的發行商, 

但在某些網站查看憑證資訊時,發行者會變成Kapersky,在功能上沒影響,但不知為何會如此。

查了一下才發現,如果防毒軟體有啟用HTTPS的掃描檢查,防毒軟體就會安裝自己的憑證,以便檢查HTTPS傳輸。

如果把這個HTTPS加密傳輸的檢查關了,就不會有憑證發行者被換掉的狀況了。

卡巴斯基企業版的端點防護(KES)HTTPS加密傳輸掃描設定,是在一般設定中的網路設定裡,可以做啟用或關閉。




The issuer of an HTTPS website certificate typically displays the certificate's issuing authority. However, in some cases, when viewing the certificate information on certain websites, the issuer appears as "Kaspersky" instead. This does not affect the functionality of the certificate, but the reason behind this change is unclear.

Further investigation revealed that if antivirus software has enabled HTTPS scanning, it installs its own certificate to facilitate the scanning of HTTPS transmissions.

By disabling the inspection of encrypted HTTPS traffic, the situation of the certificate issuer being replaced can be avoided.

The setting for HTTPS encrypted transmission scanning in Kaspersky Endpoint Security (KES), the enterprise edition of Kaspersky, can be found in the general settings under network settings. It provides the option to enable or disable this feature.


2023/06/12

Shioaji 篩選 目前週選的TX代號

 現在選擇權代號通常會有當週,下週,跟月選3個合約,如果現在是第一週,就是有TX1,TX2,TXO,三個。只有第三週是2個(TXO跟TX4)。

目前的python語法裡TX是寫死的,每周要自己手動改,有點煩,所以就想了一個動判斷的語法,來抓今天是該是TX幾。

主要就是判斷連續兩週的合約有沒有值,如果都有的話,那TX就是比較小的那個。

像是TX1跟TX2都有值,那今天就會是TX1。

第三週因為是抓TXO跟TX4,但第四週也會有TXO跟TX4,所以這一個判斷要放在最後面才行,不然第四週會被先判斷成是TXO。

#抓當週的週選的TX代號
if api.Contracts.Options['TX1'] != None and api.Contracts.Options['TX2'] != None:
    TX = 'TX1'
    print(api.Contracts.Options[TX])
elif api.Contracts.Options['TX2'] != None and api.Contracts.Options['TXO'] != None:
    TX = 'TX2'
    print(api.Contracts.Options[TX])
elif api.Contracts.Options['TX4'] != None and api.Contracts.Options['TX1'] != None:
    TX = 'TX4'
    print(api.Contracts.Options[TX])
elif api.Contracts.Options['TX4'] != None and api.Contracts.Options['TX5'] != None:
    TX = 'TX4'
    print(api.Contracts.Options[TX])
elif api.Contracts.Options['TX5'] != None and api.Contracts.Options['TX1'] != None:
    TX = 'TX5'
    print(api.Contracts.Options[TX])
elif api.Contracts.Options['TXO'] != None and    api.Contracts.Options['TX4'] != None:
    TX = 'TXO'
    print(api.Contracts.Options[TX])

2023/06/04

FreeFileSync 同步檔案時出現 sync.ffs_lock的相關錯誤 code error 5: Access refuse [create file]

 在win2019透過freefilesync要把遠端win2003的檔案同步過來本機的時後,有些資料夾都會出現錯誤,內容都是在本機端的資料夾中 sync.ffs_lock有錯誤, code error 5: Access refuse [create file]。

照字面上的意思應該就是同步的過程程式要產生一個sync檔,但無法建立。

可是我在本機端自己建立檔案時,都沒什麼異狀,就覺得很怪。

後來就手動用複製貼上檔案的方式,發現有時後會跳出錯誤訊息,大概就是說沒有權限,要用系統管理者執行之類的,可是我就是用本機管理者帳號在執行啊。

這時突然想到,那執行freefilesync時,要用系統管理者身份去執行,有三四個在同步會跳錯誤的資料夾,就通通都沒問題了。


When using FreeFileSync on Windows Server 2019 to sync files from a remote Windows Server 2003 to the local machine, some folders encounter errors. The error message states that there is an issue with the "sync.ffs_lock" file in the local folder, with error code 5: Access refused [create file].

According to the literal meaning of the error, it seems that the sync process is unable to create the "sync" file.

However, I noticed that there were no issues when manually creating files on the local machine, which struck me as odd.

Later, while manually copying and pasting files, I encountered occasional error messages indicating a lack of permission and suggesting the need for administrator privileges. However, I was already using the local administrator account to perform the operation.

At this point, it occurred to me that when running FreeFileSync, it should be executed with administrator privileges. When I ran the program as an administrator, the folders that were previously causing errors during synchronization, about three or four of them, synced without any problems.

2023/06/02

pyinstaller py轉exe出現錯誤:The 'pathlib' package is an obsolete

 在用pyinstaller把一個py檔要轉成exe執行檔時,出現下列錯誤

The 'pathlib' package is an obsolete backport of a standard library package and is incompatible with PyInstaller. Please remove this package (located in C:\Users\helloeveryone\Anaconda3\lib\site-packages) using  conda remove then try again.

這時就執行 pip uninstall pathlib ,把pathlib移除就好,移除後不需要再重裝一次。

之後執行pyinstaller,就可以成功把py轉成exe了。



When using PyInstaller to convert a .py file into an executable (.exe) file, the following error occurs:

"The 'pathlib' package is an obsolete backport of a standard library package and is incompatible with PyInstaller. Please remove this package (located in C:\Users\helloeveryone\Anaconda3\lib\site-packages) using conda remove then try again."

To resolve this, execute "pip uninstall pathlib" to remove the pathlib package. After removing it, there is no need to reinstall it.

Afterward, running PyInstaller should successfully convert the .py file into an .exe file.


2023/06/01

Shioaji 篩選 期貨 日盤的kbars

Shioaji 在撈Kbar資料時,可以指定開始跟結束的"日期",然後就產出這段時間的一分k資料 。

假如是撈期貨的資料,就會把日盤跟夜盤的kbar全部列出來。



如果只想要日盤或夜盤,或是某幾小時內的資料時,就要做個篩選。
篩選的方式就是:
1. 先把dataframe裡的ts欄位設成index
df.set_index('ts',inplace=True) 
2. 在用between_time的功能,選出要的時間區間,就完成了。
df=df.between_time('08:44', '13:46')


可以參 考這篇
https://geek-docs.com/pandas/pandas-dataframe/python-pandas-dataframe-between_time.html





2023/05/31

永豐 e-leader 選擇權搭配autoit 做自動下單平倉 bug

 本來都有設定autoit做收盤前的自動平倉單功能。

昨天並沒開倉下單,所以就算執行了自動平倉也不會生效。

但晚上就發現居然有庫存,autoit的自動平倉居然變成開倉雙買了。

然後還賺了一點錢,好佳在,如果是雙賣就虧慘了。

然後仔細檢查了一下autoit裡面的程式,發現下單的下拉選單(開倉,停損,停利,自動)這個鈕的按鈕參數,在完全沒下過單跟有先下過單(任個一種單因)的狀況下,是不相同的。TR<>裡面那串數字會變動。

ControlCommand("e-Leader - [[6508]多次IOC :(0) TR<540001>]","","ComboBox8","SelectString",'平倉停損')

實在太奇怪了,所以如果沒下單,要把視窗關了,不然到時就會變自動開倉下單了。

2023/05/25

永豐 e-leader 選擇權收盤前搭配autoit 做自動下單平倉

 選擇權下單跟股票或期貨不一樣,沒有當沖這個功能可以選,讓單子可以在收盤自動平倉。

如果想要實現在這功能,就需要搭配autoit這個軟體來實現。

現在就是使用永豐的e-leader裡的組合單操作

1. 假設已手動下好多次IOC的組合單,而且成交了,這時後畫面就會停在原本下單的條件。


2. 這時後就開啟autoit ,設定讓程式自動做下列幾個動作
#第一個是點選"更新",抓到當下的價格
ControlClick("e-Leader","","Scintilla1")
#第二個是選到倉別的下拉選單,選到平倉停損
ControlCommand("e-Leader - [[6508]多次IOC :(0) TR<540001>]","","ComboBox8","SelectString",'平倉停損')
#第三個是下單的下拉選單,選到多次IOC,這個其實不一定要做,因為正常的話這個本來欄位本來就會停在多次IOC的選項
ControlCommand("e-Leader - [[6508]多次IOC :(0) TR<540001>]","","ComboBox7","SelectString",'多次IOC')
#第四個是點選"新增",送出這張停損單。
ControlClick("e-Leader","","Button19")
做好後轉成exe檔。

3. 在工作排程中,設定收盤前一點點的時間執行這個exe檔,為了怕沒成交要讓IOC跑一下,執行時間可能就要設在收盤前的幾十秒就要執行了。

這樣就完成了自動平倉單的設定了,在還沒寫好用shioaji的環境下,就先用autoit來做也是蠻方便的。

autoit的操作方法就自行上網找吧,上面提供的指令,還是要自己在實在時確認一下,會比較保險。



查詢DHCP IP的發送記錄

 如果想查詢近期DHCP server 的IP發送給哪一台主機,可以用下列方式查詢。

先開啟DHCP的管理工具,在server名稱按下滑鼠右鍵,選擇內容。 


接著就可以看到資料庫的路徑,進到該路徑後,就可以看到近期每天DHCP的發送記錄。



To determine which host was assigned a specific IP address by the DHCP server, you can follow these steps:

  1. Open the DHCP management tool.
  2. Right-click on the server name and select "Properties."
  3. In the properties window, you will find the database path.
  4. Navigate to the specified path, and you will be able to view the DHCP lease history for each day.
Note: Please note that the exact steps may vary depending on the DHCP management tool you are using and the version of Windows Server.

2023/05/24

chrome 部署自動清除cookie 設定

透過chrome登入某些網站後,都會產生cookie,下次在登入時,就可以不用輸入帳密就登入了,像是spotify,teams等等的網站。

但有時後卻希望網頁關閉,這些cookie就清除掉,避免下一次登入又自動使用上一次的帳密登入。

chrome的設定裡有一個清除cookie的功能,但這會清除所有的cookie,沒辦法只清除特定網站的cookie,也不太方便。






如果希望某網站的cookie在網頁關閉後清除,其實有另一個地方可以設定。
一律在視窗關閉時清除 Cookie這邊就可以把要自動清除cookie的網站加入就行了。





如果公司裡電腦很多台,要一台一台設定太麻煩了。
可以去下載chrome的adm檔(https://enterprise.google.com/chrome/chrome-browser/#download)
然後在群組原則管理工具中,新建一個gpo,先把chrome的adm新增到系統管理範本中,就可以看到裡面有google chrome的設定可以做部署。
在"將來自相符網址的cookie限制在目前的工作階段中",把網址加入,之後使用者開啟這些網站,只要關掉chrome,cookie就會刪除,不保留。


To enhance and translate the content provided:

When logging into certain websites using Chrome, cookies are generated. These cookies allow subsequent logins without the need to enter the username and password again. Websites like Spotify, Teams, and others utilize this feature.

However, there are times when you may prefer to clear these cookies upon closing the webpages to avoid automatically using the previous login credentials during the next login.

Chrome's settings include a cookie-clearing function, but it clears all cookies and lacks the ability to selectively remove cookies from specific websites, which can be inconvenient.

If you wish to automatically clear cookies from a particular website upon closing the webpage, there is another way to configure this setting. You can choose to "Clear cookies and site data when you quit Chrome" by adding the desired websites to this option.

If there are multiple computers within your company, individually configuring the settings on each one can be tedious. You can download the Chrome ADM template from (https://enterprise.google.com/chrome/chrome-browser/#download).

Next, in the Group Policy Management tool, create a new GPO and add the Chrome ADM file to the Administrative Templates section. This will allow you to see the available Google Chrome settings for deployment.

Under the "Limit cookies from sites that match the following URL" option, add the website URLs. Once users open these websites, closing Chrome will automatically delete the cookies, ensuring they are not retained.