使用nvsm就能把cpu跟gpu、記憶體吃滿
sudo nvsm stress-test 172800 # 持續172800秒的壓力測試,即48小時。預設會把cpu、gpu、記憶體全吃滿
sudo nvsm stress-test gpu 172800 #持續48小時壓力測試,且只有測試gpu
使用nvsm就能把cpu跟gpu、記憶體吃滿
sudo nvsm stress-test 172800 # 持續172800秒的壓力測試,即48小時。預設會把cpu、gpu、記憶體全吃滿
sudo nvsm stress-test gpu 172800 #持續48小時壓力測試,且只有測試gpu
使用git的時候會出現的狀況。不過狀況還是可以區分出兩種情境:
git config --global http.sslBackend schannel
情境1的狀況,因為是本身的ssl認證狀態就是問題,所以最好就是從git的認證直接關掉:
git config --global http.sslVerify false
ref:
https://komodor.com/learn/how-to-fix-ssl-certificate-problem-unable-to-get-local-issuer-certificate-git-error/
https://forum.gitea.com/t/fatal-unable-to-access-ssl-certificate-problem-unable-to-get-local-issuer-certificate/1434
https://github.com/go-gitea/gitea/issues/8063
https://wiki.gentoo.org/wiki/Certificates
https://blog.csdn.net/sinat_24899403/article/details/114967572
1. 透過git把acme.sh下載下來
git clone https://github.com/acmesh-official/acme.sh.git
2. 進入到acme.sh資料夾後,需要進行 1) 把認證Server切換到Let's encrypt(預設是會跑到ZeroSSL,這個是要錢的) 2)進行server認證。這邊使用cloudflare服務作為範例:
#切換Server到lets encrypt
./acme.sh --set-default-ca --server letsencrypt
#跟cloudflare進行交握
./acme.sh --issue -d *.markliou.tw --dns --yes-I-know-dns-manual-mode-enough-go-ahead-please
後面會有很多字,原本預設應該是要透過Cloudflare API進行交握,過程大概就是acme會透過api把一段文字上傳到DNS紀錄當中,然後透過DNS查詢看這段文字能不能被讀取到。如果能被讀取到就表示這個網域確實是你的。
這部分我們沒有透過cloudflare api進行就必須要自己手動進行。製作方式也很簡單,吐出的文字當中大概會出現:
[Fri Sep 13 08:25:07 AM UTC 2024] Adding TXT value: 9E**************************************3TM for domain: _acme-challenge.markliou.tw
上面那段有一堆馬賽克的文字就要自己手動貼到cloudflare的DNS紀錄,記得把類別改為txt。
重新進行一次,但是要把--issue改為--renew。這邊要記得改,不然一直讓lets encrypt發送,很快就會超過它們的限制數量
./acme.sh --renew -d *.markliou.tw --dns --yes-I-know-dns-manual-mode-enough-go-ahead-please
後面就會告知申請完畢的certification在哪個folder
最後一步是要把內容轉為認證加密檔,有用的通常就是cert.pem跟key.pem兩個檔案
acme.sh --install-cert -d example.com \
--cert-file /path/to/certfile/in/apache/cert.pem \
--key-file /path/to/keyfile/in/apache/key.pem \
--fullchain-file /path/to/fullchain/certfile/apache/fullchain.pem \
--reloadcmd "service apache2 force-reload"
新版的office365在outlook部分都全面改用新介面(看起來也是全新程式),
如果自己有office365但是需要用公司信箱收信而公司也是使用Microsoft的solution(e.g. Exchange),
在新版的office365就會直接跑去驗證公司的帳號是否有訂閱。如果沒有訂閱的狀況下,就算有自行訂閱也無法使用。
這部分會造成困擾的部分就是平常大家收信也可能使用公司信箱作為日常使用,但這種作法強迫大家不能使用公司信箱作為日常使用。
微軟還是很佛心的在留言區中留下如何切換舊版outlook,在surface 11 (xelite)版本上可以順利切換:
https://support.microsoft.com/en-us/office/toggle-out-of-the-new-outlook-for-windows-preview-ec102b39-5727-418e-ae1f-a1805434640c
以修改"註解"的shortcut為例
1. Ctrl + Shift + P. 打開指令視窗
2. 找到“preferences: open keyboard shortcuts”以後點選進去
3. 搜尋"Toggle Line comment"
4. 滑鼠到那個位置以後,前面會出現一枝筆。點擊那支筆,就能輸入key combo,修改快捷。
ref: https://forum.cursor.com/t/how-do-i-change-the-keyboard-shortcuts-that-cursor-uses/33
問題症狀
Gitlab V16.11.5 (docker) 升級到 V17.0.3 出現 postgresql錯誤。錯誤內容是使用gitlab進行postgresql操作時,沒有回應。
解決辦法
造成原因是技術紅利用完了,原本的v16版本用的是postgresql v13跟v14。到了Gitlab V17時,全面改用了postgresql v14。這需要轉換。
不過之前我在進行從v11升到v16過程中,有一次postgresql v13轉到v14的過程出問題,導致接下來Gitlab進行postgresql轉換時被legancy資料卡住。
解決辦法很簡單,先把lagency資料刪除,Gitlab就能進行postgresql轉換:
1. 先開啟容器(如果就已經知道路徑也可以直接在該資料夾底下刪除,這邊統一用容器比較知道路徑)(請依照自身容器狀況修改docker參數)
sudo docker run -it --privileged -v /home/markliou/temp/cri-gitlab/volume1/cri-gitlab/config:/etc/gitlab -v /home/markliou/temp/cri-gitlab/volume1/cri-gitlab/data:/var/opt/gitlab -p 8443:443 gitlab/gitlab-ce:17.0.3-ce.0 bash
2. 刪除postgresql的legency
rm -fr /var/opt/gitlab/postgresql/data.14
然後進行database升級
gitlab-ctl reconfigure
gitlab-ctl pg-upgrade
最後重啟gitlab docker就可以了(重啟時,gitlab會自動進行gitlab-ctl reconfigure)
Basic Emergent: 1B : https://arxiv.org/pdf/2206.04615
Few shot Emergent (in-context learning) : 100B : https://arxiv.org/pdf/2206.07682
傳統的硬碟自動掛載會透過fastab進行。
但如果在硬體部分有經過更換,有可能會出現硬碟代號更動
(例如有一顆sda掛掉了,把這顆硬碟卸下以後,原本的sdb就變成sda,導致無法順利開機)
要避免這狀況就是在fstab進行掛載時,使用UUID (Universally Unique Identifiers)。
sudo blkid
底下就會列出
如果是硬碟裝置,後面就會出現UUID。
接下來就只要修改對應的UUID到fstab當中。寫法有兩種,
/etc/fstab
# /etc/fstab: static file system information.
#
# Use 'blkid' to print the universally unique identifier for a
# device; this may be used with UUID= as a more robust way to name devices
# that works even if disks are added and removed. See fstab(5).
#
# <file system> <mount point> <type> <options> <dump> <pass>
/dev/disk/by-uuid/345db9ac-d009-4d96-9axxxxxxxxxxxxxxx / ext4 defaults 0 1
UUID=345db9ac-d009-4d96-9axxxxxxxxxxxxxxx /mnt ext4 defaults 0 1
ref:
https://www.alibabacloud.com/help/en/ecs/use-cases/configure-uuids-in-the-fstab-file-to-automatically-attach-data-disks
症狀:
使用Git LFS管理檔案時,進行push或pull如果有產生x509錯誤,就表示該網域名稱沒有取得認證。這種狀況會比較常發生在實驗室內有Self-hosted的git server同時搭配self-hosted DNS。
狀況1. 要進行git clone時的解決辦法
GIT_SSL_NO_VERIFY=1 git clone ... <==適合用在要進行clone的時候
假設已經都clone下來了,但是在推拉lfs的時候出問題,就到該repo的資料夾底下
git config http.sslverify false
狀況2. 發生在gitlab-runner進行ci的時候這時候如果把上面的指令光是寫到yml是沒有用的,只能透過註冊在variables裡面,例如:stages:- build- test- release- deployvariables:REGISTRY_URL: "192.168.71.204/"CONTAINER_NAME: "xxxx:xxxx"GIT_SSL_NO_VERIFY: "true"
Ref:
https://stackoverflow.com/questions/60349972/git-lfs-give-x509-certificate-signed-by-unknown-authority
https://gitlab.com/gitlab-org/gitlab-runner/-/issues/3417
跑docker的時候噴錯如下:
runtime/cgo: pthread_create failed: Operation not permitted
SIGABRT: abort
PC=0x7f1fd83469fc m=0 sigcode=18446744073709551610
goroutine 0 gp=0x12690280 m=0 mp=0x12691580 [idle]:
runtime: g 0 gp=0x12690280: unknown pc 0x7f1fd83469fc
stack: frame={sp:0x7fffa7f376c0, fp:0x0} stack=[0x7fffa773a000,0x7fffa7f37c20)
0x00007fffa7f375c0: 0x0002f7ff0002ebe1 0x0002ffff0002fa1e
0x00007fffa7f375d0: 0x000e00ff0003134b 0x0010ffff000e01f0
0x00007fffa7f375e0: 0x0000000000000000 0x0000000000000000
0x00007fffa7f375f0: 0x0000000000000000 0x0000000000000000
0x00007fffa7f37600: 0x0002a6ff0002a6de 0x0002b73f0002b735
0x00007fffa7f37610: 0x0002b81f0002b81e 0x0002ceaf0002cea2
0x00007fffa7f37620: 0x0000000000000000 0x0000000000000000
0x00007fffa7f37630: 0x0000000000000000 0x0000000000000000
0x00007fffa7f37640: 0x0001faff0001fad7 0x0001fb930001fb93
0x00007fffa7f37650: 0x0001fbef0001fbcb 0x0001ffff0001fbfa
0x00007fffa7f37660: 0x0000000000000000 0x0000000000000000
0x00007fffa7f37670: 0x0000000000000000 0x0000000000000000
0x00007fffa7f37680: 0x0001fa8f0001fa87 0x0001faaf0001faa9
0x00007fffa7f37690: 0x0001fabf0001fab7 0x0001facf0001fac3
0x00007fffa7f376a0: 0x0000000000000000 0x0000000000000000
0x00007fffa7f376b0: 0x0000000000000000 0x00007f1fd83469ee
0x00007fffa7f376c0: <0x0000000000000000 0x0000000000000000
0x00007fffa7f376d0: 0x0000000000000000 0x0000000000000000
0x00007fffa7f376e0: 0x0000000000000000 0x0000000000000000
0x00007fffa7f376f0: 0x0000000000000000 0x0000000000000000
0x00007fffa7f37700: 0x0000000000000000 0x0000000000000000
0x00007fffa7f37710: 0x0000000000000000 0x0000000000000000
0x00007fffa7f37720: 0x0000000000000000 0x0000000000000000
0x00007fffa7f37730: 0x0000000000000000 0x0000000000000000
0x00007fffa7f37740: 0x0000000000000000 0x374c47a345892e00
0x00007fffa7f37750: 0x00007f1fd82af3c0 0x0000000000000006
0x00007fffa7f37760: 0x0000000000000001 0x00007fffa7f37a90
0x00007fffa7f37770: 0x0000000012690280 0x00007f1fd82f2476
0x00007fffa7f37780: 0x00007f1fd84cbe90 0x00007f1fd82d87f3
0x00007fffa7f37790: 0x0000000000000020 0x0000000000000000
0x00007fffa7f377a0: 0x0000000000000000 0x0000000000000000
0x00007fffa7f377b0: 0x0000000000000000 0x0000000000000000
runtime: g 0 gp=0x12690280: unknown pc 0x7f1fd83469fc
stack: frame={sp:0x7fffa7f376c0, fp:0x0} stack=[0x7fffa773a000,0x7fffa7f37c20)
如果電腦之間在這機制之前設定連動帳號,microsoft的機制很好用。但是已經有電腦連動的狀況下,這樣的設定反而破壞連動性。
要跳過這機制的,可參考以下文章:
ref: https://viml.nchc.org.tw/use-windows-11-without-microsoft-account/
1. 首先把網域放到cloudalre上進行管理
2. 到管理介面中找到左上角的設定,選取"My Profile"
3. 左邊點選API Tokens後,點選右邊的Create token
電腦之前安裝過driver(非透過apt安裝,因為apt提供的driver有時會太過老舊,deep learning使用的framework無法使用),每次ubuntu的kernel更新後又需要重新安裝時:
sudo ./NVIDIA-Linux-x86_64-545.29.02.run -s --sanity
透過 llama.cpp工具進行gguf轉檔時,在轉檔過程中出這樣的錯誤訊息。
這種錯誤源自於token model跟vocabulary檔案的output不同。通常都是vocabulary會因為客製化fine-tune過程中,使用的corpus不同,造成在進行cutomize token時,vocabulary轉變了。但進行fine-tune的人沒有發現這問題,設定檔就對不起來。
work arround的做法就是增補vocabulary檔案。想要看vocabulary資訊跟tokenize model資訊可以從:
from pathlib import Path
from transformers import AutoTokenizer
pad_no = 61952 - 61875 # 這邊放上vocalbulary和token的數量差異tokenizer_model_name = 'Breeze-7B-Instruct-v0.1' # 這邊放上要轉換的模型
model_path = 'output'
new_tokens = [f"<pad{i}>" for i in range(31)]
tokenizer = AutoTokenizer.from_pretrained(tokenizer_model_name, trust_remote_code=True)
tokenizer.pad_token = tokenizer.eos_token
tokenizer.padding_side = "right"
tokenizer.add_tokens(new_tokens)
tokenizer.save_pretrained(Path(model_path))
tokenizer.save_vocabulary(model_path)
每次commit 都會透過gpg驗證簽名。linux上的gpg工具已經很完整了,但是windows上的gpg工具不太完整,需要額外設定。
現在設定git已經安裝完畢。
1. 在ubuntu上無需作業。如果是使用windows,就需要下載gpg工具: https://gnupg.org/download/
2. 設定windows上的gpg使用位置,位置需要修改到gpg安裝的位置:
git config --global gpg.program "C:\Program Files (x86)\GnuPG\bin\gpg.exe"
3. 製作gpg key:
gpg --full-generate-key
裡面會有很多問答,就注意name跟email要跟github上面的帳號符合就可以了。
4. 把gpg public key放到github上。先看看gpg的資訊:
$ gpg --list-secret-keys --keyid-format=long
/Users/hubot/.gnupg/secring.gpg
------------------------------------
sec 4096R/3AA5C34371567BD2 2016-03-10 [expires: 2017-03-10]
uid Hubot <hubot@example.com>
ssb 4096R/4BB6D45482678BE3 2016-03-10
gpg --armor --export 3AA5C34371567BD2
這邊會產生以 -----BEGIN PGP PUBLIC KEY BLOCK----- 並以 ---END PGP PUBLIC KEY BLOCK----- 結尾的字串。整段貼到github上:
settings > ssh and gpg keys > gpg keys > new gpg key
( 可參考: https://docs.github.com/en/authentication/managing-commit-signature-verification/adding-a-gpg-key-to-your-github-account )
到這邊,github端就設定完成。
5. client端首先要進行gpg key unset。git看起來有"預設"模式,如果加密的長度跟加密方法跟預設不同就有可能無法讀取。所以最好就重跑一次unset:
git config --global --unset gpg.format
接下來把設定git會使用的gpg key,後面的ID取法就跟上面透過gpg --list-secret-keys --keyid-format=long指令取得的結果一樣,依照上面的例子就是:
git config --global user.signingkey 3AA5C34371567BD2
6. 設定每次都認證:
git config --global commit.gpgsign true
Ref:
https://stackoverflow.com/questions/36810467/git-commit-signing-failed-secret-key-not-available
https://docs.github.com/en/authentication/managing-commit-signature-verification/generating-a-new-gpg-key
https://docs.github.com/en/authentication/managing-commit-signature-verification/telling-git-about-your-signing-key
1. windows可以透過內建的ssh建立credential,但是格式跟putty的不太一樣
2.不想要產生太多private key,讓putty可以使用windows ssh建立出來的private key進行認證
到DNS server設定好text屬性後,
1.使用dig指令:
dig yourdomainname.com TXT
只要文字的話:
dig +short -t txt yourdomainname.com
2.使用host指令:
host -t txt yourdomainname.com
ref:
https://www.servercake.blog/check-txt-record-linux-terminal/
如果要進行umount但是出現target buzy sudo fuser -km 掛載點 sudo umount 掛載點 iSCSI重啟 sudo open-iscsi restart 掛載lun iscsiadm -m discovery -t sendtargets -p...