sudo

Ubunt_配置_tftp(文件传输)

放肆的年华 提交于 2020-01-12 09:41:35
tftp服务器的安装与配置 TFTP : (文件传输) <kernel数据传输> tftp主要用于嵌入式交叉开发环境的搭建,传输文件。 1 、创建 tftp的工作目录,并修改权限 sudo mkdir /tftpboot sudo chmod 777 /tftpboot 2、安装: sudo apt-get install tftp tftpd openbsd-inetd 3、打开配置文件 /etc/inetd.conf : sudo vim /etc/inetd.conf 4、添加以下内容: tftp dgram udp wait nobody /usr/sbin/tcpd /usr/sbin/in.tftpd /tftpboot 5、打开文件 /etc/default/tftpd-hpa ,添加以下内容: RUN_DAEMON="yes" OPTIONS = "-l -s /tftpboot" 6、重启服务: sudo /etc/init.d/openbsd-inetd restart 7、测试: 在用户主目录位置下载zImage tftp 192.168.7.4 登陆 tftp服务器 tftp> get hello.c 下载文件 zImage Received 95 bytes in 0.1 seconds tftp> quit 退出 tftp服务器 来源: https:/

Ubuntu下安装Nginx

我只是一个虾纸丫 提交于 2020-01-12 09:41:03
转载自: http://www.cnblogs.com/skynet/p/4146083.html 1.Nginx安装 我使用的环境是64位 Ubuntu 14.04, Nginx是Nginx 1.10.0 nginx依赖以下模块: l gzip模块需要 zlib 库 l rewrite模块需要 pcre 库 l ssl 功能需要openssl库 1.1.安装pcre 获取pcre编译安装包,在 http://www.pcre.org/ 上可以获取当前最新的版本 解压缩pcre-xx.tar.gz包。 进入解压缩目录,执行sudo ./configure。 sudo make & make install   注:目前我下载的这个nginx只支持pcre, 不支持pcre2。   若出现configure: error: You need a C++ compiler for C++ support.说明系统还没有提供C/C++的编译环境,因此需要手动安装。使用命令 sudo apt-get install build-essential 进行安装。 1.2.安装openssl 获取openssl编译安装包,在 http://www.openssl.org/source/ 上可以获取当前最新的版本。 解压缩openssl-xx.tar.gz包。 进入解压缩目录,执行sudo .

Linux开发环境搭建三 使用mount -t cifs 挂载windows共享目录方法与问题解决

半腔热情 提交于 2020-01-12 09:36:43
转载链接: https://blog.csdn.net/fuyuande/article/details/82915800 先check路径对不对!!!!!!:网络路径\\BJ9L19VRMV2\LGG_mydata, 写在代码里的时候不需要写BJ9L19VRMV2,只需要写//ip地址/LGG_mydata 嵌入式开发通常是在linux环境下编译,windows下开发,这就需要在linux环境下访问windows目录了,或者在windows上访问linux目录。通常有三种方式 如果是在vm虚拟机上,vm提供了一个设置共享目录功能。 如果linux是一台服务器的话,可以在linux上安装samba服务器,这样windows就可以访问linux的目录了。 第三种就是将windows上的目录挂载到linux目录下,这里记录一下相关的命令与错误解决方法: 1. 在windows 10上新建共享文件夹,比如win,然后设置该文件夹的属性, win文件夹 -->属性-->共享-->设置共享-->添加用户(Everyone)设置读写属性。 接着设置高级共享-->共享此文件夹-->权限-->添加 接着设置密码保护-->打开网络共享中心-->关闭密码保护 接着打开控制面板-->系统安全-->Windows 防火墙-->启用或关闭防火墙-->关闭防火墙 到这里,windows上的目录已经设置完成了

Ubuntu16.04下安装redis并实现helloworld

与世无争的帅哥 提交于 2020-01-12 09:18:16
原文出处:http://blog.csdn.net/xiangwanpeng 1 sudo wget http://download .redis .io/releases/redis- 3.2 .6 .tar .gz 2 sudo tar -zxvf redis- 3.2 .6 .tar .gz 3 如果没有安装gcc,需要先安装 sudo apt-get install gcc 4 sudo make 5 sudo make install 6 复制配置文件redis.conf到/etc/redis/下,并用vi命令编辑该文件,将“daemonize no”修改为“daemonize yes”,即设置成作为后台进程运行,修改完成后保存退出。 7 进入到/usr/local/bin目录下,执行命令:(默认端口6379) redis -server /etc/redis/redis .conf redis -cli -p 6379 来源: https://www.cnblogs.com/jenkin1991/p/7463355.html

ubuntu 更改阿里云镜像源

