Posts with tag softwares-and-tools

Copy all upstream branches after forking only main branch

2025-03-24
gitsoftwares-and-tools

Copy all upstream branches after forking only main branchIf you've forked a Git repository but only have the main (or master) branch locally, you can fetch and track other remote branches from the original repository (upstream) into your fork. Here's how:Step 1: Add the Original Repository as upstreamIf you haven't already, add the original repo as a remote named upstream:git remote add upstream https://github.com/original-owner/original-repo.gitVerify remotes:git remote -v # Should show: # origin https://github.com/your-username/forked-repo.git (fetch/push) # upstream https://github.com/original-owner/original-repo.git (fetch)Step 2: Fetch All Branches from UpstreamFetch all branches and their commits from the original repository:git fetch upstreamThis downloads all branches (e.g., feature, dev, etc.) but doesn’t create local copies yet.Step 3: List Available Remote BranchesCheck which branches exist upstream:git branch -r # Shows remote branches (upstream/*)Example output:upstream/main upstream/feature-x upstream/devStep 4: Create Local Branches Tracking UpstreamFor each branch you want to copy (e.g., feature-x), create a local branch that tracks the upstream version:git checkout -b feature-x upstream/feature-xThis:Creates a local branch feature-x.Sets it to track upstream/feature-x.Switches you to the new branch.Repeat for other branches you need.Step 5: Push Branches to Your Fork (Optional)To make these branches available in your fork (on GitHub/GitLab), push them to origin:git push origin feature-xNow they’ll appear in your fork’s remote repository.Alternative: One-Liner to Copy All BranchesTo copy all upstream branches to local and push them to your fork:git fetch upstream for branch in $(git branch -r | grep -vE "HEAD|main"); do git checkout -b ${branch#upstream/} $branch git push origin ${branch#upstream/} doneThis script:Fetches all upstream branches.Loops through each (excluding HEAD and main).Creates local branches and pushes them to your fork.Key NotesTracking Branches: Local branches will track upstream (original repo). To track your fork instead:git branch -u origin/feature-x feature-xAvoid Conflicts: If branches already exist locally, use git checkout -B to reset them.Permissions: Ensure you have push access to your fork (origin).Let me know if you need help with a specific branch or error

Ubuntu多版本CUDA安装与切换

2025-03-12
cudasoftwares-and-tools

this article is for backpack 发表于2022-01-04|更新于2022-06-07|教程|字数总计:521|阅读时长:2分钟|阅读量:15646本文主要介绍CUDA多版本如何共存与切换,这里以cuda10.1为例。安装新版本cuda去官网选择对应安装包,这里选择runfile类型的安装文件cuda_10.1.243_418.87.00_linux.run。执行以下命令,开始安装:plaintext| | | |---|---| |1|sudo sh cuda_10.1.243_418.87.00_linux.run|依次出现如下界面:选择continue,继续。输入accept,回车接受。是否安装显卡驱动,本机已有,这里一般取消勾选是否安装工具包,默认勾选是否安装样例, 默认勾选是否安装演示套件,默认勾选是否安装文档,默认勾选勾选完毕,点击install开始安装。过程中会叫你选择是否创建指向cuda的链接:plaintext| | | |---|---| |1 <br>2|Do you want to install a symbolic link at /usr/local/cuda? <br>(y)es/(n)o/(q)uit:|如果马上想要使用当前版本,这里就选yes,否则就选no,等有需要时再设置。安装cuDNN同样去官网下载好与CUDA版本对应的安装包,文件格式为tar压缩文件cudnn-10.1-linux-x64-v7.6.4.38.tgz。① 进行解压plaintext| | | |---|---| |1|tar -zxvf cudnn-10.1-linux-x64-v7.6.4.38.tgz|② 将解压后的文件复制到新版本cuda目录plaintext| | | |---|---| |1 <br>2|sudo cp cuda/include/cudnn.h /usr/local/cuda-10.1/include <br>sudo cp cuda/lib64/libcudnn* /usr/local/cuda-10.1/lib64|③ 更改权限plaintext| | | |---|---| |1|sudo chmod a+r /usr/local/cuda-10.1/include/cudnn.h /usr/local/cuda-10.1/lib64/libcudnn*|配置环境变量修改 ~/.bashrc 文件,在末尾添加:plaintext| | | |---|---| |1 <br>2 <br>3|export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/cuda/lib64 <br>export PATH=$PATH:/usr/local/cuda/bin <br>export CUDA_HOME=$CUDA_HOME:/usr/local/cuda|按此设置后,以后更换CUDA版本无需再动环境配置。多版本切换CUDA默认安装在/usr/local下,可至此目录查看已安装版本。使用stat命令可查看当前CUDA软链接指向哪个CUDA版本:切换版本只需将软链接指向新的CUDA版本:① 删除原来的链接:plaintext| | | |---|---| |1|sudo rm -rf /usr/local/cuda|② 建立新链接,指向指定的CUDA版本:plaintext| | | |---|---| |1|sudo ln -s /usr/local/cuda-10.1 /usr/local/cuda|切换完毕后可再次通过stat命令或nvcc -V查看:文章作者: Qiyuan-Z文章链接: https://qiyuan-z.github.io/2022/01/04/Ubuntu%E5%A4%9A%E7%89%88%E6%9C%ACcuda%E5%AE%89%E8%A3%85%E4%B8%8E%E5%88%87%E6%8D%A2/版权声明: 本博客所有文章除特别声明外,均采用 CC BY-NC-SA 4.0 许可协议。转载请注明来自 Yuan!UbuntuCUDAcuDN

Build your zerotier LAN for mac, win and wsl and android

2024-10-29
softwares-and-toolszerotier

Build your zerotier LAN for mac, win and wsl and androidBasic tutorial : https://github.com/xubiaolin/docker-zerotier-planet200 Join OK on windows but windows is not listed in webui?Double check the Port you selected when ./deploy.sh is allows in your server security group!Make sure you've Easy Setup the ip range (like in tutorial) (Don't make the ip range look like your ethernet)wsl2 special partFor wsl2, if zerotier join completely failed and show cannot bind to local control interface port 9993 in zerotier-one's log:Make sure this in wslconfig, this is necessary (ref: perplexity):[boot] systemd=trueFor wsl2, also make sure /etc/ssh/sshd_config looks like this:Port 2222 # winows22端口另有他用,改为2222,避免冲突 ListenAddress 0.0.0.0 # 如果需要指定监听的IP则去除最左侧的井号,并配置对应IP,默认即监听PC所有IP PermitRootLogin yes # 如果你需要用 root 直接登录系统则此处改为 yes PasswordAuthentication yes # 将 no 改为 yes 表示使用帐号密码方式登录 AllowTcpForwarding yes AllowUsers *(Maybe necessary) Allow 2222 port in windows firewall rule settings.ssh like this: ssh [email protected] -p 2222If failed, try adding RequestTTY force in ssh config to wslSuccess!AndroidRemeber to set planet file in upright ...After setting, you need restart the appRustdeskScreen bluring?the screen orientation rustdesk got is wrong! 可能是实际竖屏,传输横屏,就雪花屏了Too high latency?Seems to relate to encoder, try other video encode like vp8 (av1 seems the best).RustdeskDirectly input your ip in rustdeskOk!ProblemsCan't ping wsl2 though webui show all devices are ONLINE?Try pinging from each other (win, wsl, mac)Do nothing and wait.Done

