This commit is contained in:
wenyongda 2025-07-03 17:19:20 +08:00
parent c072303a97
commit ccb856d878
4 changed files with 60 additions and 1 deletions

View File

@ -921,7 +921,8 @@ docker images
```shell
cd /usr/local
mkdir jenkins_home
docker run -d -uroot -p 8889:8080 -p 50000:50000 --name jenkins -v /usr/bin/docker:/usr/bin/docker -v /var/run/docker.sock:/var/run/docker.sock -v /etc/sysconfig/docker:/etc/sysconfig/docker -v /usr/local/jenkins_home:/var/jenkins_home -v /etc/localtime:/etc/localtime jenkins/jenkins
docker run -d -uroot -p 8889:8080 -p 50000:50000 --name jenkins -v /usr/bin/docker:/usr/bin/docker -v /var/run/docker.sock:/var/run/docker.sock -v /etc/sysconfig/docker:/etc/sysconfig/docker -v /usr/local/jenkins_home:/var/jenkins_home -v /etc/localtime:/etc/localtime
-u root jenkins/jenkins
```
启动后查看日志

View File

@ -216,3 +216,13 @@ git config --global https.proxy 'http://127.0.0.1:代理的port'
# Gitea
## 备份
数据库备份至postgresql
```shell
docker exec -u git -it -w /tmp gitea bash -c '/app/gitea/gitea dump --database postgres --config /data/gitea/conf/app.ini'
```

View File

@ -2150,6 +2150,14 @@ wsl --install -d <Distribution Name>
/mnt目录下是Windows系统的挂载盘可直接访问Windows磁盘文件
#### 迁移
```powershell
wsl --manage Ubuntu-24.04 --move d:\ubuntu
```
#### 通过FinalShell连接WSL2
##### 方式1

View File

@ -37,3 +37,43 @@ pip uninstall package_name
```
Pip会询问你是否确定卸载软件包并删除相关的文件。
# Python __name__
首先需要了解 __name__ 是属于 python 中的内置类属性,就是它会天生就存在于一个 python 程序中,代表对应程序名称
```python
import requests
class requests(object):
def __init__(self,url):
self.url=url
self.result=self.getHTMLText(self.url)
def getHTMLText(url):
try:
r=requests.get(url,timeout=30)
r.raise_for_status()
r.encoding=r.apparent_encoding
return r.text
except:
return "This is a error."
print(__name__)
```
结果:
```shell
__main__
Process finished with exit code 0
```
当这个 pcRequests.py 作为模块被调用时,则它的 __name__ 就是它自己的名字:
```python
import pcRequestspcRequestsc=pcRequestsc.__name__
```
结果:
```shell
'pcRequests'
```