BusyBox

bash: unable to set and use alias in the same line

南笙酒味 提交于 2019-11-28 07:57:55
问题 I would expect the second line to say foo instead of command not found : $ alias foo="echo bac" ; foo; -bash: foo: command not found $ foo bac $ Why won't the second line say foo ? Tested with the following shells, same behavior: bash 3.2.5 zsh 5.0.8 dash 0.5.9 busybox 1.25.0 回答1: The behaviour you're seeing is described in the Bash Reference Manual (emphasis mine): The rules concerning the definition and use of aliases are somewhat confusing. Bash always reads at least one complete line of

k8s实践(六):Pod资源管理

帅比萌擦擦* 提交于 2019-11-28 05:47:40
环境说明: 主机名 操作系统版本 ip docker version kubelet version 配置 备注 master Centos 7.6.1810 172.27.9.131 Docker 18.09.6 V1.14.2 2C2G 备注 node01 Centos 7.6.1810 172.27.9.135 Docker 18.09.6 V1.14.2 2C2G 备注 node02 Centos 7.6.1810 172.27.9.136 Docker 18.09.6 V1.14.2 2C2G 备注 k8s集群部署详见: Centos7.6部署k8s(v1.14.2)集群 k8s学习资料详见: 基本概念、kubectl命令和资料分享 一、计算资源管理(Compute Resources) 1. 概念   在配置Pod时,我们可以为其中的每个容器指定需要使用的计算资源(CPU和内存)。计算资源的配置项分为两种:Requests和Limits。Requests表示容器希望被分配到的、可完全保证的资源量(资源请求量);Limits是容器最多能使用的资源量的上限(资源限制量)。   资源请求量能够保证Pod有足够的资源来运行,资源限制量则是防止某个Pod无限制地使用资源,导致其他Pod崩溃。   我们创建一个pod时,可以指定容器对CPU和内存的资源请求量及资源限制量

Go-compiled binary won't run in an alpine docker container on Ubuntu host

馋奶兔 提交于 2019-11-28 04:28:47
Given a binary, compiled with Go using GOOS=linux and GOARCH=amd64 , deployed to a docker container based on alpine:3.3 , the binary will not run if the docker engine host is Ubuntu (15.10): sh: /bin/artisan: not found This same binary (compiled for the same OS and arch) will run just fine if the docker engine host is busybox (which is the base for alpine ) deployed within a VirtualBox VM on Mac OS X. This same binary will also run perfectly fine if the container is based on one of Ubuntu images. Any idea what this binary is missing? This is what I've done to reproduce (successful run in

为Android安装BusyBox —— 完整的bash shell

夙愿已清 提交于 2019-11-28 02:38:47
  大家是否有过这样的经历,在命令行里输入adb shell,然后使用命令操作你的手机或模拟器,但是那些命令都是常见Linux命令的阉割缩水版,用起来很不爽。是否想过在Android上使用较完整的shell呢?用BusyBox吧。不论使用adb连接设备使用命令行还是在手机上直接用terminal emulator都可以。   一、什么是BusyBox ?   BusyBox 是标准 Linux 工具的一个单个可执行实现。BusyBox 包含了一些简单的工具,例如 cat 和 echo,还包含了一些更大、更复杂的工具,例如 grep、find、mount 以及 telnet。有些人将 BusyBox 称为 Linux 工具里的瑞士军刀.简单的说BusyBox就好像是个大工具箱,它集成压缩了 Linux 的许多工具和命令。(摘自百度百科)   二、在Android上安装BusyBox   准备:   1. 下载BusyBox的binary,打开这个地址 http://www.busybox.net/downloads/binaries ,选择最新版本,然后下载对应你的设备架构的版本,这里我下载了busybox-armv6l,下面将以这个文件名为示例。   2. 需要有一个命令行的环境,在电脑上使用adb或在手机上使用terminal emulator。   3. 连接手机和电脑

How to compile Busybox?