Setup clangd, cmake just like on unix

2024-07-03
softwares-and-toolsvscodewindows

Setup clangd, cmake just like on unixref: https://blog.csdn.net/tyKuGengty/article/details/120119820 (not reliable) ref: https://www.perplexity.ai/search/windows-shang-ru-he-huo-qu-he-UAy020tWRWG50tRSmDYuIw#0Don'tDon't use clangd exe downloaded by clangd extension in vscode.Don't need tasks.json like files.StepsInstall msys2 https://www.msys2.org/Install C++ toolchainpacman -Syu pacman -S mingw-w64-x86_64-gcc pacman -S mingw-w64-x86_64-cmake # use cmake --build ., no need make pacman -S mingw-w64-x86_64-clang pacman -S mingw-w64-x86_64-clang-tools-extra # clangd is hereFind your clangd.exe in C:\msys64\mingw64\clangd.exePut the path in your vscode clangd settings.Done.TestCreate unix like cmake projectcd buildcmake ..Reload vscode window and see if it can find headersIf you want lsp without cmakeAdd this two flags to your vscode clangd fallback flags:-IC:/msys64/mingw64/include/c++/14.1.0 --target=x86_64-w64-windows-gnucheck if a single file can find headers.(Tested ok)Use ninjaIn msys2:pacman -S mingw-w64-x86_64-ninjaWrite cmake as usual. ref: https://blog.51cto.com/u_15127539/3336648cd build # I forget if I need to specify "build for ninja". This just works on my win10 now cmake .. ninja installGo to install/bin/ and check generated executable

on ubuntu

2024-06-28
installnvidiasoftwares-and-tools

on ubuntuRef: https://blog.csdn.net/qq_30468723/article/details/107531062Ref: https://blog.csdn.net/qq_42887760/article/details/126903100Ref: https://blog.csdn.net/xiaosongshine/article/details/115720887Arch kde ref: https://www.skyone.host/2024/archlinux-plasma-faq清华源装 555.run(不含 cuda,不是 developer 搜索的是 google 搜 nvidia drivers download)装 kde。原因是,为了装驱动需进入文本界面关闭 gui 服务,但 gdm 不能直接关不然文本界面都没了,至少得装个 lightdm,那不如直接先装 sddm 的 kde 吧Kde 装好了 reboot进文本界面 systemctl status sddm 正常,gdm 没开sudo /etc/init.d/sddm stop 直接进入了一个底层的终端,没法动,重启那就 sudo telinit 3sudo service sddm stop ok!!./NVIDIA.run 说找不到 cc ,重启sudo apt install gcc g++ make 还真没装sudo ./NVIDIA.runok 现在它在加了两个 blacklist, /usr/lib 下和 /etc 重启下要删掉重启需要进 tty,如果你卡住了就 ctrl + alt + F2 之类的进 tty,运行 /.run这次要求关 Secure mode,那就重启并关闭并重启在 ./run 说找不到 pkg-config,但是能继续安装重启后进入桌面,但是桌面缩放错误,什么东西都特别大,完全操作不了~试试 https://www.skyone.host/2024/archlinux-plasma-faq 中的 nvidia-drm,重启缩放还是一样答辩sudo dpkg-reconfigure gdm3 ,虽然说 gdm3 服务 inactive 但是还是切换成功重启发现桌面正常,甚至有 nvidia-smi,那好吧直接在 gdm 下开发看

ntp synchronize time

2024-05-23
ntpsoftwares-and-tools

