如上圖,每次執行BAT檔第一行一定會出現亂碼報錯。
這有可能是該BAT檔的文件編碼選到UTF-8。
要正確顯示BAT檔,需改成ANSI格式。
可利用Notepad++或以記事本開啟BAT檔後另存新檔時將編碼改選為ANSI
以上
這有可能是該BAT檔的文件編碼選到UTF-8。
要正確顯示BAT檔,需改成ANSI格式。
可利用Notepad++或以記事本開啟BAT檔後另存新檔時將編碼改選為ANSI
以上
How to TURN ON HPET
[Credit] NavJack27
to enable HPET - bcdedit /set useplatformclock true
to disable HPET - bcdedit /deletevalue useplatformclock串AWS S3 SDK時
要下載一個項目,使用 Signature的下載方式
const getS3SignedDocumentURL = (docName) => {
const url = s3.getSignedUrl('getObject', {
Bucket: <aws-s3-bucket-name>,
Key: <aws-s3-object-key>,
Expires: <url-expiry-time>,
});
return url;
};但會因為檔案預設的 Content-Type 被 Browser 處理(例如txt就直接打開)所以需要指定一個 Content-Disposition兩個方法1.在網址後加上
String url = serverURL+'/'+bucketName+'/'+codedFilename+'?response-content-disposition='+EncodingUtil.urlEncode('attachment; filename=abc.doc','UTF-8')+'&AWSAccessKeyId='+awskey+'&Expires='+Lexpires+'&Signature='+codedsigned;
然後含這串signed的文字給後端去算signed
2.直接在Header裡加上ResponseContentDisposition: 原因是若後端已經拿算好的URI去計算Signed的話,只能靠在呼叫AWS s3 sdk 時加上ResponseContentDisposition
const getS3SignedDocumentURL = (docName) => {
const url = s3.getSignedUrl('getObject', {
Bucket: <aws-s3-bucket-name>,
Key: <aws-s3-object-key>,
Expires: <url-expiry-time>,
ResponseContentDisposition: `attachment; filename="${docName}"`
});
return url;
};
參考資料https://stackoverflow.com/questions/59684182/s3-presigned-url-multiple-content-disposition-headershttps://stackoverflow.com/questions/19046718/aws-s3-force-file-download-using-response-content-disposition
打開bash後,要編寫變數可以寫在 ~/.bash_profile 或 ~/.bashrc。
也許還聽過 /etc/profile
位置不同但效果相同,有想過這些順序和情境到底怎麼使用嗎?
execute /etc/profile
IF ~/.bash_profile exists THEN
execute ~/.bash_profile
ELSE
IF ~/.bash_login exist THEN
execute ~/.bash_login
ELSE
IF ~/.profile exist THEN
execute ~/.profile
END IF
END IF
END IFIF ~/.bash_logout exists THEN
execute ~/.bash_logout
END IFIF ~/.bashrc exists THEN
execute ~/.bashrc
END IF參考文章在此
Execution sequence for .bash_profile, .bashrc, .bash_login, .profile and .bash_logout
https://www.thegeekstuff.com/2008/10/execution-sequence-for-bash_profile-bashrc-bash_login-profile-and-bash_logout/
Cloning into 'project'... fatal: unable to access 'https://myproject.mattmytech.com:31001/project/project.git/': SSL certificate problem: unable to get local issuer certificate
git config --global http.sslVerify false
git config http.sslVerify false
// Remove 64
Windows Registry Editor Version 5.00
[-HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\MyComputer\NameSpace\{0DB7E03F-FC29-4DC6-9020-FF41B59E513A}]
[-HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Explorer\MyComputer\NameSpace\{0DB7E03F-FC29-4DC6-9020-FF41B59E513A}]
// Restore 64
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\MyComputer\NameSpace\{0DB7E03F-FC29-4DC6-9020-FF41B59E513A}]
[HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Explorer\MyComputer\NameSpace\{0DB7E03F-FC29-4DC6-9020-FF41B59E513A}]
// Remove 32
Windows Registry Editor Version 5.00
[-HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\MyComputer\NameSpace\{0DB7E03F-FC29-4DC6-9020-FF41B59E513A}]
// Restore 32
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\MyComputer\NameSpace\{0DB7E03F-FC29-4DC6-9020-FF41B59E513A}]
最後將檔案存成 .reg 即可