sudo

树莓派上实现应用程序开机自启动的方法

落爺英雄遲暮 提交于 2019-12-25 05:19:02
项目中需要,在开机的时候,加载一个usb驱动模块和执行一个应用程序。 操作如下: 加载usb驱动模块:sudo insmod /home/pi/sharedir/drv/artosyn_usb_8020.ko 执行应用程序:sudo ./single_xyw& 首先参考通用的Linux的开机自启动进程的方法: 自己写一个 shell脚本放在/etc/profile.d/目录下面。 脚本内容如下: sudo insmod /home/pi/sharedir/drv/artosyn_usb_8020.ko cd /home/pi/sharedir/transparent-test/ sudo ./single_xyw& 通过尝试此方法,开机启动后使用top和ps分别查看,代码能够运行。 使用时,需注意window下写的shell脚本在Linux下执行的问题。刚开始的时候,我在window下编写好了shell脚本,然后拷贝到Linux下执行,发现一只报错误: bad interpreter: No such file or directory 参考如下解决: https://blog.csdn.net/weixin_30460489/article/details/99409999 来源: CSDN 作者: 酸菜鱼的鱼 链接: https://blog.csdn.net

Java execute Linux commands that require su?

倖福魔咒の 提交于 2019-12-25 05:08:05
问题 What is the best way to run Linux commands that require "su" with Java? I want it to be very reliable, as for security goes I don't care much about it the system is not a production server. No one ever connects to the machine but myself. I thought about logging in as root so I don't have to deal with the su command and its disabled by default. I'm using Debian 6. The only thing is that one of my requirements is that the program should start after the normal user logs in without any farther

How to execute a program from a php web page?

天涯浪子 提交于 2019-12-25 04:59:08
问题 Summary I have apache running on a Linux machine where a certain program is installed. I want to call the program from a php page and get the output. Special constraint The program needs certain environment variables to run, e.g. LD_LIBRARY_PATH with path to libraries plus extra variables. The environment is defined for a user X on the machine that is not the apache user. Proposed options So far I have thought of the following options (not meaning that they are all smart or safe): Allow user

docker学习(一)ubuntu上安装docker

北慕城南 提交于 2019-12-25 04:54:20
准备 你需要64位的ubuntu操作系统 Cosmic 18.10、Bionic 18.04 (LTS)、Xenial 16.04 (LTS)其中之一。 docker支持的架构为: x86_64 (or amd64 ), armhf , arm64 , s390x (IBM Z), and ppc64le (IBM Power)。 查看ubuntu系统是32位的还是64位的:getconf LONG_BIT 查看系统信息:lsb_release -a 查看操作系统架构:uname -a 卸载旧版本 sudo apt-get remove docker docker-engine docker.io containerd runc /var/lib/docker 的内容,包括镜像、容器、卷和网络,可以保留也可以删除。 执行之后,输入docker --version仍能看到docker版本 采用另一种方式: sudo apt-get purge docker sudo apt-get purge docker-ce sudo apt-get remove -y docker-* sudo rm -rf /var/lib/docker (apt-get remove 会删除软件包而保留软件的配置文件 apt-get purge 会同时清除软件包和软件的配置文件) Install

Ensure npm install -g does not need sudo?

我怕爱的太早我们不能终老 提交于 2019-12-25 04:47:14
问题 On MacOS X an npm install -g requires a user to sudo, though we would like to have it so the 'global' mode is per user, rather than system wide. Does anyone know if this is possible? We would like to avoid exposing sudo to non-admin users. 回答1: There appears to be an issue on this (currently marked closed at this time), on the NPM GitHub project. One person in the comment thread suggests: I personally npm config set prefix ~/npm and have ~/npm/bin in my PATH 来源: https://stackoverflow.com

Why am I getting prompted for sudo password via knife-vsphere when giving --ssh-user & --ssh-password params?

ε祈祈猫儿з 提交于 2019-12-25 04:18:13
问题 I'm trying to get knife-vsphere working in my vCenter environment. I have a script working that spins up a VM from a template then bootstraps it and runs cookbook recipes to completion. However, I get prompted to supply a sudo password. Is this expected? I supplied the '--ssh-user' and '--ssh-password' params and, upon being prompted, I'm typing the same password in and then chef build continues. isn't there a way to make this hands off? what may I have missed? Thanks! 回答1: As pointed out in

Linux入门(7)——Ubuntu16.04安装wps并解决系统缺失字体问题

