How to TURN ON HPET
[Credit] NavJack27
to enable HPET - bcdedit /set useplatformclock true
to disable HPET - bcdedit /deletevalue useplatformclockHow 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-headers
https://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 IF
IF ~/.bash_logout exists THEN execute ~/.bash_logout END IF
IF ~/.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