我的文件中有以下条目.gitignore,我想删除它们。原因是这些文件是 TeX 编译期间创建的临时垃圾文件,我希望能够删除它们。
我怎样才能做到这一点?
我已经完成了以下 shell 脚本,这些脚本/etc/issue使用所有非环回接口的当前 ip更新:
#!/bin/sh
echo "You can use one of the following ip addresses in order to look the page or even ssh into the machine" > /etc/issue
ip -4 -o addr show up scope global | awk '{print $2,":",$4}'| sed -e "s/\/[1-9]*//" >> /etc/issue
Run Code Online (Sandbox Code Playgroud)
现在我想让它在启动时运行,以便/etc/issue使用网络 ips更新。在基于 Debian 的发行版上,我会把它放在上面,/etc/rc.local但 alpine 没有这个文件。我将如何使这个脚本以等效的方式运行/etc/rc.local?
我试图戴上它,/etc/local.d但它未能正确改变/etc/issue
当我在看这个答案/sf/answers/774563751/以弄清楚如何使用参数时,--something或者-s关于答案脚本的一些问题:
#!/bin/bash
TEMP=`getopt -o ab:c:: --long a-long,b-long:,c-long:: \
-n 'example.bash' -- "$@"`
if [ $? != 0 ] ; then echo "Terminating..." >&2 ; exit 1 ; fi
# Note the quotes around `$TEMP': they are essential!
eval set -- "$TEMP"
while true ; do
case "$1" in
-a|--a-long) echo "Option a" ; shift ;;
-b|--b-long) echo "Option b, argument \`$2'" ; shift 2 ;;
-c|--c-long)
# c has an optional argument. As we …Run Code Online (Sandbox Code Playgroud) 有时当我运行命令时:
sudo apk update && sudo apk upgrade
Run Code Online (Sandbox Code Playgroud)
即使连接到互联网,Alpine linux 也无法更新软件包。但是,如果我这样做了,sudo su "echo 'nameserver 8.8.8.8' > /etc/resolv.conf"我会设法下载它们。但是这个解决方案:
/etc/resolv.conf会被自己覆盖。我怎样才能有一个更永久的解决方案?
在我的 ubuntu GNU/Linux 机器上,我尝试从我的项目构建图像
docker-compose build --no-cache --force-rm
Run Code Online (Sandbox Code Playgroud)
我收到以下错误:
ERROR: Couldn't connect to Docker daemon at http+docker://localunixsocket - is it running?
If it's at a non-standard location, specify the URL with the DOCKER_HOST environment variable.
Run Code Online (Sandbox Code Playgroud)
但是当我尝试使用 sudo 时,我可以构建它们:
sudo docker-compose build --no-cache --force-rm
Run Code Online (Sandbox Code Playgroud)
但我觉得它有点神秘,因为我可以在不需要 sudo 的情况下启动它们:
docker-compose up
Run Code Online (Sandbox Code Playgroud) 我尝试在没有docker 的虚拟机上运行的 Alpine GNU/Linux 发行版上设置 LEMP 堆栈。
然后我尝试php7-mysqli通过社区存储库安装:
sudo apk add php7-mysqli
Run Code Online (Sandbox Code Playgroud)
但我收到以下错误:
ERROR: unsatisfiable constraints:
so:libcrypto.so.43 (missing):
required by: php7-openssl-7.2.5-r0[so:libcrypto.so.43] php7-openssl-7.2.5-r0[so:libcrypto.so.43]
so:libssl.so.45 (missing):
required by: php7-openssl-7.2.5-r0[so:libssl.so.45] php7-openssl-7.2.5-r0[so:libssl.so.45]
Run Code Online (Sandbox Code Playgroud)
我已经安装了libressl,但错误仍然存在。知道为什么会发生这种情况吗?请记住,我已将存储库设置为社区的存储库:
http://dl-2.alpinelinux.org/alpine/edge/community
Run Code Online (Sandbox Code Playgroud)
我按照https://www.cyberciti.biz/faq/how-to-install-php-7-fpm-on-alpine-linux/中提到的说明进行操作
libressl2.6-libcrypto-2.6.3-r0我尝试通过以下命令安装:
sudo apk add libressl2.6-libcrypto-2.6.3-r0
Run Code Online (Sandbox Code Playgroud)
我得到以下输出:
ERROR: unsatisfiable constraints:
libressl2.6-libcrypto-2.6.3-r0 (missing):
required by: world[libressl2.6-libcrypto-2.6.3-r0]
Run Code Online (Sandbox Code Playgroud)
如果我尝试安装该libressl软件包,我会收到以下响应:
sudo apk add libressl
(1/2) Installing libressl2.6-libtls (2.6.3-r0)
(2/2) Installing libressl (2.6.3-r0)
Executing busybox-1.27.2-r8.trigger
OK: 119 MiB in 53 packages
Run Code Online (Sandbox Code Playgroud)
问题仍然存在。
我还尝试 …
我制作了一个简单的脚本,每分钟执行一个命令:
#!/usr/bin/env sh
while true; do
exec "$@"
sleep 60
done
Run Code Online (Sandbox Code Playgroud)
这个想法是把它作为一个Docker 入口点,让我能够运行 Laravel 调度程序。但在构建图像之前,我想对其进行测试:
$ ./entrypoint/entrypoint_cron.sh echo "Hello"
Hello
Run Code Online (Sandbox Code Playgroud)
但该命令只执行一次。为什么?如何使参数中提供的命令连续循环运行,直到我用Ctrl+终止它C?
alpine-linux ×3
shell-script ×3
bash ×1
docker ×1
eval ×1
exec ×1
getopts ×1
git ×1
linux ×1
php7 ×1
resolv.conf ×1
rm ×1
startup ×1
sudo ×1
ubuntu ×1