【Python】pip下载使用国内镜像源
pip下载使用国内镜像源 1.如何使用在直接用pip安装包的时候,有时候会非常非常慢 可以用下面的命令,在安装的时候使用清华的镜像源 1-i https://pypi.tuna.tsinghua.edu.cn/simple 比如下面的操作 1pip3.10 install -r requirements.txt -i https://pypi.tuna.tsinghua.edu.cn/simple 速度直接起飞 2.修改配置文件2.1 linuxLinux系统,在用户的家目录下创建一个.pip文件夹,并在里面创建一个pip.conf 12mkdir ~/.piptouch ~/.pip ...
【Linux】浏览器写代码!部署code-server远程vscode网页
部署code-server远程vscode网页,在浏览器上写代码! 参考文档 https://developer.aliyun.com/article/876967#slide-7 1.什么是code-server?注意,这不是在linux系统上安装vscode软件(和windows一样的vscode客户端) 开源仓库 https://github.com/coder/code-server code-server是一个社区项目(非微软官方)其作用是在你的linux主机(云服务器)上部署一个可以在浏览器上访问的vscode页面,类似官方的vscode.dev 微软官方推出的vscod ...
【Docker】限制已运行容器的Cpu和内存
docker限制已运行容器的Cpu和内存 1.问题描述最近云服务器的内存经常不够用,而且是莫名其妙的增多,在腾讯云的控制台里面看,4gb 的内存占用了3.2 gb,就卡到连 ssh 都连不上了 PS: 已换过网络和设备,确认不是用户端网络问题导致无法ssh 实在没辙了,只能把我的几个不热门的kook-bot移植到replit白嫖,再限制一下lsky图床docker镜像的内存用量 其实主要是nsfw-api的内存用量,我发现有人故意给我的图床上传h图。lsky后台由于鉴黄不通过,不允许上传,也看不到是谁干的。隔这压力测试呢? 我的图床基本只对自己的博客使用。开放游客上传,也只是方便大 ...
【Linux】修改linux下的时区和系统时间
用配置文件,修改linux系统下的时区(所用系统 CentOS8) 1.问题来源在linux上使用python的logging模块的时候,发现了一个问题,那就是模块里面的%(asctime)s打印的时间并非东八区的时间,而是格林尼治时间,比东八区的时间少了8小时 对于日志来说,这怎么行?总不能每次看日志的时候,自己手动给时间加8小时吧!那样对debug来说可不是什么方便事! 2.解决百度了一下后,发现是我系统的时区问题。这个Centos系统是用docker安装的,内部的时区没有正常设置 1date 通过date命令可以查看系统当前的时间 1Sat Mar 4 01:29:59 UTC ...
【Python】解决SSL certificate problem unable to get local issuer certificate
CentOS8 出现 SSL certificate problem: unable to get local issuer certificate 解决办法
【Nas】绿联安装CentOS8容器
绿联安装CentOS8容器 1.创建容器先在客户端安装容器,随后用xshell进入绿联的ssh 绿联如何开启ssh参考视频;2023年11月后,新版本的绿联直接把远程调试打开,给出的调试密钥就是ssh的密码。绿联的ssh端口是922 执行如下命令,以特权模式创建一个centos容器,并将容器内的22端口映射给主机的22222端口;如果你是希望在centos容器上进行网络编程开发,请多映射几个端口,以免到时候没办法访问项目的尴尬情况! 123456docker run -d \ -p 22222:22 \ --name centos \ --privileged=true \ cento ...
【Docker】配置CentOS容器时出现 Error Failed to download metadata for repo 'appstream' Cannot prepare internal mirrorlist | 转载
本站经常搬运一些其他博主文章,主要是为了持久化访问。避免日后他人删文or原文无法访问;所有搬运的文章都会写明原文地址,并且不会展示本站的copyright_info 下文所出现的场景,是我在linux上使用docker安装centos容器时出现的! ✨在学习使用 docker 技术过程中,基于 centos 镜像自定义新的镜像,其中基础镜像 centos 需要提前安装好 vim 和 net-tools,然而在刚开始通过 yum -y install vim 安装 vim 时,便出现了错误提示信息: Error: Failed to download metadata for repo & ...
【C++】C++11中局部static变量的线程安全问题 | 转载
C++11中局部static变量的线程安全问题
【Curl】通过curl模拟referer获取到有防盗链的图片
本文所描述操作仅供学习curl命令,请勿用于盗刷他人图床等违规操作!🙅♀️ 1.说明当我想把51la添加到我的导航站点,却发现它的icon图标有防盗链,禁止空referer访问的; 这点完全可以理解,为了防止他人盗刷本站的图片,通常我们都需要给图片地址加上防盗链。 其实51la提供了自己的icon,但这里提供的icon像素特别低,只有16*16,在我的导航站点上的显示就没有那么友好了 所以我才想把稍微清晰一点的icon图标下载下来 2.curl使用 参考 https://www.ruanyifeng.com/blog/2019/09/curl-reference.html 要避 ...
【C++】thread|mutex|atomic|condition_variable
本篇博客,让我们来认识一下C++中的线程操作 所用编译器:vs2019 阅读本文前,建议先了解线程的概念 👉 线程概念 1.基本介绍在不同的操作系统,windows、linux、mac上,都会对多线程操作提供自己的系统调用接口 为什么C++需要封装一个线程?直接用系统的接口不好吗? 在Linux文件博客中,已经谈过了这一点:对于C++、python、java这些跨平台的语言来说,如果直接用系统的接口,是可以实现对应操作的。但是,这样会导致代码只能在某一个特定平台,甚至是某一个版本的特定操作系统上才能正常运行,直接与跨平台的特性相违背。 解决的办法呢,就是对系统的接口套一个语言级别的软 ...