linux
Pianist Of Keyboard
这个作者很懒,什么都没留下…
展开
-
jekins中anaconda python环境的切换
背景最近需要在jekins上做一个sphinx的文档自动化。其中make html需要当前python环境支持需要文档自动化的项目。问题1jekins中的execute shell中默认的是python环境/usr/bin/python。这个公共的环境并不具有我需要的包,因此需要切换成我自己的conda环境。众所周知,激活conda环境需要 source activate 环境名。但是我在执行的遇到了报错称我的环境找不到source。source怎么可能没有呢???查询了资料后才知道,原来是终原创 2022-04-19 11:54:09 · 1642 阅读 · 0 评论 -
使用Notepad++将windows格式转为linux 的unix
问题描述在Windows操作过的sh文件,在Linux下运行会报错:bash: $’r’: command not found解决1.windows下用Notepad++打开文件,看右下角,双击"Windows",改成"Unix"2.Linux下用dos2unix来进行文件转换3.Linux下使用vim打开文件,然后使用命令:set ff=unix,保存文件...原创 2022-02-15 10:16:16 · 6012 阅读 · 0 评论 -
rsync 入门使用
引用rsync 中文文档引用 https://www.cnblogs.com/f-ck-need-u/p/7221713.html引用https://blog.csdn.net/qq_32706349/article/details/91451053#模板#Local rsync [OPTION...] SRC... [DEST] #Access via remote shell:#Pull: rsync [OPTION...] [USER@]HOST:SRC... [DEST]#P.原创 2022-02-14 16:57:09 · 129 阅读 · 0 评论 -
免密码scp/rsync 文件到远程服务器
引用 https://www.jianshu.com/p/59363d6c4522操作:1.在源文件所在服务器A的用户目录下,生成公钥文件# 在A服务器执行cd ~ssh-keygen -t rsa#一直按回车即可,无需密码.会在~/.ssh目录下生成id_rsa和id_rsa.pub文件。2.复制公钥文件到目标服务器B,重命名为authorized_keys。如果已有这个文件则需要在这个文件后面将id_rsa.pub的内容追加进来。还需要保证authorized_keys的.原创 2022-02-14 16:12:12 · 482 阅读 · 0 评论 -
检查端口占用
系统:Ubuntu 18.04.5若要检查的是9999端口的进程使用情况,可使用lsof命令(如果该接口在容器中使用,并到映射宿主机上,可能不能直接使用该命令查看,需要sudo lsof)#若未安装lsof,则先用apt-get update; apt-get install lsof 安装lsof -i:9999#输出#COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAMEj#upyter-l 8945 root 4u原创 2022-01-22 10:26:15 · 1118 阅读 · 0 评论 -
apt-get install 遇到404 Not Found
系统:docker images: nvidia/cuda:11.1-cudnn8-runtime-ubuntu20.04问题apt install -y ceph-common时遇到报错WARNING: apt does not have a stable CLI interface. Use with caution in scripts.Reading package lists...Building dependency tree...Reading state informati原创 2022-01-20 12:36:55 · 1397 阅读 · 0 评论 -
mobaxterm私钥登陆遇到 No supported authentication methods available (server sent: publickey)
问题描述这是我遇到的问题sercer refuse keyNo supported authentication methods available (server sent: publickey)我在远程服务器使用下面的命令创建公钥对ssh-keygen -t rsa -N '' -f ./id_rsamv ./id_rsa.pub ./authorized_keys把私钥下载到本地,在本地指定私钥登陆远程服务器,就遇到这个问题。探索看博客说/etc/ssh/sshd_config的原创 2021-08-31 11:03:13 · 7021 阅读 · 0 评论 -
apt update cuda时候遇上的问题
背景我的系统是Ubuntu20.04.2,x86的cpu,使用cuda11。打算更新apt-get使用命令apt-get upate但是遇到报错E: Failed to fetch https://developer.download.nvidia.cn/compute/cuda/repos/ubuntu2004/x86_64/by-hash/SHA256/ce4d38aa740e318d2eae04cba08f1322017d162183c8f61f84391bf88020a534 4原创 2021-06-28 17:22:36 · 502 阅读 · 0 评论 -
docker-compose.yml中的环境变量
我需要使用环境变量建一个docker环境services: pytorch-dev: container_name: "${username}" build: context: ../ dockerfile: ./pytorch.dockerfile environment: - MYSQL_ROOT_PASSWORD=xxx 如果要使用docker-compose.yml文件中定义的环境变量,则必须将它们放在env_file文原创 2021-06-21 12:43:28 · 1643 阅读 · 0 评论 -
linux:py文件运行时的几种编码报错
1.SyntaxError: (unicode error) ‘utf-8’ codec can’t decode byte 0xbc in position 5: invalid start byte这是由于没有在文件开头加上# -*- coding: utf-8-*- 导致程序无法识别你的编码方式2.UnicodeDecodeError: ‘utf-8’ codec can’t d...原创 2020-03-26 18:09:22 · 806 阅读 · 0 评论 -
几种压缩方式的对比
在压缩比率上: lzma>tar.bz2=bz>gzip=zip>tar (tar只打包不压缩)(tar.gz就是tgz也是gzip)占用空间与压缩比率成反比耗费时间与压缩比率成反比从效率角度来说,当然是耗费时间越短越好If you need heavy compression and are willing to wait for it, use LZMA. If yo...原创 2020-03-24 12:59:21 · 1705 阅读 · 0 评论