服务器坑记

GitHub坑记

建仓

github创建新仓库
clone到本地,默认main分支
测试连接

$ ssh -T git@github.com

提交

注意gitignore的编码是否为utf-8

git add .
git commit -m "message“
git push origin main

暂存

git stash
git stash list
git stahs pop

分支

git branch alter_version
git checkout alter_version
# git checkout -b <branch>           create and checkout a new branch

查看远程分支

git fetch
git branch -a

获取远程分支

git checkout -b alter_version origin/alter_version

部分文件合并

git checkout alter_version a.file b.file

删除远程分支

git push origin -d alter_version 

删除

git rm filename.type

私仓

服务器上的 Git - 在服务器上搭建 Git

Jupyter

ssl

http://www.qb5200.com/article/381584.html

启动环境

https://blog.csdn.net/weixin_44560088/article/details/121050748

服务配置

公网虚拟局域网

https://github.com/SoftEtherVPN/SoftEtherVPN_Stable
https://zhuanlan.zhihu.com/p/414145546

sudo iptables -t nat -A POSTROUTING -s 10.8.0.0/24 -j MASQUERADE

mail

https://blog.csdn.net/N_jw107/article/details/119521517

redis

# 配置密码
config get requirepass
config set requirepass "pass"

docker

不用sudo

https://blog.csdn.net/boling_cavalry/article/details/106590784

pytorch

https://www.jianshu.com/p/0afeacdd7234

添加用户组

$ sudo usermod -a -G docker user

docker添加挂载路径:

https://segmentfault.com/q/1010000020514283

docker commit #提交当前容器
docker save #保存镜像
docker load #加载镜像
docker run #从保存的容器重新运行,可修改挂载/端口等路径

docker+pytorch

Initialize the server with nvidia driver support: (linux version)

https://www.nvidia.cn/Download/index.aspx?lang=cn

Install nvidia-docker2:

https://docs.nvidia.com/datacenter/cloud-native/container-toolkit/install-guide.html

Pull the pytorch image:

https://hub.docker.com/r/pytorch/pytorch/tags

Run the image with daemon: (container port 8888->host port 12345)

docker run --runtime=nvidia -dit -p 12345:8888 -v /home/ubuntu/docker_share:/home/ pytorch/pytorch:<version> /bin/bash
docker exec -it container_id bash

Problem: cannot activate nvidia runtime without sudo

code-server

local server port:0.0.0.0:8080

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值