China☆狼群 提交于 2020-01-12 08:42:22
阿里云镜像源地址: https://developer.aliyun.com/mirror/ubuntu?spm=a2c6h.13651102.0.0.53322f70TiLYZU 1.在终端中执行下列指令: cat /etc/issue 2.gedit etc/apt/sources.list 3.根据ubuntu 版本替换源 4.sudo apt-get update 5.sudo apt-get upgrade 提醒:如果出现以下错误 E: Could not get lock /var/lib/dpkg/lock-frontend - open (11: Resource temporarily unavailable) E: Unable to acquire the dpkg frontend lock (/var/lib/dpkg/lock-frontend), is another process using it? 解决方法1 1获取apt进程: ps -A | grep apt 2.杀死进程 sudo kill -9 进程id 3.删除锁定文件包 链接地址: https://blog.csdn.net/jiangjiang_jian/article/details/80695548 解决方法2 E: Could not get lock /var/lib

Ubuntu 下 Git 服务器的安装和初级配置

爱⌒轻易说出口 提交于 2020-01-12 08:17:57
操作环境: Ubuntu 10.04 LTS 安装前提条件,已经安装 apache 服务器或者同类服务器、openssh-service,并且已经熟悉使用 Git 客户端 ----- 安装 Git ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- sudo apt-get install git-core ----- 安装 gitosis ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- 注:Gitosis 是方便通过 Git 与 ssh 架设中央服务器的软件。 更详细步骤参见: http://scie.nti.st/2007/11/14

Ubuntu 14.04 用户操作

百般思念 提交于 2020-01-12 07:42:28
新建用户 sudo adduser linuxidc 修改hosts文件 sudo gedit /etc/hosts ubuntu修改主机名 sudo gedit /etc/hostname 删除用户 在root用户下:userdel -r newuser 在普通用户下:sudo userdel -r newuser Linux 通过 命令行 增加用户 , (1) 打开终端 输入 sudo -r useradd 用户名 /* -r 参数建立系统用户 (2) 输入 sudo useradd -g root 用户名 /*这一行的命令是让你的刚刚建立的 用户 划分到 root 权限组下 (3)sudo passwd 用户名 /*设置你刚刚建立的密码 参考: https://blog.csdn.net/MCANDML/article/details/78506462 https://blog.csdn.net/longgeaisisi/article/details/78879119 https://blog.csdn.net/qq_31456593/article/details/79247366 来源: https://www.cnblogs.com/sea-stream/p/10938835.html

如何搭建git服务器

孤街浪徒 提交于 2020-01-12 05:15:12
一、前言   现在越来越多的公司用git进行版本控制,不过git是默认是开源的,如果私有的话是需要付费的,如果不想付费自己可以搭建一个git服务器用来版本控制。 二、服务器端操作   1、安装git sudo apt-get install git   2、创建一个git用户 sudo adduser git   3、创建登录证书   创建公钥私钥 # git config --global user.name "test" # git config --global user.email "xxxx@qq.com" #ssh-keygen -t rsa -C "xxxx@qq.com"   在git用户目录下创建.ssh文件夹并在其下创建文件authorized_keys # cd /home/git# sudo mkdir .ssh # sudo touch .ssh/authorized_keys   收集需版本控制下的用户的公钥,就是他们自己的 id_rsa.pub 文件 ,这个需要生成,具体可以Google生成,把所有公钥导入到 /home/git/.ssh/authorized_keys 文件里,不同的公钥换行   4、选定仓库目录,初始化仓库   比如我是git用户根目录下的agame-server文件夹    sudo git init --bare agame

linux

*爱你&永不变心* 提交于 2020-01-12 04:54:32
LINUX的指令 文件权限 修改其他用户的权限为可读可写: chmod o+w 文件 使用权限码值修改文件权限: chmod 624 文件 修改文件的属组为 root: chown : root 文件名 修改文件的属组权限为可读可写可执行: chmod g+r , g+x 文件 文本编辑器 修改全文中的good 为 GOOD : :%s/good/GOOD/g 系统命令 定时关机 : shutdown -h 12:00 在12.00关机 shutdown -h +20 20分钟后关机 shutdown -h now like关机 结束进程: kill -9 进程id 查看磁盘使用情况: df 查看文件占用内存的情况: du 查看内存使用情况: free 释放缓存区的内存: sudo sh -c "echo 1 > /proc/sys/vm/drop_caches" 给指令起别名: alias 别名=“指令” 获取当前系统的IP地址: ifconfig 检测网络: ping ip 地址或者域名 ping -c 连接次数 ip地址或者域名 检测防火墙的状态: sudo ufw status 开启|关闭防火墙: sudo ufw enable|disable 禁止|开启指定服务: sudo ufw deny|allow 服务对应的端口号 SHELL shell编程

SSH to server, Sudo su - then run commands in bash [duplicate]

妖精的绣舞 提交于 2020-01-12 04:44:05
问题 This question already has answers here : Pass commands as input to another command (su, ssh, sh, etc) (3 answers) Closed 2 years ago . I have the following #!/bin/bash USER='scott' PASS='tiger' ssh -t $USER@server006.web.com "sudo su - http" This Works, but I was trying to get it to run a script afterwards, and if I do, using -c or < The script does a grep like this: grep -i "Exception:" /opt/local/server/logs/exceptions.log | grep -e "|*-*-*:*:*,*|" | tail -1 | awk -F'|' '{print $2}' >> log