只谈情不闲聊 提交于 2019-12-25 03:41:07
本文转自 tongqingliu 链接:http://www.cnblogs.com/liutongqing/p/6388160.html 进入WPS官网下载deb包: http://linux.wps.cn/ 安装,打开终端: cd 下载 sudo dpkg -i wps-office_10.1.0.5672~a21_amd64.deb 解决打开WPS时出现的系统缺失字体问题: 下载 https://pan.baidu.com/s/1eS6xIzo wps_symbol_fonts.zip 将wps_symbol_fonts.zip解压 cd wps_symbol_fonts ls 将目录中所有文件复制到/usr/share/fonts下: sudo cp mtextra.ttf symbol.ttf WEBDINGS.TTF wingding.ttf WINGDNG2.ttf WINGDNG3.ttf /usr/share/fonts 重新打开WPS,问题解决。 另外,安装完WPS后就没有必要保留libreOffice 卸载libreOffice: sudo apt-get remove libreoffice-common 顺便把Amazon链接删除了吧: sudo apt-get remove unity-webapps-common sudo apt autoremove

Linux入门(7)——Ubuntu16.04安装wps并解决系统缺失字体问题

一世执手 提交于 2019-12-25 03:40:48
进入 WPS 官网下载 deb 包: http://linux.wps.cn/ 安装,打开终端: cd 下载 sudo dpkg -i wps-office_10.1.0.5672~a21_amd64.deb 解决打开 WPS 时出现的系统缺失字体问题: 下载 https://pan.baidu.com/s/1eS6xIzo wps_symbol_fonts.zip 将 wps_symbol_fonts.zip 解压 cd wps_symbol_fonts ls 将目录中所有文件复制到/usr/share/fonts下: sudo cp mtextra.ttf symbol.ttf WEBDINGS.TTF wingding.ttf WINGDNG2.ttf WINGDNG3.ttf /usr/share/fonts 重新打开 WPS ,问题解决。 另外,安装完WPS后就没有必要保留libreOffice 卸载libreOffice: sudo apt-get remove libreoffice-common 顺便把Amazon 链接删除了吧 : sudo apt-get remove unity-webapps-common sudo apt autoremove 来源: https://www.cnblogs.com/liutongqing/p/6388160.html

ubuntu 12.04 64位 安装wps

邮差的信 提交于 2019-12-25 03:39:24
1、去wps官网下载linux版的软件 http://community.wps.cn/download/ 我这里下载的是Alpha版的 kingsoft-office_9.1.0.4280~a12p4_i386.deb 2、安装wps需要一些依赖包: libtiff.so.4 libpng12.so.0 libjpeg.so.62 用以下命令可以查看系统是否有它们: aptitude search libtiff 没有的话可以用以下命令安装: sudo apt-get install aptitude 3、安装wps软件: sudo dpkg -i kingsoft-office_9.1.0.4280~a12p4_i386.deb 如果出错,可能是没有完全解决依赖问题,运行以下命令解决: sudo apt-get -f install 4、安装字体库: 可以在Linux公社下载:http://linux.linuxidc.com/,目录:/2013年资料/6月/3日/Ubuntu 13.04下安装WPS for Linux 用户名与密码都是:www.linuxidc.com 安装命令如下: sudo dpkg -i symbol-fonts_1.1_all\ .deb OK,enjoy it! 来源: https://www.cnblogs.com/leocook/p

Fedora 21 64位系统安装WPS教程

三世轮回 提交于 2019-12-25 03:38:49
WPS的Linux版本的出现简直是Linux党的福音,Ubuntu上的WPS安装非常简单,但是在Fedora上却有点小麻烦。主要是库的依赖问题。下面记录一下Fedora 21的64位版安装WPS的完整过程以备忘。 1、WPS官网下载最新的WPS for Linux版: http://community.wps.cn/download/ (64位下载i686的rpm包) 2、终端使用rpm命令安装(习惯于将常用软件安装在系统中,所以都用sudo): sudo rpm -ivh wps-office-8.1.0.3724-0.1.b1p2.i686.rpm 会提示一大堆依赖检测失败: 2、安装全部依赖的库: sudo yum install libICE.so.6 libSM.so.6 libX11.so.6 libXrender.so.1 libc.so.6 libdl.so.2 libfontconfig.so.1 libfreetype.so.6 libgcc_s.so libstdc++.so libXext.so.6 libgcc_s.so.1 libglib-2.0.so.0 libgobject-2.0.so.0 libmng.so.1 libstdc++.so.6 libz.so.1 libcups.so.2 libpng12.so.0 libGLU.so.1 3