Ubuntu20.04通过VNC搭建图形界面 说明:虚拟网络计算(VNC)是一个图形桌面共享系统,可让您使用键盘和鼠标远程控制另一台计算机。 常用命令:更改密码 vncpasswd 查看当前用户所建立的所有远程桌面 ps -ef|grep Xtightvnc 关闭已启动的VNC,VNC的显示号1 vncserver -kill :1 启动一个新的VNC,VNC的显示号仍为1(端口为:5900 + 显示号 = 5901)。 vncser 2021-11-29 Ubuntu > VNC #Ubuntu #VNC
Ubuntu远程终端后台程序(nohup命令) 说明:使用nohup命令让程序在后台运行 语法:nohup { -p pid | Command [ Arg ... ] [ & ] } 描述: -p pid:指定运行进程的pid(与 Command 冲突,将不会重定向到 nohup.out) Command:要执行的命令(与 -p 冲突,默认重定向到 nohup.out) Arg:一些参数,可以指定输出文件 &a 2021-11-11 Ubuntu > nohup #Ubuntu #nohup
Linux标准输出(stdout)与标准错误(stderr)重定向 文件描述符 0 – stdin (standard input,标准输入) 1 – stdout (standard output,标准输出) 2 – stderr (standard error,标准错误输出) 语法: 语法 终端显示 文件显示 文件存储 标准输出(stdout) 2021-11-11 Ubuntu #Linux #Ubuntu #stdout #stderr
Ubuntu Systemd Service开机自启服务 基本命令启动一个服务:systemctl start blog-local.service 关闭一个服务:systemctl stop blog-local.service 重启一个服务:systemctl restart blog-local.service 显示一个服务的状态:systemctl status blog-local.service 在开机时启用一个服务:systemctl en 2021-10-15 Ubuntu > Systemd #Ubuntu #Systemd
Python导出项目依赖环境 说明项目迁移时,需要把当前的环境依赖包导出,部署在新的项目服务器上 导出项目依赖安装pipreqs库 pip install pipreqs 生成项目依赖文件requirements.txt #简单(默认gbk打开当前路径下项目) pipreqs --encoding=utf-8 #指定编码、项目路径和导出文件 pipreqs --encoding=utf-8 --savepath=./req 2021-10-09 Python > Requirements #Python #Requirements
Python单例模式 1.装饰器实现单例:1234567891011121314def singleton(cls): instances = {} def getinstance(*args, **kwargs): if cls not in instances: instances[cls] = cls(*args, **kwargs) return instances[cls] ret 2021-09-26 Python #Python
Python使用Subprocess.Popen启动进程 简介:subprocess.Popen()用于创建一个子进程,并连接到子进程的标准输入/输出/错误管道,来管理进程 Popen原型:12345678910111213141516#原型中带参数的值都是默认值class subprocess.Popen( args, bufsize=0, executable=None, stdin=None, stdout=None, stderr=None, 2021-09-13 Python > Subprocess #Python #Subprocess
windows程序提权至system 问题:程序没有最高权限,无法进行高权限的操作 (即使管理员权限也无法满足的情况下) 解决方案:使用C++实现在win10系统上获取系统的system权限 通过system父进程创建子进程方式给程序提权 核心代码: 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 2021-07-22 windows #windows
Ubuntu下git的安装与使用 安装:sudo apt-get install git 配置:git config --global user.name "你的Git用户名" git config --global user.email "你的邮箱地址" 创建公钥:Git生成SSH公钥 使用:初始化git环境 git init 关联Git仓库 git remote add origi 2021-07-21 github #github
ubuntu安装node.js 安装方式:从 NodeSource 源安装 安装:nodejs官网 https://nodejs.org 看最新的版本号 添加对应源(setup_14.x对应14.x.x版本) curl -sL https://deb.nodesource.com/setup_14.x | sudo -E bash - 安装node.js sudo apt-get install -y nodejs 查看版本 2021-07-21 Ubuntu #node.js