Linux
Linux开机启动服务管理
采用 systemctl 命令来进行开机启动项管理。 开启某一服务的开机启动 systemctl enable redis-server 关闭某一服务的开机启动 systemctl disable redis-server 启动某服务 systemctl start redis-server 停止某服务 systemctl stop redis-server
采用 systemctl 命令来进行开机启动项管理。 开启某一服务的开机启动 systemctl enable redis-server 关闭某一服务的开机启动 systemctl disable redis-server 启动某服务 systemctl start redis-server 停止某服务 systemctl stop redis-server
为了提高开发效率,有时候我们需要在创建新文件时,生成一个模板,包含一些固定代码。 以py文件为例,我们可以在pycharm中进行设置。 设置方式为: file settings editor file and code templates python file 然后就可以在其中填入一些基本信息。 例如: # -*- coding:utf-8 -*- # 阅读更多…
(内容待完善) Python做性能分析时,可以使用包cprofile 在要测试的函数前,执行 cProfile.Profile() profile.enable() 然后执行函数 然后执行 profile.disable() sortby = “tottime” ps = pstats.Stats(profile).sort_stats(sortby) #dump to s 阅读更多…
debian9,kde。 打开电脑后,发现网络错误。网络连接为红色。 最开始不清楚原因。 后来发现是网卡没有正常启动。 切换为root用户。 查看网卡信息 config -a 然后启动网卡 ifup xxxx 网络连接就好了。
在Linux环境下,有时候我们希望用较短的命令来代替较长的我们经常输的命令。 对某个用户生效的设置方式: 在该用户目录下,有个.bashrc文件。 直接在 .bashrc 文件内,编辑快捷命令 alias la=’ls -A’ 然后激活 source .bashrc 这样,快捷命令就生效啦。