sudo

In my virtualenv, I need to use sudo for all commands

徘徊边缘 提交于 2019-12-20 20:15:45
问题 I set up a virtualenv , which is working, but for some reason I need to use sudo for commands as simple as mkdir . Obviously I did something incorrectly. Any idea what it might be? Thanks 回答1: Check the directory permissions and owner and give: $ sudo chown -R me:me virtualenvdir $ sudo chmod -R a+rX virtualenvdir change me with your username, typically $USER, and virtualenvdir with your virtualenv's work directory. 回答2: The commands cd test sudo virtualenv python creates a directory called

2019 SDN上机第1次作业

情到浓时终转凉″ 提交于 2019-12-20 19:04:09
1.作业要求: 安装轻量级网络仿真工具Mininet 用字符命令搭建给定的拓扑结构,并写出命令 利用可视化工具搭建给定的拓扑结构,并要求支持OpenFlow 1.0 1.1 1.2 1.3,设置h1(10.0.0.10)、h2(10.0.0.11)、h3(10.0.0.12),拓扑搭建完成后使用命令验证主机ip,查看拓扑端口连接情况 利用Python脚本完成给定的一个Fat-tree型的拓扑(交换机和主机名需与图中一致,即s1~s6,h1~h8,并且链路正确,请给出Mininet相关截图) 作业博客链接: https://edu.cnblogs.com/campus/fzu/fzusdn2019/homework/9902 2.具体操作步骤与截图说明: 实验环境:VMware Workstation Pro14.1、ubuntu-16.04 (1)安装轻量级网络仿真工具Mininet(使用GitHub源码进行安装): a.先在Ubuntu上安装git,打开终端并输入: sudo apt-get install git 安装成功后终端上会显示如下界面: b.安装git成功后,在终端上输入: sudo git clone http://www.github.com/mininet/mininet git clone成功后终端上会显示如下界面: c.进入mininet目录下的util文件

ubuntu16.04 安装配置matlab+python +cuda8.0+cudnn+opencv3.1的caffe环境

∥☆過路亽.° 提交于 2019-12-20 18:03:02
  网络上有很多ubuntu上caffe配置环境的帖子,本人照着其中的许多进行了参考,都出现了或多或少的错误,很多地方也有差异。 于是自己整理了下自己的安装过程,成功进行了测试,跑通了faster-rcnn。配置环境时间为2017.1.4 系统ubuntu16.04 一:显卡驱动的安装:   由于要使用GPU,所以先要查看自己显卡所匹配的显卡驱动,网址: http://www.nvidia.com/Download/index.aspx?lang=en-us   选择电脑匹配的显卡驱动,本人电脑显卡为GTX760,选择如下图所示 输入以下命令执行安装驱动: sudo add-apt-repository ppa:graphics-drivers/ppa sudo apt-get update sudo apt-get install nvidia-375 //此处为上图的驱动版本 sudo apt-get install mesa-common-dev sudo apt-get install freeglut3-dev 安装完成后,重启电脑后输入 nvidia-smi 出现你的电脑gpu列表,如下所示,表示驱动安装成功。 二:安装配置CUDA8.0   cuda官方下载地址: https://developer.nvidia.com/cuda-downloads ,选择如下:  

How to get password for sudo