ntp synchronize timeby Yutong.Li @slack研究院局域网NTP同步指北:研究院路由器(IP地址:10.53.21.1)一并提供时间同步服务设置同步源:Linux(以Ubuntu为例)首先安装ntp服务:shell sudo apt-get install -y ntp编辑/etc/ntp.conf,添加一行在Debian系统上该配置文件位于/etc/ntpsec/ntp.confserver 10.53.21.1 iburst如果不需要和其他时间服务器同步,注释其他的以pool、server开头的服务器配置重启ntp服务,以便生效shell sudo systemctl restart ntp注意:可能需要检查系统有没有运行systemd-timesyncd服务,这是系统自带的较为简单的时间同步服务,如果不需要则禁用Windows在具有管理员权限的PowerShell终端中,执行:shell w32tm /config /manualpeerlist:10.53.21.1 /syncfromflags:manual /reliable:yes /update依次执行下列命令重启NTP服务shell net stop w32time net start w32time检查同步质量Linux使用ntpq -p确认同步质量shell ➜ ~ ntpq -p remote refid st t when poll reach delay offset jitter+10.53.21.1 17.253.84.251 2 u 8 64 1 5.8984 -0.1837 1.8213以下是对参数的解释:delay:这是往返到远程服务器的延迟,即5.8984毫秒。offset:这是本地系统时间与远程服务器时间的差值,即-0.1837毫秒。这个值越小,说明时间同步越准确。jitter:这是本地系统时间的抖动,即1.8213毫秒。这个值越小,说明时间同步越稳定。Windows使用w32tm /query /status确认shell ➜ ~ w32tm /query /status Leap 指示符: 0(无警告) 层次: 3 (次引用 - 与(S)NTP 同步) 精度: -23 (每刻度 119.209ns) 根延迟: 0.0596580s 根分散: 7.7647534s 引用 ID: 0x0A351501 (源 IP: 10.53.21.1) 上次成功同步时间: 2024/5/18 19:24:32 源: 10.53.21.1 轮询间隔: 10 (1024s)常见数值无线网络中,同步误差在10ms左右有线网络中,同步误差在100us左右 (已编辑

remote-ssh-failed

2024-05-21
remote-sshsoftwares-and-toolsvscode

无法在远程服务器上自动安装 VSCode Server关了梯子试试。23.9.18 这样解决的。但是随即又失败了,没有解决啊。无法连接远程,但插件 Output 有正常输出试试 https://stackoverflow.com/questions/64034813/vs-code-remote-ssh-connection-not-working 中的所有方法24.5.21(应该没有用)先删除本地 known_hosts删除远程 ~/.vscode-server/在本地 VSCode Settings 文件中加入 "remote.SSH.useLocalServer": false, "remote.SSH.useExecServer": false,成功。24.6.19error: 无法连接远程,插件输出 connectionTimeoutproblem: 在插件输出中发现 ssh 命令是 ssh -v -T -D 49942 -o ConnectTimeout=15 47.103.61.134,没有用户名很奇怪(虽然使用 remote-ssh 的时候我是带用户名的)在 ~/.ssh/config 中添加一个 config 记录,手动指定用户名和服务器Host mfa HostName 47.103.61.134 User julyfun再检查检查有没有重复的 HostName,删除重复的成功24.9.27今天即使在 ssh config 中配好了 Host,还是 SSH Timed out. 排除法发现是 vscode ssh 命令自带的 ssh -T 选项造成的超时,该选项要求不分配伪终端。结果还是通过在本地 settings 中添加此来解决: "remote.SSH.useLocalServer": false, "remote.SSH.useExecServer": false

Workflow by Gao Tian

2024-04-14
gitsoftwares-and-toolsworkflow

Workflow by Gao Tianref: https://www.bilibili.com/video/BV19e4y1q7JJ@zrx_p4ul on bilibili.com1.git clone // 到本地 2.git checkout -b xxx 切换至新分支xxx (相当于复制了remote的仓库到本地的xxx分支上 3.修改或者添加本地代码(部署在硬盘的源文件上) 4.git diff 查看自己对代码做出的改变 5.git add 上传更新后的代码至暂存区 6.git commit 可以将暂存区里更新后的代码更新到本地git 7.git push origin xxx 将本地的xxxgit分支上传至github上的git ----------------------------------------------------------- (如果在写自己的代码过程中发现远端GitHub上代码出现改变) 1.git checkout main 切换回main分支 2.git pull origin master(main) 将远端修改过的代码再更新到本地 3.git checkout xxx 回到xxx分支 4.git rebase main 我在xxx分支上,先把main移过来,然后根据我的commit来修改成新的内容 (中途可能会出现,rebase conflict -----》手动选择保留哪段代码) 5.git push -f origin xxx 把rebase后并且更新过的代码再push到远端github上 (-f ---》强行) 6.原项目主人采用pull request 中的 squash and merge 合并所有不同的commit ---------------------------------------------------------------------------------------------- 远端完成更新后 1.git branch -d xxx 删除本地的git分支 2.git pull origin master 再把远端的最新代码拉至本

create-a-tag-in-a-github-repository

2024-03-28
gitsoftwares-and-toolstag

ref: https://stackoverflow.com/questions/18216991/create-a-tag-in-a-github-repositoryYou can create tags for GitHub by either using:the Git command line, orGitHub's web interface.Creating tags from the command lineTo create a tag on your current branch, run this:git tag <tagname>If you want to include a description with your tag, add -a to create an annotated tag:git tag <tagname> -aThis will create a local tag with the current state of the branch you are on. When pushing to your remote repo, tags are NOT included by default. You will need to explicitly say that you want to push your tags to your remote repo:git push origin --tagsFrom the official Linux Kernel Git documentation for git push:--tagsAll refs under refs/tags are pushed, in addition to refspecs explicitly listed on the command line.Or if you just want to push a single tag:git push origin <tag>See also my answer to https://stackoverflow.com/questions/5195859/push-a-tag-to-a-remote-repository-using-git/23217431#23217431 for more details about that syntax above.Creating tags through GitHub's web interfaceYou can find GitHub's instructions for this at their Creating Releases help page. Here is a summary:Click the releases link on our repository page,Screenshot 1Click on Create a new release or Draft a new release,Screenshot 2Fill out the form fields, then click Publish release at the bottom,Screenshot 3 Screenshot 4After you create your tag on GitHub, you might want to fetch it into your local repository too: git fetchNow next time, you may want to create one more tag within the same release from website. For that follow these steps:Go to release tabClick on edit button for the releaseProvide name of the new tag ABC_DEF_V_5_3_T_2 and hit tabAfter hitting tab, UI will show this message: Excellent! This tag will be created from the target when you publish this release. Also UI will provide an option to select the branch/commitSelect branch or commitCheck "This is a pre-release" checkbox for qa tag and uncheck it if the tag is created for Prod tag.After that click on "Update Release"This will create a new Tag within the existing Release

git-branch

2024-03-28
branchgitsoftwares-and-tools

git branchMain Git command for working with branches. More information: https://git-scm.com/docs/git-branch.List all branches (local and remote; the current branch is highlighted by *): git branch --allList which branches include a specific Git commit in their history: git branch --all --contains commit_hashShow the name of the current branch: git branch --show-currentCreate new branch based on the current commit: git branch branch_nameCreate new branch based on a specific commit: git branch branch_name commit_hashRename a branch (must not have it checked out to do this): git branch -m old_branch_name new_branch_nameDelete a local branch (must not have it checked out to do this): git branch -d branch_nameDelete a remote branch: git push remote_name --delete remote_branch_nam

need-to-specify-how-to-reconcile-divergent-branches-when-git-pull

2024-03-28
gitpullsoftwares-and-tools

Error message ! [rejected] main -> main (non-fast-forward) error: failed to push some refs to 'github.com:julyfun/mfa.fish.git' hint: Updates were rejected because the tip of your current branch is behind hint: its remote counterpart. Integrate the remote changes (e.g. hint: 'git pull ...') before pushing again. hint: See the 'Note about fast-forwards' in 'git push --help' for details.orhint: You have divergent branches and need to specify how to reconcile them. hint: You can do so by running one of the following commands sometime before hint: your next pull: hint: hint: git config pull.rebase false # merge (the default strategy) hint: git config pull.rebase true # rebase hint: git config pull.ff only # fast-forward only hint: hint: You can replace "git config" with "git config --global" to set a default hint: preference for all repositories. You can also pass --rebase, --no-rebase, hint: or --ff-only on the command line to override the configured default per hint: invocation.First CheckCheck if you have tried git pull.Sol 1Use github desktop, just pull and no problem occurs.Sol 2git config pull.rebase falseThat's what github desktop does

start-on-mac-vscode

2024-03-26
postgresqlsoftwares-and-tools

Installref: https://wiki.qiangyin.me:38080/s/12b24b4e-b01e-4a74-b318-4e97d89f415dbrew install postgresql@14 brew services start postgresql@14 createdb $USERMake it runref: https://stackoverflow.com/questions/15301826/psql-fatal-role-postgres-does-not-existFor MAC: Install Homebrew brew install postgres initdb /usr/local/var/postgres /usr/local/Cellar/postgresql/<version>/bin/createuser -s postgres or /usr/local/opt/postgres/bin/createuser -s postgres which will just use the latest version. start postgres server manually: pg_ctl -D /usr/local/var/postgres start To start server at startup mkdir -p ~/Library/LaunchAgents ln -sfv /usr/local/opt/postgresql/*.plist ~/Library/LaunchAgents launchctl load ~/Library/LaunchAgents/homebrew.mxcl.postgresql.plist Now, it is set up, login using psql -U postgres -h localhost or use PgAdmin for GUI. By default user postgres will not have any login password. Check this site for more articles like this: https://medium.com/@Nithanaroy/installing-postgres-on-mac-18f017c5d3f7Vscode extensionChris Kolkman's PostgreSQL

start-on-macos

2024-03-21
mysqlsoftwares-and-tools

ref (unreliable): https://stackoverflow.com/questions/15450091/error-2002-hy000-cant-connect-to-local-mysql-server-through-socket-tmp-mysDownload dmg from official. Something like https://cdn.mysql.com//Downloads/MySQL-8.3/mysql-8.3.0-macos14-arm64.dmg .Run the dmg. You will have cli tools then, now you have:~ λ mysql --version mysql Ver 8.3.0 for macos13.6 on arm64 (Homebrew)brew services start mysql or something else to start mysql service.==> Successfully started `mysql` (label: homebrew.mxcl.mysql)mysql_secure_installationNext, see the following history:~ λ sudo mysql Password: ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO) ~ λ sudo chown -R _mysql:mysql /usr/local/var/mysql chown: /usr/local/var/mysql: No such file or directory ~ λ sudo mysql.server start Starting MySQL . ERROR! The server quit without updating PID file (/opt/homebrew/var/mysql/floriandeMacBook-Air.local.pid). ~ λ mysql -u root -p h127.0.0.1 Enter password: ERROR 1049 (42000): Unknown database 'h127.0.0.1' ~ λ mysql -u root -p Enter password: Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 12 Server version: 8.3.0 MySQL Community Server - GPL Copyright (c) 2000, 2024, Oracle and/or its affiliates. Oracle is a registered trademark of Oracle Corporation and/or its affiliates. Other names may be trademarks of their respective owners. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. mysql> CREATE USER 'julyfun'@'localhost' IDENTIFIED BY 'guest123'; Query OK, 0 rows affected (0.03 sec)You can now install, in vscode, the MySql extension by Wejian Chen.Better notbrew install mysql / mariad

proxychains

2024-01-31
cli-toolssoftwares-and-tools

问题情况从 SJTU 开着梯子访问 github 比较流畅,不排除是因为 SJTU 网络自带 github。回杭州以后开着梯子上 Ubuntu,能 Chrome 上 github 但命令行 ssh -T [email protected] 都不行。其实写完此文以后第二天莫名其妙又可以直接 ssh -T [email protected] 了。安装 proxychains首先需要一个梯子。比如 clash-for-windows + 一个机场,clash-for-windows 的 port 为 7890ref: https://zhuanlan.zhihu.com/p/166375631sudo apt install proxychains配置 proxychainssudo vim /etc/proxychains.confdynamic_chain 的注释;注释掉 strict_chain在末尾 [ProxyList] 中添加 socks5 127.0.0.1 7890 其中端口号取决于你 vpn 的 port(通常不需要)设置 git 的代理git config --global https.proxy 'socks://127.0.0.1:7890' git config --global http.proxy 'http://127.0.0.1:7890'(通常不需要)检查 Shell 配置文件中是否正确配置了 proxy 环境变量例如在 fish shell 中是:set -gx https_proxy http://127.0.0.1:7890 set -gx http_proxy http://127.0.0.1:7890 set -gx all_proxy socks5://127.0.0.1:7890使用 proxychainsproxychains ssh -T [email protected] 例如:ProxyChains-3.1 (http://proxychains.sf.net) |DNS-request| github.com |D-chain|-<>-127.0.0.1:7890-<><>-4.2.2.2:53-<><>-OK |DNS-response| github.com is 20.205.243.166 |DNS-request| github.com |D-chain|-<>-127.0.0.1:7890-<><>-4.2.2.2:53-<><>-OK |DNS-response| github.com is 20.205.243.166 |D-chain|-<>-127.0.0.1:7890-<><>-20.205.243.166:22-<><>-OK Hi julyfun! You've successfully authenticated, but GitHub does not provide shell access.若 proxychains git push 要你输入 http://github.com 的若应该强制 git 走 sshref: https://ricostacruz.com/posts/github-always-sshgit config --global url."[email protected]:".insteadOf "https://github.com/"verified on 2024-5-6, ubuntu 20.0

python-debug

2024-01-23
debugpythonsoftwares-and-toolsvscode

This method is verified!https://code.visualstudio.com/docs/python/debugginghttps://stackoverflow.com/questions/51244223/visual-studio-code-how-debug-python-script-with-arguments开始vscode cmd: show run and debug.click 'create launch.json'A file is created.If you wanna run shell script for python like this:CUDA_VISIBLE_DEVICES=0 python cloth_funnels/run_sim.py \ name="demo-single" \ load=models/longsleeve_canonicalized_alignment.pth \ eval_tasks=assets/tasks/longsleeve-single.hdf5 \ eval=True \ num_processes=1 \ episode_length=10 \ wandb=disabled \ fold_finish=True \ dump_visualizations=True Add args like, [tested ok]:{ // Use IntelliSense to learn about possible attributes. // Hover to view descriptions of existing attributes. // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 "version": "0.2.0", "configurations": [ { "name": "Python: 当前文件", "type": "python", "request": "launch", "program": "${file}", // "program": "${workspaceFolder}/script/eval_policy.py", // 这样也行 "console": "integratedTerminal", "args": ["name=\"demo-single\"", "load=models/longsleeve_canonicalized_alignment.pth", "eval_tasks=assets/tasks/longsleeve-single.hdf5", "eval=True", "num_processes=1", "episode_length=10", "wandb=disabled", "fold_finish=True", "dump_visualizations=True"], "env": { "CUDA_VISIBLE_DEVICES": "0", "HYDRA_FULL_ERROR": "1", }, } ] }Switch to the file you want to run (as in launch.json we by default designate "Run current file", so you have to switch to the exact file to run).Add a breakpoint,Click the green delta in "Run python and debug" menu,Everything is well! And watch params in the menu!RemoteUsing vscode-ssh is also ok to run python debug in remote machine

edit-connection-rule

2024-01-15
clashsoftwares-and-tools

参见:https://jichanggo.com/clash%E9%AB%98%E7%BA%A7%E8%BF%9B%E9%98%B6%E6%95%99%E7%A8%8BChoose a profile (like xxx.yaml)Not stable methodEdit. In rules array, add:- DOMAIN-SUFFIX,openai.com,Proxy表示后缀为 openai.com 的网站走代理但是你编辑这个文件可能会被机场覆盖。长期修改: Mixin修改 Mixin 文件,例如在 clash for windows 里在 Settings -> Mixin -> YAML -> Edit 中,修改如下:mixin: # object rules: - "DOMAIN-SUFFIX,openai.com,Proxy" - "DOMAIN-SUFFIX,bilibili.com,DIRECT"记得开启 Mixin 模式,cfw 中在首页。如果 yaml 一 Mixin 就炸(指全部走直连了)那就用 js 文件吧。选择用 Javascript 而不是 yaml,然后写:module.exports.parse = async ( { content, name, url }, { yaml, axios, notify } ) => { content.rules.unshift("DOMAIN-KEYWORD,wikimedia,Proxy"); return {...content}; }

use-gdb

2024-01-15
softwares-and-tools

在GDB(GNU调试器)中,您可以使用以下命令来实现这些功能:单步执行进入你感兴趣的函数:使用step(简写为s)命令来单步执行,并进入函数内部。单步执行跳过你不感兴趣的函数:使用next(简写为n)命令来单步执行,但是跳过函数调用,直接执行函数体内的语句。运行到函数末尾:使用finish(简写为fin)命令来继续执行,直到当前函数执行完毕并返回。打印变量或寄存器的值:使用print(简写为p)命令来打印变量或寄存器的值。例如:p variable 打印变量 variable 的值。扫描内存:使用x命令来扫描内存。例如:x/nfu address,其中 n 表示扫描的单位长度,f 表示显示格式,u 表示重复次数,address 是要扫描的内存地址。例如:x/4xw &variable 扫描变量 variable 的前 4 个字(32位)的十六进制值。查看调用栈:使用backtrace(简写为bt)命令来查看调用栈,显示当前的函数调用关系和各函数的参数和返回地址。设置断点:使用break(简写为b)命令来设置断点。例如:b function 在函数 function 的第一条指令处设置断点。设置监视点:使用watch 命令来设置监视点,当被监视的表达式的值发生变化时,程序会停下来。例如:watch variable 监视变量 variable 的值。这些命令可以帮助您在调试过程中控制程序的执行流程,并查看相关的变量和内存内容。您可以在GDB中使用help命令来获取更详细的帮助信息,例如help break将显示有关break命令的更多信息。要查看断点列表和监视点列表,您可以使用以下命令:查看断点列表:使用info breakpoints(简写为info b)命令来查看当前已设置的断点列表。该命令将显示所有已设置的断点,包括断点编号、断点类型、断点位置等详细信息。查看监视点列表:使用info watchpoints(简写为info watch)命令来查看当前已设置的监视点列表。该命令将显示所有已设置的监视点,包括监视点编号、监视点类型、监视点表达式等详细信息。这些命令将提供有关已设置的断点和监视点的信息,以便您了解当前调试会话中的各个断点和监视点。补充c: continue the program.r: start the program

拉取基础镜像

2024-01-15
dockersoftwares-and-tools

docker build . --network=hosthttps://www.cnblogs.com/freeaihub/p/13206077.html在 Dockerfile 中这么写:ENV https_proxy "127.0.0.1:7890"#source #dialog xy_cppdocker-compose 桥接要这么写:environment: - http_proxy=http://host.docker.internal:7890 - https_proxy=http://host.docker.internal:7890 - MYSQL_PASSWORD=nextclouddocker-compose up -d参考一个 xy_cpp 的 DockerfileARG CUDA_VERSION=12.0.0 ARG CUDNN_VERSION=8 ARG OS_VERSION=22.04 # 拉取基础镜像 FROM nvidia/cuda:${CUDA_VERSION}-cudnn${CUDNN_VERSION}-devel-ubuntu${OS_VERSION} LABEL maintainer="XY_cpp" WORKDIR /root # 时区 ENV TZ=Asia/Shanghai \ DEBIAN_FRONTEND=noninteractive RUN apt update && \ apt install -y tzdata && \ ln -fs /usr/share/zoneinfo/${TZ} /etc/localtime && \ echo ${TZ} > /etc/timezone && \ dpkg-reconfigure --frontend noninteractive tzdata && \ rm -rf /var/lib/apt/lists/* # TensorRT ARG TRT_VERSION=8 COPY TensorRT${TRT_VERSION}-${CUDA_VERSION}.tar.gz tensorrt.tar.gz RUN tar -xzvf tensorrt.tar.gz && mv TensorRT-* /opt/TensorRT && rm -rf tensorrt.tar.gz ENV LD_LIBRARY_PATH=/opt/TensorRT/lib${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}} # 开发环境 # 项目源代码 VOLUME SRM-IC-2022 # 基础软件包 RUN apt update && \ apt install -y g++ cmake clangd && \ apt install -y wget vim git zsh && \ apt install -y libceres-dev libopencv-dev && \ rm -rf /var/lib/apt/lists/* # 海康相机库 COPY MVS.tar.gz MVS.tar.gz RUN tar -xzvf MVS.tar.gz && mv MVS /opt/MVS && rm -rf MVS.tar.gz # zsh(更好看的终端,可选) RUN apt update && \ apt install -y git wget vim zsh && \ rm -rf /var/lib/apt/lists/* # 请将此处修改为梯子的代理端口,否则无法连接到Github ENV https_proxy "127.0.0.1:7890" RUN wget --no-check-certificate https://github.com/robbyrussell/oh-my-zsh/raw/master/tools/install.sh -O - | sh && \ git clone https://github.com/zsh-users/zsh-autosuggestions ${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}/plugins/zsh-autosuggestions && \ git clone https://github.com/zsh-users/zsh-syntax-highlighting.git ${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting && \ chsh -s $(which zsh) && \ rm -rf /var/lib/apt/lists/* COPY zshrc /root/.zshrc RUN unset https_proxy CMD ["/bin/zsh"] # bash(不好看的终端,可选) #CMD ["/bin/bash"

aliyun-git-commit-message

2024-01-15
gitsoftwares-and-tools

https://developer.aliyun.com/article/770277commit message格式<type>(<scope>): <subject>type(必须)用于说明git commit的类别,只允许使用下面的标识。feat:新功能(feature)。fix/to:修复bug,可以是QA发现的BUG,也可以是研发自己发现的BUG。fix:产生diff并自动修复此问题。适合于一次提交直接修复问题 to:只产生diff不自动修复此问题。适合于多次提交。最终修复问题提交时使用fix docs:文档(documentation)。style:格式(不影响代码运行的变动)。refactor:重构(即不是新增功能,也不是修改bug的代码变动)。perf:优化相关,比如提升性能、体验。test:增加测试。chore:构建过程或辅助工具的变动。revert:回滚到上一个版本。merge:代码合并。sync:同步主线或分支的Bug。scope(可选)scope用于说明 commit 影响的范围,比如数据层、控制层、视图层等等,视项目不同而不同。例如在Angular,可以是location,browser,compile,compile,rootScope, ngHref,ngClick,ngView等。如果你的修改影响了不止一个scope,你可以使用*代替。subject(必须)subject是commit目的的简短描述,不超过50个字符。建议使用中文(感觉中国人用中文描述问题能更清楚一些)。结尾不加句号或其他标点符号。根据以上规范git commit message将是如下的格式:fix(DAO):用户查询缺少username属性feat(Controller):用户查询接口开发以上就是我们梳理的git commit规范,那么我们这样规范git commit到底有哪些好处呢?便于程序员对提交历史进行追溯,了解发生了什么情况。一旦约束了commit message,意味着我们将慎重的进行每一次提交,不能再一股脑的把各种各样的改动都放在一个git commit里面,这样一来整个代码改动的历史也将更加清晰。格式化的commit message才可以用于自动化输出Change log

nvim-and-packer-old

2024-01-15
neovimsoftwares-and-tools

使用系统粘贴板in init.vim:set clipboard=unnamedplus~/.config/nvimnvim ├── init.vim └── lua └── plugins.lua注意在 init.vim 中加入 lua 语句:lua require('plugins')其中的 plugins.lua 来自https://github.com/wbthomason/packer.nvim在 Packer plugins.lua 中加入新的插件在 return 的内部而不是外部: use({ 'rose-pine/neovim', as = 'rose-pine' }) vim.cmd('colorscheme rose-pine')fish 没有高亮nvim 版本太低如果装了 Packer 以后一进 nvim 就报错Error detected while processing /home/strife/.local/share/nvim/plugged/nvim-treesitter/plugin/nvim-treesitter.lua: E5113: Error while calling lua chunk: .../plugged/nvim-treesitter/lua/nvim-treesitter/configs.lua:104: attempt to call field 'nvim_create_augroup' (a nil value)这是因为 nvim 版本太低再装一个 vim-plughttps://github.com/junegunn/vim-plug然后再装一个多光标https://github.com/mg979/vim-visual-mult

subdomain

2024-01-15
nginxsoftwares-and-tools

#source xy_cpp在服务商那边加入一个通配符,如xy_cpp: 第一个不用管然后参考以下文件:❯ cat /etc/nginx/sites-enabled/srm.icu server { server_name srm.icu git.srm.icu cloud.srm.icu; location / { proxy_pass http://127.0.0.1:8081; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; } listen 443 ssl; # managed by Certbot ssl_certificate /etc/letsencrypt/live/srm.icu/fullchain.pem; # managed by Certbot ssl_certificate_key /etc/letsencrypt/live/srm.icu/privkey.pem; # managed by Certbot include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot } server { if ($host = cloud.srm.icu) { return 301 https://$host$request_uri; } # managed by Certbot if ($host = git.srm.icu) { return 301 https://$host$request_uri; } # managed by Certbot if ($host = srm.icu) { return 301 https://$host$request_uri; } # managed by Certbot server_name srm.icu git.srm.icu cloud.srm.icu ; listen 80; return 404; # managed by Certbot }xy_cpp: 这个没有证书的话删掉ssl的相关配置 哦你不同域名跑不同东西就分开来写 我那个是全部转发到8001,然后8001转发到内网穿透 内网再做一次判断

default-init-vim

2024-01-15
neovimsoftwares-and-tools

" Configuration file for vim set modelines=0 " CVE-2007-2438 " Normally we use vim-extensions. If you want true vi-compatibility " remove change the following statements set nocompatible " Use Vim defaults instead of 100% vi compatibility set backspace=2 " more powerful backspacing " Don't write backup file if vim is being called by "crontab -e" au BufWrite /private/tmp/crontab.* set nowritebackup nobackup " Don't write backup file if vim is being called by "chpass" au BufWrite /private/etc/pw.* set nowritebackup nobackup " 自定义设置 " set mouse=a let skip_defaults_vim=1 syntax enable " 打开语法高亮 syntax on " 开启文件类型侦测 colorscheme desert " 着色模式:灰色背景 set guifont=Monaco:h14 set autoindent " 自动对齐 set backspace=2 " 设置退格键可用 set cindent shiftwidth=4 " 自动缩进4空格 set smartindent " 智能自动缩进 set ai! " 设置自动缩进 set nu! " 显示行号 set showmatch " 显示括号配对情况 " set mouse=a " 启用鼠标 set ruler " 右下角显示光标位置的状态行 set incsearch " 查找book时,当输入/b时会自动找到 set hlsearch " 开启高亮显示结果 set incsearch " 开启实时搜索功能 set nowrapscan " 搜索到文件两端时不重新搜索 set nocompatible " 关闭兼容模式 set cursorline " 突出显示当前行 set hidden " 允许在有未保存的修改时切换缓冲区 set list " 显示Tab符,使用一高亮竖线代替 set listchars=tab:\|\ " 显示Tab符,使用一高亮竖线代替 set noswapfile " 设置无交换区文件" set writebackup " 设置无备份文件 set nobackup " 设置无备份文件 set autochdir " 设定文件浏览器目录为当前目录 set foldmethod=syntax " 选择代码折叠类型 set foldlevel=100 " 禁止自动折叠 set laststatus=2 " 开启状态栏信息 set cmdheight=2 " 命令行的高度,默认为1,这里设为2 set showtabline=2 " 设置默认显示标签 set clipboard+=unnamed " 与系统公用剪贴板 set autoread " 当文件在外部被修改,自动更新该文件 set scrolloff=5 " 设定光标离窗口上下边界 5 行时窗口自动滚动 set guioptions-=T " 去掉上方工具栏 set autochdir " 自动切换到当前目录" set autoread " 自动检测并加载外部对文件的修改" set autowrite " 自动检测并加载外部对文件的修改" set showcmd " 命令栏显示命令 " set ignorecase smartcase " 搜索时智能忽略大小写 set tabstop=4 " (ts) 设置一个 <tab> 显示为多少个空格 set expandtab " (et) 把 <tab> 转换为空格 set shiftwidth=4 " (sw) 设置自动缩进的宽度(以及 << 和 >> 命令) set number set relativenumber " [总是使用系统粘贴板] set clipboard=unnamedplus " [删除而不是剪切] nnoremap d "_d vnoremap d "_d nnoremap D "_D vnoremap D "_D nnoremap c "_c vnoremap c "_c nnoremap C "_C vnoremap C "_C xnoremap p pgvy " [括号补全] inoremap ' ''<ESC>i inoremap " ""<ESC>i inoremap ( ()<ESC>i inoremap [ []<ESC>i inoremap { {}<ESC>i " [vim-plug] call plug#begin() Plug 'mg979/vim-visual-multi', {'branch': 'master'} call plug#end() " [添加 Packer] lua require('plugins'

quick-line-jumps

2024-01-15
neovimsoftwares-and-tools

https://github.com/Houl/repmo-vim/tree/masterput this autoload in your nvim autoloadand paste stuffs like" map a motion and its reverse motion: :noremap <expr> h repmo#SelfKey('h', 'l')|sunmap h :noremap <expr> l repmo#SelfKey('l', 'h')|sunmap l " if you like `:noremap j gj', you can keep that: :map <expr> j repmo#Key('gj', 'gk')|sunmap j :map <expr> k repmo#Key('gk', 'gj')|sunmap k " repeat the last [count]motion or the last zap-key: :map <expr> ; repmo#LastKey(';')|sunmap ; :map <expr> , repmo#LastRevKey(',')|sunmap , " add these mappings when repeating with `;' or `,': :noremap <expr> f repmo#ZapKey('f')|sunmap f :noremap <expr> F repmo#ZapKey('F')|sunmap F :noremap <expr> t repmo#ZapKey('t')|sunmap t :noremap <expr> T repmo#ZapKey('T')|sunmap T " 只记忆 count jumps :let g:repmo_require_count = 1in your init.vim.Usage5j;;;;hjkl;;;It will remember 5j, not one of hjkl.just kidding, although https://www.vim.org/scripts/script.php?script_id=2174 says so, it doesn't seem to work now

nvidia-driver.1

2024-01-15
nvidiasoftwares-and-tools

test on: 16.04Linux ubuntu16-1080Ti 4.15.0-112-generic #113~16.04.1-Ubuntu SMP Fri Jul 10 04:37:08 UTC 2020 x86_64 x86_64 x86_64 GNU/Linuxnvidia-smi and nvidia-detector看起来天生自带的。Now, nvidia-detector cmd shows none.when there's no nvidia-smi我 apt install nvidia-384 然后报错了,直接搞没啦!junjie@ubuntu16-1080Ti:~$ nvidia-smi Failed to initialize NVML: Driver/library version mismatchWell you should reboot! as in https://stackoverflow.com/questions/43022843/nvidia-nvml-driver-library-version-mismatch如果不行,执行下面的东西,你看得懂吧?https://askubuntu.com/questions/902636/nvidia-smi-command-not-found-ubuntu-16-04sudo apt purge nvidia-* sudo add-apt-repository ppa:graphics-drivers/ppa sudo apt update sudo apt install nvidia-38

old-nvidia-smi-or-called-driver

2024-01-15
nvidiasoftwares-and-tools

来自 yuanzhi 老学长的建议直接搜 cuda-toolkit 装。虽然 nvidia 官方貌似只提供 16.04 的 toolkit.run,然而似乎在 18.04 上也可以直接 run.那么这个时候你要搜索老版本 ubuntu 上关闭图形界面以后装 nvidia 驱动的方式。为什么要禁用图形界面 + reboot 呢,老夫也不知道。而且 reboot 以后是一个分辨率很低的可视化界面,这时候你按 F1 进入命令行界面。run 了以后是一个 TUI 打钩界面,其中甚至包含 nvidia-smi。一般有 smi 的情况下 smi 不打钩,但是如果没有 smi 就打钩。23.9.19 以上方法(用 cuda.run 装 nvidia-smi)报错了,要先装 nvidia-smi 再装 cuda.纯 ssh 尝试这次是要把 nvidia-driver 384 换成 nvidia-driver 470. 因为 384 不支持 cuda 9.2.先 sudo apt purge nvidia-*. 它删除了 1G 多的东西,其中看起来还有 cuda-toolkit 相关,只不过后缀有 384 所以我肯定就不要了。先下载一个驱动.run:搜索: https://www.nvidia.com/en-us/geforce/drivers/搜索结果: https://www.nvidia.com/en-us/geforce/drivers/results/205995/然后跑这个 run。跑得时候因为在 16.04 上,它会直接告诉你: You seem to be using an X server, stop it.于是我就按照 https://askubuntu.com/questions/149206/how-to-install-nvidia-run : 990 top | grep Xorg 991 kill -9 Xorg 992 kill -9 1114 993 sudo kill -9 1114 994 ls 995 ./470.run 996 sudo ./470.run 997 ps -ef | grep Xorg 998 ps -ef | grep X 999 sudo service lightdm stop 1000 sudo lightdm stop 1001 ls 1002 sudo killall Xorg然后可以跑了,跑的时候他说要不要 kernal xxx,我本来想退出的选了 No,然而它继续往下跑了,他说要不要装兼容 32 位的我说不要。接下来sudo reboot其他啥都没干居然好了

record-nvidia-smi-fix-230918

2024-01-15
nvidiasoftwares-and-tools

9949 sudo ln -sfT /etc/alternatives/cuda/cuda-11.1 /usr/local/cuda 9950 ls 9951 ls -l 9952 nv 9953 nvcc -V 9954 tmux a -t auto_train 9955 cd GarmentImitation/manifests/workflows 9956 ls 9957 vim train.yaml 9958 cat train.yaml 9959 tmux a -t auto_train 9960 cd GarmentImitation/ 9961 make manipulation.train_tshirt_short START_EPISODE_SHORT=$(cat $HOME/.unifolding/config/EPISODE_IDX) MODEL_CKPT_PATH_SHORT=$(cat $HOME/.unifolding/config/WORKING_DIR ) 9962 python 9963 nvcc -V 9964 ls /usr/local 9965 j local 9966 ls 9967 ls -l 9968 ls 9969 ls -l 9970 nvcc -V 9971 ls 9972 vim ~/.zshrc 9973 ls 9974 history 9975 sudo adduser junjie 9976 sudo visudo 9977 ls 9978 cd /usr/local 9979 ls 9980 ll 9981 ls 9982 lsls 9983 ls 9984 rm cuda 9985 sudo rm cuda 9986 sudo rm cuda-11 9987 ln -s /usr/local/cuda-11.3 /usr/local/cuda 9988 sudo ln -s /usr/local/cuda-11.3 /usr/local/cuda 9989 ll 9990 nvcc -V 9991 vim ~/.zshrc 9992 pip uninstall open3d 9993 pip install open3d 9994 nvcc -V 9995 vim ~/.zshrc 9996 source ~/.zshrc 9997 nvcc -V 9998 conda activate speedfolding 9999 python 10000 cat /var/log/dpkg.log | grep nvidia 10001 history | grep apt 10002 conda activate speedfolding 10003 python 10004 nvidia-smi 10005 sudo apt-get --purge remove cuda-11-1 10006 nvidia-smi 10007 sudo apt-get autoremove 10008 nvcc -V 10009 sudo apt-get autoclean 10010 cd /usr/local 10011 ll 10012 sudo rm -rf cuda-11.1 10013 nvidia-smi 10014 sudo apt uninstall cuda 10015 cd Downloads/ 10016 cd ~/Downloads 10017 ls 10018 sudo apt-get remove nvidia-* 10019 sudo apt-get install nvidia-driver-535 10020 nvidia-smi 10021 cd ~/Downloads 10022 ls 10023 ubuntu-drivers devices 10024 nvidia-smi 10025 sudo apt remove nvidia-* 10026 sudo apt remove nvidia* 10027 sudo apt-get remove nvidia* 10028 nvidia-smi 10029 nvcc -V 10030 conda activate speedfolding 10031 python 10032 pycharm.sh 10033 tmux a -t auto_train 10034 tmux new -s auto_train 10035 cd GarmentImitation/manifests/workflows 10036 ls 10037 conda activate speedfolding 10038 make daemon.workflow_keeper 10039 ls 10040 nvidia-smi 10041 conda activate speedfolding 10042 cd GarmentImitation/ 10043 conda activate speedfolding 10044 git pull 10045 git stash Makefile 10046 git diff Makefile 10047 git diff 10048 git stash -h 10049 git stash push -m makefile Makefile 10050 git pull 10051 git stash list 10052 git stash pop 10053 vim Makefile 10054 git stash pop 10055 vim Makefile 10056 git add Makefile 10057 git stash pop 10058 git stash drop 0 10059 git stash list 10060 vim Makefile 10061 git add Ma 10062 git add Makefile 10063 make daemon.workflow_keeper 10064 tmux new -s auto_train 10065 tmux a 10066 cd .. 10067 make daemon.workflow_keeper 10068 cd GarmentImitation 10069 l 10070 sls 10071 ls 10072 cd manifests/workflows 10073 ls 10074 vim train.yaml 10075 curl http://127.0.0.1:8082/v1/scheduled_workflows 10076 vim train.yaml 10077 curl http://127.0.0.1:8082/v1/scheduled_workflows 10078 pip install workfow-keeper==0.0.3 10079 pip install -i https://pypy.org/simple workfow-keeper==0.0.3 10080 pip install -i https://pypy.org/simple workflow-keeper==0.0.3 10081 pip install -i https://pypy.org/simple workflow-keeper 10082 pip install workflow-keeper 10083 pip install packaging==21.3 10084 pip uninstall black 10085 python -m workflow_keeper serve --api_port=8083 10086 python -m workflow_keeper serve --api.port=8083 10087 curl http://127.0.0.1:8082/v1/scheduled_workflows 10088 curl http://127.0.0.1:8082/v1/scheduled_workflows | jq 10089 apt-get install jq 10090 sudo apt-get install jq 10091 curl http://127.0.0.1:8082/v1/scheduled_workflows | jq 10092 make robot.console.right 10093 make robot.console.l 10094 make robot.console.left 10095 make manipulation.run_tshirt_short 10096 ls 10097 cd GarmentImitation 10098 ls 10099 cd log 10100 ls 10101 cd experiment_real 10102 ls 10103 chmod -R 777 tshirt_short_action14_real_corl_v2 10104 conda activate speedfolding 10105 chmod -R 777 tshirt_short_action14_real_corl_v2 10106 ls 10107 cd GarmentImitation 10108 ls 10109 cd log 10110 ls 10111 cd log experiment_real 10112 cd experiment_real 10113 chmod -R 777 tshirt_short_action14_real_corl_v2 10114 sudo chmod -R 777 tshirt_short_action14_real_corl_v2 10115 vim ~/.unifolding/config/WORKING_DIR 10116 make manipulation.test_tshirt_short 10117 conda activate speedfolding 10118 make robot.console.left 10119 sudo chmod -R 777 tshirt_short_action14_real_corl_v2 10120 make robot.console.left 10121 make manipulation.run_tshirt_short 10122 umask 002 10123 make manipulation.test_tshirt_short 10124 make robot.console.left 10125 vim ~/.zshrc 10126 cd GarmentImitation/manifests/workflows 10127 vim train.yaml 10128 vim data_collection_virtual.yaml 10129 make handey

脚本代码和物体是怎么关联的

2024-01-15
softwares-and-toolsunity

代码内容里面不会写和物体的绑定。一个脚本代码里面有一个 class,写完以后你把项目栏目中的代码文件拖动到物体上,就会使物体具有这个行为。神奇吧。一个脚本里面只能有一个和文件名同名的 public class,你在里面描述一类物体的行为,此时还没有和任何物体实例进行绑定。描述完物体之后,你把脚本拖动到物体上,物体就会拥有这个行为逻辑。一个物体可以有多个行为逻辑,因为实际上 unity 将脚本链接向一个 list,list 里面是其所绑定的物体,在游戏开始时,每一帧按照一个顺序列表依次执行所有脚本。脚本执行顺序可以在编辑 - 项目管理中设置

怎么用-vscode-写-unity-脚本-以及-intellisense

2024-01-15
softwares-and-toolsunityvscode

https://zhuanlan.zhihu.com/p/245846735其中的 Mono SDK 似乎不用安装也可以。安装后重启电脑!然后再从 unity 打开脚本,intellisense 可以正常用了!甚至可以点开外部库函数!以上测试日期 23-11-3,uname -a 为:Darwin floriandeMacBook-Air.local 22.5.0 Darwin Kernel Version 22.5.0: Mon Apr 24 20:53:44 PDT 2023; root:xnu-8796.121.2~5/RELEASE_ARM64_T8103 arm64但是过了一会儿 intellisense 又没了。又提示“在计算机上找不到已安装的 .NET SDK”。所以我再次重启电脑。重启后 vscode C# 插件通知:某插件只适用于 SDK 样式项目,是否要为工作区使用 C# 插件?我说好的,然后 intellisense 又回来了。过几天没有 intellisense 了,提示 C# 插件只适用于 SDK 样式项目让你选择要不要为工作区使用 C# 插件。你就选择使用。然后它让你重启工作区,就有智能提示了。过几天又“在计算机上找不到 .NET SDK” ... path...重启电脑,没啥办法。另一个可能的方案https://zhuanlan.zhihu.com/p/601343633?utm_id=

c-cmake-debug

2024-01-15
debugsoftwares-and-toolsvscode

原理是这样的,你编译出来的可执行文件只要是编译的时候开了 Debug 的时候,是可以直接调试的。所以你在 cmakelists.txt 加上:set(CMAKE_BUILD_TYPE "Debug")然后去 cmake + make 一下。现在,用 vscode 命令面板唤出 debug 面板。面板里有一个链接让你创建 launch.json。你点击会让你选择调试环境,你选 LLDB 他生成一个 json,然后这个 json 内容改成这样:{ "version": "0.2.0", "configurations": [ { "type": "lldb", "request": "launch", "name": "Debug", "program": "${workspaceFolder}/build/demo", "args": [], "cwd": "${workspaceFolder}" } ] }这边 "program" 条目你改成要执行的文件。没错直接可执行文件就行了。现在在源文件里面加一个断点,然后捏点击 debug 面板上方的播放按钮。他就会停在断点了。还会出现一个小长条工具栏,用来到下一行、跳转行等。一般你用 F10 逐过程,避免进入每个函数。如果你要输入数据,就在面板的“终端”里面输入。Problem点击创建 launch.json 的时候可能会卡。这可能是因为某些其他语言的 vscode debugger 在试图更新自己的配置。建议手动创建 launch.json 或者等一等就会有

No more posts to load.