root

linux的一些基本操作命令

放肆的年华 提交于 2019-12-30 10:29:13
创建目录 mkdir /home/damengsheng/Desktop 在Desktop目录下创建一个文件 tap 键补全 -v 创建的同时补全 dir{2…3} 创建多个文件 -p 创建多个文件 ls 查看当前目录下的所有文件 属性 /home 查看文件目录下的所有文件 ll 详细显示(ls -l) -a 显示全部文件(开始的文件都是隐藏文件 .当前目录 … 上一级目录) tty 终端文件 pwd 查看所在当前目录路径 data 查看当前时间 shell命令行快捷键 ctrl + L 清屏 或者指令 ctrl+a=开始位置 ctrl+e=最后位置 ctrl+k=删除此处至末尾所有内容 ctrl+u=删除此处至开始所有内容 ctrl+d=删除当前字母 ctrl+w=删除此处到左边的单词 ctrl+y=粘贴由ctrl+u,ctrl+d,ctrl+w删除的单词 CTRL+INSERT :复制 SHIFT+INSERT:粘贴 Esc . 自动补全上次操控的文件路径 历史命令: !字符串,快速搜索历史 ^R搜索历史 which date 查看某个命令在哪个包下 touch file 创建文件 /home/file{6,7} 创建多个同名文件 cd /home/alice/Desktop 到达某一集目录 cd 直接回家 cd … 返回上一级 cd - 返回上次目录 cp 复制文件 cp

写给大忙人的centos下ftp服务器搭建(以及启动失败/XFTP客户端一直提示“用户身份验证失败”解决方法)

送分小仙女□ 提交于 2019-12-30 07:29:47
注:个人对偏向于底层基本上拿来就用的应用,倾向于使用安装包,直接yum或者rpm安装;而对于应用层面控制较多或者需要大范围维护的,倾向于直接使用tar.gz版本。 对于linux下的ftp服务器,实际上有很多的实现,只不过较广泛的在使用的是vsftpd,它是UNIX下一个GPL FTP服务器,全称 very secure FTP daemon,官网https://security.appspot.com/vsftpd.html 。 1、安装vsftpd,yum install vsftpd 安装完成后,可以执行which vsftpd检查是否安装成功,同时会在/etc/vsftpd下创建三个配置文件,如下: [root@elk1 vsftpd]# ll 总用量 20 -rw-------. 1 root root 125 8月 3 2017 ftpusers # 指定哪些用户不能访问FTP服务器,这里的用户包括root在内的一些重要用户。 -rw-------. 1 root root 361 8月 3 2017 user_list # 指定的用户是否可以访问ftp服务器,通过vsftpd.conf文件中的userlist_deny的配置来决定配置中的用户是否可以访问,userlist_enable=YES ,userlist_deny=YES ,userlist_file=

Writing file on system partition

淺唱寂寞╮ 提交于 2019-12-30 07:03:08
问题 I am trying to write a file, generated by my app, onto the system partition. As I can not create an FileOutputStream inside my app I create the file in the data directory of my app, correct the permissions and then move it to the system partition. At the moment the code below misses the writable remount of /system - for testing purposes I have performed this step successfully via adb remount - therefore this should not be the problem. The app also gets successfully root permissions. But the

平衡树 区间树 学习

巧了我就是萌 提交于 2019-12-30 05:44:05
前记 把之前学的平衡树都写一下,最近更新:Splay Treap 本人的Treap丢了,放之前学习的Treap看看 #include<bits/stdc++.h> using namespace std; struct Treap{ static const int MAXN=400000+10; static const int INF=2000000000; struct Node{ int val; int pri; int cnt; int r,l; int size; }tree[MAXN]; int root; int top; Treap(){ root=0; top=0; } void update(int node){ // 更新 node 的 size 值,相当于 Segment Tree 的 pushup tree[node].size=tree[tree[node].l].size+tree[tree[node].r].size+tree[node].cnt; } void zig(int& node) // 左旋,可以看到会修改 node 的值,因此传入了一个引用 { int root=tree[node].r; tree[node].r=tree[root].l; tree[root].l=node; update(node); update(root)

Jumper跳板机,远程主机相关配置

孤街醉人 提交于 2019-12-30 05:33:12
1、Jumper-server   登录方式   ssh user@ip登录    【默认22端口,如未添加user,默认使用当前登录账户登录】   ssh -luser ip -pport    【使用指定用户,指定端口登录】   ssh 使用主机名登录   【 需要在跳板机上添加配置hosts文件vim /etc/hosts】    2、app1-server   查看ssh命令所在路径   [root@app1-server ~]# which ssh   /usr/bin/ssh   查询软件包   [root@app1-server ~]# rpm -qf /usr/sbin/sshd   openssh-server-5.3p1-123.el6_9.x86_64   查询软件列表    [root@app1-server ~]# rpm -qf /usr/sbin/sshd   openssh-server-5.3p1-123.el6_9.x86_64   [root@app1-server ~]# rpm -ql openssh-server   /etc/pam.d/ssh-keycat   /etc/pam.d/sshd   /etc/rc.d/init.d/sshd   /etc/ssh/sshd_config   /etc/sysconfig/sshd   

解决ssh登录后闲置时间过长而断开连接