匆匆过客 提交于 2019-11-28 02:09:41
问题 (The i9100 and i9100p phones have Exynos 4210 SoC which includes Cortex A9 dual core 1.2Ghz processor which supports NEON.) I will compile the latest busybox source snapshot available and upload it for everyone for free on internet and maybe even make my own free BusyboxInstaller.apk (I already downloaded today's 14th March snapshot from the official website) because so many busybox installers have very outdated versions and I want to take advantage of possible optimizations for the Cortex A9

How to schedule a cronjob which executes a kubectl command?

大兔子大兔子 提交于 2019-11-28 01:59:02
问题 How to schedule a cronjob which executes a kubectl command? I would like to run the following kubectl command every 5 minutes: kubectl patch deployment runners -p '{"spec":{"template":{"spec":{"containers":[{"name":"jp-runner","env":[{"name":"START_TIME","value":"'$(date +%s)'"}]}]}}}}' -n jp-test For this, I have created a cronjob as below: apiVersion: batch/v1beta1 kind: CronJob metadata: name: hello spec: schedule: "*/5 * * * *" jobTemplate: spec: template: spec: containers: - name: hello

Docker私有仓库

半城伤御伤魂 提交于 2019-11-27 20:03:43
一、前言    Docker hub为我们提供了很多官方镜像和个人上传的镜像,我们可以下载机构或个人提供的镜像(如ubuntu,busybox...),也可以上传我们自己的本地镜像,然后我们需要的时候也可以随时下载。看着很是方便,但是也有不方便的地方: (1)那就是我们在从dockerhub上下载和上传镜像速度可能受影响,有时可能docker主页都打不开。 (2)我们在生产上所使用的docker镜像可能存放着我们的code,tools,不想被外部人员获取,只允许内网的开发人员下载。如果上传到dockerhub上所有人都可以看到。这和github上的公共库是一样的。 (3)在内部网络搭建docker私有仓库可以使内网人员下载和上传都非常快速,不受外网带宽等因素的影响,同时不在内网的人员无法下载我们的镜像,上述两个缺点都很好的解决了 二、搭建docker私有仓库   1.下载registry镜像 docker pull registry 默认情况下,会将仓库存放于容器内的/var/lib/registry目录下,这样如果容器被删除,则存放于容器中的镜像也会丢失,所以我们一般情况下会指定本地一个目录 2. 创建本地存储目录 mkdir -p /data/docker_registry 3. 启动镜像容器并挂载本地目录 docker run -d -p 5000:5000 -v /data

how to use linux software watchdog

旧街凉风 提交于 2019-11-27 19:49:49
Hi can anybody tell me how to handle the software watchdog in linux .I have a program "SampleApplication" which runs continuously and I need to restart it if its hangs or closes unexpectedly. I was googling about this and found linux has watchdog at /dev/watchdog but dont know how to use it.Could someone help me with example. My question is where to I specify my application name and delay interval to restart . As I am new to linux please brief me with sample if possible. Thanks Most of the Unix/Linux init programs will manage daemons for you and restart them. Look into placing your service in

Go-compiled binary won't run in an alpine docker container on Ubuntu host

夙愿已清 提交于 2019-11-27 19:15:53
问题 Given a binary, compiled with Go using GOOS=linux and GOARCH=amd64 , deployed to a docker container based on alpine:3.3 , the binary will not run if the docker engine host is Ubuntu (15.10): sh: /bin/artisan: not found This same binary (compiled for the same OS and arch) will run just fine if the docker engine host is busybox (which is the base for alpine ) deployed within a VirtualBox VM on Mac OS X. This same binary will also run perfectly fine if the container is based on one of Ubuntu

S3C2440 制作最新busybox文件系统

雨燕双飞 提交于 2019-11-27 12:24:24
2. 制作基本文件系统 2.1 下载源码 文件系统是根据busybox来制作的. 所以网上下载: https://busybox.net/downloads/ 我下的是最新的1.31版本, 用tar vxJf 解压后. 2.2 配置交叉编译环境 make defconfig make menuconfig setting-> Cross compile prefix和Path to sysroot要配置 [/opt/gcc-4.6.4/bin/arm-linux-] [/opt/gcc-4.6.4/arm-arm1176jzfssf-linux-gnueabi/sysroot] 2.3 裁剪同百度 不裁也行 2.4 编译 make V=s ... 最后成功后: LINK busybox_unstripped Trying libraries: crypt m resolv Library crypt is not needed, excluding it Library m is needed, can't exclude it (yet) Library resolv is needed, can't exclude it (yet) Final link with: m resolv DOC busybox.pod DOC BusyBox.txt DOC busybox.1