我已将密码作为纯文本存储在 txt 文件中。现在我想编写脚本,该脚本将从 txt 文件中读取纯文本,然后它应该对其进行加密和解密。
我必须在我的机器上设置一个 FTP 服务器。我已经使用以下命令安装了 vsftpd:
sudo apt-get install vsftpd
Run Code Online (Sandbox Code Playgroud)
然后我编辑vsftpd.conf了位置中的配置文件/etc。该文件包含:
#Set the server to run in standalone mode
listen=YES
#Enable anonymous access
local_enable=NO
anonymous_enable=YES
#Disable write access
write_enable=NO
#Set root directory for anon connections
anon_root=/var/ftp
#Limit retrieval rate
anon_max_rate=2048000
#Enable logging user login and file transfers. /var/log/vsftpd.log
xferlog_enable=YES
#Set interface and port
listen_address=192.120.43.250
listen_port=21
Run Code Online (Sandbox Code Playgroud)
IP 地址 192.120.43.250 是我服务器的 eth0。当我运行命令时
sudo vsftpd /etc/vsftpd.conf
Run Code Online (Sandbox Code Playgroud)
我收到错误:
500 OOPS: could not bind listening IPv4 socket
Run Code Online (Sandbox Code Playgroud)
要检查端口 21 上正在运行的内容,我运行了以下命令:
sudo netstat -tulpn …Run Code Online (Sandbox Code Playgroud) 在 Vim(更具体地说,MacVim)中,如果我已经使用设置了工作目录:cd并且我想打开*.py该目录中的所有文件,有没有办法在 Vim 中这样做?我预计:e *.py会工作,但得到了E77: Too many file names错误。:help edit似乎没有提供一次打开多个文件的方法,只有一个。
使用rsync命令我只想将更改的文件/文件夹复制/同步到目标文件夹。每当我执行rsync命令时,我都会遇到一些类似 Rsync 的问题,它也会与时间戳一起复制。
例如,我的目标文件夹“Linux”已在 1 个月前更新,而在我的源文件夹中,“Linux”文件夹没有更新信息,但是当我执行rsync命令时,我的目标“Linux”文件夹时间戳已更新为最新的源文件夹时间戳。我不想复制时间戳。请就此向我提出建议,并请浏览以下我使用过的命令。
rsync -avh /source/Linux/ /destination/Linux/
rsync -uan /source/Linux/ /destination/Linux/
rsync -uav /source/Linux/ /destination/Linux/
Run Code Online (Sandbox Code Playgroud) 在使用 fish 作为我的 shell 时,我尝试使用以下命令设置对当前目录中的一堆 c 源文件的权限
find . -type f -name "*.c" -exec chmod 644 {} +;
Run Code Online (Sandbox Code Playgroud)
我收到一个错误
查找:缺少`-exec'的参数
或者
find . -type f -name "*.c" -exec chmod 644 {} \;
Run Code Online (Sandbox Code Playgroud)
我收到一个错误
chmod: 无法访问 '': 没有那个文件或目录
怎么了?
如何mv在命令外壳中处理(例如应用命令)-名称中带有前导破折号 ( )的文件?命令
mv -weirdfilename.zip normalfilename.zip
Run Code Online (Sandbox Code Playgroud)
自然地-在文件名的开头接受作为参数。
我已经执行了以下命令
cat /proc/loadavg && date
Run Code Online (Sandbox Code Playgroud)
实际结果:
0.00 0.00 0.00 1/803 26256
Fri Aug 26 09:00:56 EEST 2016
Run Code Online (Sandbox Code Playgroud)
预期结果:
0.00 0.00 0.00 1/803 26256 @@ Fri Aug 26 09:00:56 EEST 2016
Run Code Online (Sandbox Code Playgroud)
我试过sed和tr,但没有奏效。
cat /proc/loadavg && date | sed 's/\n/ @@ /g'
cat /proc/loadavg && date | tr '\n' ' @@ '
Run Code Online (Sandbox Code Playgroud)
任何想法,我缺少什么?
我在我的 centos 机器上运行 syslog 服务器(rsyslog 8)。我想映射网络中的其他设备以将日志发送到此 syslog 服务器。如果映射正确完成,系统日志将在 centos 机器中存储的确切位置。/var/log/messages文件夹 ?
在调试加载失败的服务时,人们希望做的一项常见任务是查看上次服务启动时的所有日志。
例如,给定
Jul 25 08:18:20 raspberrypi ngrok[3105]: Incorrect Usage: flag provided but not defined: -log
Jul 25 08:20:04 raspberrypi systemd[1]: ngrok@ssh.service holdoff time over, scheduling restart.
Jul 25 08:20:04 raspberrypi systemd[1]: Stopping Share local port(s) with ngrok...
Jul 25 08:20:04 raspberrypi systemd[1]: Starting Share local port(s) with ngrok...
Jul 25 08:20:04 raspberrypi systemd[1]: Started Share local port(s) with ngrok.
Jul 25 08:20:04 raspberrypi ngrok[5474]: t=2016-07-25T08:20:04+0000 lvl=warn msg="failed to get home directory, using $HOME instead" err="user: Current not implemented on linux/arm" …Run Code Online (Sandbox Code Playgroud) 对于文件比较命令diff,仅比较文本的文件比较需要哪些选项?
我的意思是我想忽略所有空格、制表符、换行符等。
我一直在尝试不同的选择,但未能达到预期的结果。