纵然是瞬间 提交于 2019-12-30 05:24:37
时我们通过终端连接服务器时,当鼠标和键盘长时间不操作,服务器就会自动断开连接,我们还的需要重新连接,感觉很麻烦,总结一下解决此问题的方法 方法一、 修改/etc/ssh/sshd_config配置文件,找到ClientAliveCountMax(单位为分钟)修改你想要的值, 执行service sshd reload 方法二、 找到所在用户的.ssh目录,如root用户该目录在: /root/.ssh/ 在该目录创建config文件 vi /root/.ssh/config 加入下面一句: ServerAliveInterval 60 保存退出,重新开启root用户的shell,则再ssh远程服务器的时候, 不会因为长时间操作断开。应该是加入这句之后,ssh客户端会每隔一 段时间自动与ssh服务器通信一次,所以长时间操作不会断开。 方法三、 修改/etc/profile配置文件 # vi /etc/profile 增加:TMOUT=1800 这样30分钟没操作就自动LOGOUT 方法四、 利用expect 模拟键盘动作,在闲置时间之内模拟地给个键盘响应,将下列代码保存为xxx,然后用expect执行 #!/usr/bin/expect set timeout 60 spawn ssh user@host interact { timeout 300 {send "\x20"} }

Can I disable systemui From within my android app?

烈酒焚心 提交于 2019-12-30 04:34:10
问题 I used this answer to achieve a Kiosk Mode for my app: https://stackoverflow.com/a/26013850 I rooted the tablet with Kingo Root and then performed the following commands: adb shell > su > pm disable com.android.systemui > I am building an app that will only be used on our devices as kiosks.... It works great BUT.. I would like to perform the disable and enable of the system ui from the Android application itself. Are system commands possible from within an application? 回答1: /** * Uses Root

linux高级-系统优化

夙愿已清 提交于 2019-12-30 04:12:46
linux系统优化 文章目录 linux系统优化 系统资源限制优化 内核参数优化 系统资源限制优化 #cat /etc/security/limits.conf #root账⼾的资源软限制和硬限制 (Ubuntu需要添加上下两部分) root soft core unlimited root hard core unlimited root soft nproc 1000000 root hard nproc 1000000 root soft nofile 1000000 root hard nofile 1000000 root soft memlock 32000 root hard memlock 32000 root soft msgqueue 8192000 root hard msgqueue 8192000 #其他账⼾的资源软限制和硬限制 (centos系统只需要下面这一部分即可) * soft core unlimited * hard core unlimited * soft nproc 1000000 * hard nproc 1000000 * soft nofile 1000000 * hard nofile 1000000 * soft memlock 32000 * hard memlock 32000 * soft msgqueue 8192000

Tkinter组件详解(六):Text

孤街浪徒 提交于 2019-12-30 03:50:51
Tkinter组件详解之Listbox Text(文本)组件用于显示和处理多行文本。在 Tkinter 的所有组件中,Text 组件显得异常强大和灵活,适用于多种任务。虽然该组件的主要目的是显示多行文本,但它常常也被用于作为简单的文本编辑器和网页浏览器使用。 何时使用 Text 组件? Text 组件用于显示文本文档,包含纯文本或格式化文本(使用不同字体,嵌入图片,显示链接,甚至是带 CSS 格式的 HTML 等)。因此,它常常也被用于作为简单的文本编辑器和网页浏览器使用。 用法 当你创建一个 Text 组件的时候,它里边是没有内容的。为了给其插入内容,你可以使用 insert() 方法以及 "insert" 或 "end" 索引号: import tkinter as tk root = tk.Tk() text = tk.Text(root) text.pack() # "insert" 索引表示插入光标当前的位置 text.insert( "insert" , "I love " ) text.insert( "end" , "Python.com!" ) root.mainloop() 值得一提的是,Text 组件的 insert() 方法有一个可选的参数,用于指定一个或多个“标签”(标签用于设置文本的格式,请参考下方【Tags 用法】)到新插入的文本中: import

树莓派整理笔记-1

余生长醉 提交于 2019-12-30 03:04:56
1. 下载镜像,安装软件 安装Win32DiskImager-0.9.5-install.exe到电脑上。 打开此软件,选择官方系统img,选择SD卡的盘符,这里不能选错,否则会被格式化, 2. 烧录 选择Write进行烧录,等待烧录完成,拔掉SD卡,插入树莓派上电,系统会自动安装完成。 3、错误 Linux开机出现Give root password for maintenance (or type Control-D to continue):解决办法 (1)、输入root密码,因为文件系统是只读系统,不能进行修改文件,利用下面的命令将文件系统改为可写的文件系统 mount -o remount, rw / 查看是否挂载了不存在或异常的磁盘 df -h ,将对应出错的磁盘注释掉,或者将最后面的参数改成0 。 然后退出保存,reboot (2)、输入root密码进入系统,使用fsck命令修复文件系统。 fsck /dev/root fsck -A -y 5、SSH配置远程登录 进入linux系统更改root密码 ,设置自己想要的密码 sudo passwd root 更改成功后然后 sudo passwd --unlock root 将root用户解锁。 其实官方的树莓派系统没有开启SSH服务,需要我们人为的开启SSH服务,我们需要在HDMI显示器上的命令行终端上输入 sudo