坚强是说给别人听的谎言 提交于 2019-12-20 18:01:37
问题 I'm trying to use the command sudo -i -u postgres for PostgreSQL, and the Google Compute Engine VM is asking me for my password for my account (not root). As I never issued a password, and I always login to my server via SSH key, I'm not sure what the password is, how I can reset it, or where it can be found. Please tell me where I can get my password? 回答1: To become another non-root user on a GCE VM, first become root via password-less sudo (since that's how sudo is configured on GCE VM

Using pscp and getting permission denied

别等时光非礼了梦想. 提交于 2019-12-20 17:26:52
问题 I'm using pscp to transfer files to a virtual ubuntu server using this command: pscp test.php user@server:/var/www/test.php and I get the error permission denied. If I try to transfer to the folder /home/user/ I have no problems. I guess this has to do with that the user I'm using doesn't have access to the folder /var/www/. When I use SSH I have to use sudo to get access to the /var/www/ path - and I do. Is it possible to specify that pscp should "sudo" transfers to the server so I can get

ModuleNotFoundError: No module named '_ctypes' 解决办法

五迷三道 提交于 2019-12-20 16:46:57
问题描述 在Ubuntu环境下,手动安装Python3.7及以上版本时,在make install步骤中会出现缺少依赖(缺少_ctype)的错误提示。 报错原因 是这样,在python3.X中用到了_ctype组件,但他又必须依赖于另外一个叫libffi-devel的组件,所以我们需要先行安装。 解决办法 首先区别于环境,分为两种情况。 Centos7 #执行以下命令 yum install libffi-devel Ubuntu sudo apt-get install libffi-dev 当执行以上命令却提示 正在读取软件包列表… 完成 正在分析软件包的依赖关系树 正在读取状态信息… 完成 E: 无法定位软件包 libffi-devel 所以执行以下命令安装依赖组件: sudo apt-get update sudo apt-get install build-essential python-dev python-setuptools python-pip python-smbus sudo apt-get install build-essential libncursesw5-dev libgdbm-dev libc6-dev sudo apt-get install zlib1g-dev libsqlite3-dev tk-dev sudo apt-get

Docker入门-安装

*爱你&永不变心* 提交于 2019-12-20 16:36:21
Docker入门-安装 Docker简介 Docker对比虚拟机的优势 Docker架构 Docker的应用 Docker安装 Docker简介 首先,抛出概念,docker是LinuX Container(LXC,Linux容器)的封装. 至于LXC是什么,和你一样,包括我本身在内,很多人都不会使用它,这也就是docker火爆的原因,因为LXC的操作十分复杂,而且普通的开发人员很少接触(运维工程师可能会接触到),所以在docker之前一般都是用虚拟机来解决环境配置问题的. Docker对比虚拟机的优势 1.启动快: 虚拟机:传统的虚拟机如VMware WorkStation,Virtual Box,是基于kernel级别的虚拟化,相当于一个OS,所以启动的时候相当于启动一个系统. docker:相当于启动一个容器进程,相当之快. 2.资源占用少: 虚拟机:虚拟机创建时,需要指定分配cpu,内存,硬盘等资源,拿内存来说,只要你启动了虚拟机,内存资源就被划走了,虽然你的虚拟机中真正运行的程序可能只需要1M内存. docker:容器只占用所需的资源. 3.体积小: 虚拟机:由于是OS,所以安装完成后至少要占用到几十G的空间. docker:非常小,一个CentOS的容器只要几十M. Docker架构 先上图: 大体上Docker分为3大块:Client,DOCKER_HOST

Linux开通防火墙80端口

这一生的挚爱 提交于 2019-12-20 16:10:47
查看已开通端口列表 [admin@localhost yum.repos.d]$ sudo firewall-cmd --list-port 查看所有信息列表 [admin@localhost yum.repos.d]$ sudo firewall-cmd --list-all; 开通80端口命令 [admin@localhost yum.repos.d]$ sudo firewall-cmd --zone=public --add-port=80/tcp --permanent 重启防火墙让配置生效 [admin@localhost yum.repos.d]$ sudo firewall-cmd --reload 来源: CSDN 作者: STIll_clx 链接: https://blog.csdn.net/STIll_ly/article/details/103629914

Non-privileged, non-root, user to start or restart webserver server such as nginx without root or sudo

早过忘川 提交于 2019-12-20 14:06:33
问题 I'm using capistrano to deploy a rails web app. I want to give the deploy user on the webserver as few privileges as I can. I was able to do everything I need to do as a non-privileged user except restart the webserver. I'm doing this on an ubuntu server, but this problem is not specific to my use case (rails, capistrano, deployment), and I've seen a lot of approaches to this problem that seem to involve poor security practices. Wondering whether others can vet my solution and advise whether

ubuntu安装mysql后无法启动 service mysql start start:未知任务: mysql

眉间皱痕 提交于 2019-12-20 13:31:37
ubuntu安装mysql后无法启动 service mysql start start:未知任务: mysql 错误代码 解决办法 错误代码 hadoop@sin:~$ service mysql start start :未知任务: mysql 但是,用测试命令查看安装是成功的 hadoop@sin:~$ sudo netstat - tap | grep mysql [sudo] password for hadoop: tcp 0 0 localhost:mysql * : * LISTEN 18212 / mysqld 解决办法 首先进行了完全删除,但发现没用,还是无法启动 sudo apt - get autoremove mysql * -- purge sudo apt - get remove apparmor sudo rm / var / lib / mysql / - R sudo rm / etc / mysql / - R 最后想到万能办法试试,在语句前加权限 sudo ,然后就可以了。 hadoop@sin:~$ service mysql stop stop:未知任务: mysql hadoop@sin:~$ sudo service mysql start start : Job is already running: mysql 来源: CSDN