通知设置 新通知
armdebian 修改大写键 为esc
李魔佛 发表了文章 • 0 个评论 • 62 次浏览 • 2021-01-18 18:15
armdebian上没有xmodmap 这个软件,但有一个xkeycaps的GUI的小应用,可以很方便地修改在图形界面上修改按键映射。
而且xkeycaps修改是持续有效的,如果想该回去,上面有个restore的功能,可以一键恢复默认值。
查看全部
armdebian上没有xmodmap 这个软件,但有一个xkeycaps的GUI的小应用,可以很方便地修改在图形界面上修改按键映射。
而且xkeycaps修改是持续有效的,如果想该回去,上面有个restore的功能,可以一键恢复默认值。
bbdoc居然不支持代码搜索
李魔佛 发表了文章 • 0 个评论 • 102 次浏览 • 2021-01-03 16:54
什么python,cpp,java一个都不支持。
什么python,cpp,java一个都不支持。
网易云音乐居然还有linux版本,网易还是一个良心企业
李魔佛 发表了文章 • 0 个评论 • 290 次浏览 • 2020-12-18 11:31
啥时候有道云笔记也搞一个linux版本的呀.
如果要在ubuntu16.04上安装,就不要去官网下载,gclib库不兼容,要升级到18.04, 会会很折腾.
直接下载:
$ wget http://s1.music.126.net/downlo ... 4.deb --默认下载到Desktop
然后sudo dpkg -i xxxxx.deb 就可以啦
良心的还要搜狗,linux下的输入法好用.
更新:
安装上面方法安装后,可以打开,可以播放mv,不过就是无法播放声音.
需要解决依赖问题.
网上找到了好的方法: 亲测有效
更改源为阿里云的源
# deb cdrom:[Ubuntu 16.04 LTS _Xenial Xerus_ - Release amd64 (20160420.1)]/ xenial main restricted
deb-src http://archive.ubuntu.com/ubuntu xenial main restricted #Added by software-properties
deb http://mirrors.aliyun.com/ubuntu/ xenial main restricted
deb-src http://mirrors.aliyun.com/ubuntu/ xenial main restricted multiverse universe #Added by software-properties
deb http://mirrors.aliyun.com/ubuntu/ xenial-updates main restricted
deb-src http://mirrors.aliyun.com/ubuntu/ xenial-updates main restricted multiverse universe #Added by software-properties
deb http://mirrors.aliyun.com/ubuntu/ xenial universe
deb http://mirrors.aliyun.com/ubuntu/ xenial-updates universe
deb http://mirrors.aliyun.com/ubuntu/ xenial multiverse
deb http://mirrors.aliyun.com/ubuntu/ xenial-updates multiverse
deb http://mirrors.aliyun.com/ubuntu/ xenial-backports main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ xenial-backports main restricted universe multiverse #Added by software-properties
deb http://archive.canonical.com/ubuntu xenial partner
deb-src http://archive.canonical.com/ubuntu xenial partner
deb http://mirrors.aliyun.com/ubuntu/ xenial-security main restricted
deb-src http://mirrors.aliyun.com/ubuntu/ xenial-security main restricted multiverse universe #Added by software-properties
deb http://mirrors.aliyun.com/ubuntu/ xenial-security universe
deb http://mirrors.aliyun.com/ubuntu/ xenial-security multiversean然后运行 apt -f install 修复依赖关系就可以了.
查看全部
啥时候有道云笔记也搞一个linux版本的呀.
如果要在ubuntu16.04上安装,就不要去官网下载,gclib库不兼容,要升级到18.04, 会会很折腾.
直接下载:
$ wget http://s1.music.126.net/downlo ... 4.deb --默认下载到Desktop
然后sudo dpkg -i xxxxx.deb 就可以啦
良心的还要搜狗,linux下的输入法好用.
更新:
安装上面方法安装后,可以打开,可以播放mv,不过就是无法播放声音.
需要解决依赖问题.
网上找到了好的方法: 亲测有效
更改源为阿里云的源
# deb cdrom:[Ubuntu 16.04 LTS _Xenial Xerus_ - Release amd64 (20160420.1)]/ xenial main restricted然后运行 apt -f install 修复依赖关系就可以了.
deb-src http://archive.ubuntu.com/ubuntu xenial main restricted #Added by software-properties
deb http://mirrors.aliyun.com/ubuntu/ xenial main restricted
deb-src http://mirrors.aliyun.com/ubuntu/ xenial main restricted multiverse universe #Added by software-properties
deb http://mirrors.aliyun.com/ubuntu/ xenial-updates main restricted
deb-src http://mirrors.aliyun.com/ubuntu/ xenial-updates main restricted multiverse universe #Added by software-properties
deb http://mirrors.aliyun.com/ubuntu/ xenial universe
deb http://mirrors.aliyun.com/ubuntu/ xenial-updates universe
deb http://mirrors.aliyun.com/ubuntu/ xenial multiverse
deb http://mirrors.aliyun.com/ubuntu/ xenial-updates multiverse
deb http://mirrors.aliyun.com/ubuntu/ xenial-backports main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ xenial-backports main restricted universe multiverse #Added by software-properties
deb http://archive.canonical.com/ubuntu xenial partner
deb-src http://archive.canonical.com/ubuntu xenial partner
deb http://mirrors.aliyun.com/ubuntu/ xenial-security main restricted
deb-src http://mirrors.aliyun.com/ubuntu/ xenial-security main restricted multiverse universe #Added by software-properties
deb http://mirrors.aliyun.com/ubuntu/ xenial-security universe
deb http://mirrors.aliyun.com/ubuntu/ xenial-security multiversean
vimium 配合chrome 真的好用,尤其用惯vim的用户
李魔佛 发表了文章 • 0 个评论 • 216 次浏览 • 2020-11-22 01:59
上面是vimium的快捷键用法
windows下的分区挂载到linux下面,然后docker在上面挂载-无法识别
李魔佛 发表了文章 • 0 个评论 • 221 次浏览 • 2020-11-11 02:40
windows下的分区挂载到linux下面,然后docker在上面挂载-无法识别。
情况是这样的:
双系统的环境,一个ubuntu,一个windows。 ubuntu上的有个docker,但是ubuntu的分区比较小,需要挂载windows的ntfs分区来扩展空间。
其他程序用起来没什么问题,可是,在用docker 挂在windows分区下的文件夹,总是报错,用的 -v xxxx:xxxx 方式。
同样的docker启动命令,在ubuntu下的目录就没有问题,所以就开始怀疑是权限问题。
但是经过一系列的mount操作,chmod也给足了了权限,可是还没无法启动docker。
后来没办法,只好把windows分区缩小容量,把多余的容量格式化为ext分区格式,然后重新用docker mount -v, 后面docker就可以正常启动了。 查看全部
坑:
windows下的分区挂载到linux下面,然后docker在上面挂载-无法识别。
情况是这样的:
双系统的环境,一个ubuntu,一个windows。 ubuntu上的有个docker,但是ubuntu的分区比较小,需要挂载windows的ntfs分区来扩展空间。
其他程序用起来没什么问题,可是,在用docker 挂在windows分区下的文件夹,总是报错,用的 -v xxxx:xxxx 方式。
同样的docker启动命令,在ubuntu下的目录就没有问题,所以就开始怀疑是权限问题。
但是经过一系列的mount操作,chmod也给足了了权限,可是还没无法启动docker。
后来没办法,只好把windows分区缩小容量,把多余的容量格式化为ext分区格式,然后重新用docker mount -v, 后面docker就可以正常启动了。
FTP被部分网络运营商屏蔽
李魔佛 发表了文章 • 0 个评论 • 321 次浏览 • 2020-11-08 15:51
开始以为是我的tomato固件的路由器的问题,后来尝试换了路由器,问题还是存在。 所以我就怀疑是我的联通运营商的问题。
我的FTP无论使用主动式还是被动式连接,都会出问题。 而我换成用手机热点,作为wifi让我的电脑连上去,这个时候就没有问题了。 妥妥的网络问题,渣渣联通运营商。
查看全部
开始以为是我的tomato固件的路由器的问题,后来尝试换了路由器,问题还是存在。 所以我就怀疑是我的联通运营商的问题。
我的FTP无论使用主动式还是被动式连接,都会出问题。 而我换成用手机热点,作为wifi让我的电脑连上去,这个时候就没有问题了。 妥妥的网络问题,渣渣联通运营商。
斐讯N1 armlinux 长时间运行会导致文件系统只读 readonly
李魔佛 发表了文章 • 0 个评论 • 305 次浏览 • 2020-10-25 00:24
比如放着几个晚上不关机,然后文件系统变成了只读,无法写入文件,提示只读系统。
原因是系统分区有坏道。 可能由于关机使用拔电源的方式导致的。
所以要养成好的习惯,正常关机,使用命令 shutdown -h 或者点击关机按钮就好了。
那么如果出现了上述问题,怎么办?
可以使用用U盘启动,运行一次e2fsck /dev/mmcblk1p2
然后选择Y,修复坏道就可以了。
U盘启动就是之前刷Armlinux时的那个U盘。
接上U盘,然后上电启动即可。 然后进入系统运行上述的命令:
e2fsck /dev/mmcblk1p2
查看全部
比如放着几个晚上不关机,然后文件系统变成了只读,无法写入文件,提示只读系统。
原因是系统分区有坏道。 可能由于关机使用拔电源的方式导致的。
所以要养成好的习惯,正常关机,使用命令 shutdown -h 或者点击关机按钮就好了。
那么如果出现了上述问题,怎么办?
可以使用用U盘启动,运行一次e2fsck /dev/mmcblk1p2
然后选择Y,修复坏道就可以了。
U盘启动就是之前刷Armlinux时的那个U盘。
接上U盘,然后上电启动即可。 然后进入系统运行上述的命令:
e2fsck /dev/mmcblk1p2
Started update UTMP about system Runlevel during booting ubuntu/armlinux
李魔佛 发表了文章 • 0 个评论 • 633 次浏览 • 2020-10-20 13:33
Started update UTMP about system Runlevel
Finally, i try to enter into secure mode and check logs.
it was caused by system disk is out of space.
So i try to delete some unless file to release some space, then reboot system, then everything is ok now.
http://30daydo.com/article/617
查看全部
Started update UTMP about system Runlevel
Finally, i try to enter into secure mode and check logs.
it was caused by system disk is out of space.
So i try to delete some unless file to release some space, then reboot system, then everything is ok now.
http://30daydo.com/article/617
zsh历史记录文件损坏: zsh: corrupt history file /home/admin/.zsh_history
李魔佛 发表了文章 • 0 个评论 • 547 次浏览 • 2020-10-09 18:12
mv .zsh_history .zsh_history_bad
strings .zsh_history_bad > .zsh_history
fc -R .zsh_history
如果最后一步提示出错 fc的参数不对,可以进入zsh,然后再执行 fc -R .zsh_histroy
原创文章,转载请注明出处:
http://30daydo.com/article/612
查看全部
cd ~
mv .zsh_history .zsh_history_bad
strings .zsh_history_bad > .zsh_history
fc -R .zsh_history
如果最后一步提示出错 fc的参数不对,可以进入zsh,然后再执行 fc -R .zsh_histroy
原创文章,转载请注明出处:
http://30daydo.com/article/612
Elastic Search报错:Fielddata is disabled on text fields by default
Python火花灵感 发表了文章 • 0 个评论 • 518 次浏览 • 2020-09-16 19:26
常见原因
在 ElasticSearch 中,Fielddata 默认在 text 类型的字段时是不启用的。设想,如果默认打开,那么你的数据中,每个字符串大概率不一样的话,那么这个字段需要的集合大小(Cardinality)会非常大。
而这个字段是需要存在内存中的 (heap),因此不可能默认打开。所以如果你从一个 script 来对一个 text 字段进行排序、聚合或者查询的话,就会出现这个错误。Fielddata is disabled on text fields by default. Set `fielddata=true` on [`你的字段名字`] in order to load fielddata in memory by uninverting the inverted index. Note that this can however use significant memory.
Fielddata is disabled on text fields by default 解答方法看这篇:
ES 如何解决 Fielddata is disabled on text fields by default 错误
查看全部
常见原因
在 ElasticSearch 中,Fielddata 默认在 text 类型的字段时是不启用的。设想,如果默认打开,那么你的数据中,每个字符串大概率不一样的话,那么这个字段需要的集合大小(Cardinality)会非常大。
而这个字段是需要存在内存中的 (heap),因此不可能默认打开。所以如果你从一个 script 来对一个 text 字段进行排序、聚合或者查询的话,就会出现这个错误。Fielddata is disabled on text fields by default. Set `fielddata=true` on [`你的字段名字`] in order to load fielddata in memory by uninverting the inverted index. Note that this can however use significant memory.
Fielddata is disabled on text fields by default 解答方法看这篇:
ES 如何解决 Fielddata is disabled on text fields by default 错误
git命令行查看图形化的分支信息与commit 缩写id
李魔佛 发表了文章 • 0 个评论 • 933 次浏览 • 2020-06-21 16:56
可以使用 git log 加若干参数
git log --graph --pretty=oneline --abbrev-commit
效果是这样的:
而实际在source tree中是这样的:
查看全部
docker run 和 create 区别
李魔佛 发表了文章 • 0 个评论 • 2877 次浏览 • 2019-11-25 13:49
docker create command creates a writeable container from the image and prepares it for running.
docker run command creates the container (same as docker create ) and starts it.
查看全部
docker create command creates a writeable container from the image and prepares it for running.
docker run command creates the container (same as docker create ) and starts it.
用docker编译go代码
李魔佛 发表了文章 • 0 个评论 • 1050 次浏览 • 2019-11-25 13:45
1. 用文本编辑你的go代码,现在以hello world为例:
package main import "fmt" func main() {
/* 这是我的第一个简单的程序 */
fmt.Println("Hello, World!")
}
2. 然后直接使用docker执行编译。docker首先会自动去下载go的编译器,顺便把所有的依赖给解决掉
docker run --rm -v "$(pwd)":/usr/src/hello -w /usr/src/hello golang:1.3 go build -v
最后会在本地生成一个编译好的hello静态文件。
上述docker命令的具体含义就是把当前路径挂在到docker容器里头,然后切换到改到改路径下,然后进行编译。 查看全部
如果偶尔需要编译go代码,但是又不想要安装一堆乱七八糟的依赖和Go编译器,可以利用docker来实现。 应该是解决起来话费时间最小的。
1. 用文本编辑你的go代码,现在以hello world为例:
package main import "fmt" func main() {
/* 这是我的第一个简单的程序 */
fmt.Println("Hello, World!")
}
2. 然后直接使用docker执行编译。docker首先会自动去下载go的编译器,顺便把所有的依赖给解决掉
docker run --rm -v "$(pwd)":/usr/src/hello -w /usr/src/hello golang:1.3 go build -v
最后会在本地生成一个编译好的hello静态文件。
上述docker命令的具体含义就是把当前路径挂在到docker容器里头,然后切换到改到改路径下,然后进行编译。
docker实战 代码勘误
李魔佛 发表了文章 • 0 个评论 • 772 次浏览 • 2019-11-25 11:24
看这本书的作者一定要看,不然坑挺多的。
一路采坑过来的哭着说。Last updated August 21, 2016
In an effort to offer continued support beyond publication, we have listed many updates to code due to version updates.
[code - omission] Page 18
The command to start the "mailer" is missing a line. Where the book reads:
docker run -d \
--name mailer \
the proper command should read:
docker run -d \
--name mailer \
dockerinaction/ch2_mailer
[code - regression] Page 68
Newer versions of Docker have changed the structure of the JSON returned by the docker inspect subcommand. If the following command does not work then use the replacement. Original:
docker inspect --format "{{json .Volumes}}" reader
Replacement:
docker inspect --format "{{json .Mounts}}" reader
[code - regression] Page 69
Newer versions of Docker have changed the structure of the JSON returned by the docker inspect subcommand. If the following command does not work then use the replacement. Original:
docker inspect --format "{{json .Volumes}}" student
Replacement:
docker inspect --format "{{json .Mounts}}" student
[code - regression] Page 74
The alpine image entrypoint has changed since original publication and has been unset. The last command on the page should now read:
docker run --rm \
--volumes-from tools \
--entrypoint /bin/sh \
alpine:latest \
-c 'ls /operations/*'
[code - regression] Page 75
The docker exec example on the top of page 75 was printed with the wrong tool name. The correct command is:
docker exec important_application /operations/tools/diagnostics
[code - regression] Page 86
It appears that nslookup behavior in the alpine image has changed. To run the example use the busybox:1 image.
docker run --rm \
--hostname barker \
busybox:1 \
nslookup barker
[code - regression] Page 87 (top)
It appears that nslookup behavior in the alpine image has changed. To run the example use the busybox:1 image.
docker run --rm \
--dns 8.8.8.8 \
busybox:1 \
nslookup docker.com
[code - regression] Page 87 (bottom)
It appears that nslookup behavior in the alpine image has changed. To run the example use the busybox:1 image.
docker run --rm \
--dns-search docker.com \
busybox:1 \
nslookup registry.hub
[code - regression] Page 88 (bottom)
It appears that nslookup behavior in the alpine image has changed. To run the example use the busybox:1 image.
docker run --rm \
--add-host test:10.10.10.255 \
busybox:1 \
nslookup test
[code - regression] Page 106
There are a few new problems with this example. First, the named repository (dockerfile/mariadb) no longer exists. You can use mariadb:5.5 as replacement. However, the second problem is that containers created from the mariadb image perform certain initialization at startup. That initialization work requires certain capabilities and to be started with the default user. The system should instead drop permissions after the initialization work is complete. Note that the real value of this example is in demonstrating different resource isolation mechanisms. It is not so important that you get it working. You can start the database with the following command:
docker run -d --name ch6_mariadb \
--memory 256m \
--cpu-shares 1024 \
--cap-drop net_raw \
-e MYSQL_ROOT_PASSWORD=test \
mariadb:5.5
[code - regression] Page 107
Containers created from the wordpress:4.1 image perform certain initialization at startup and expect certain environment variables. That initialization work requires certain capabilities and to be started with the default user. The system should instead drop permissions after the initialization work is complete. Note that the real value of this example is in demonstrating different resource isolation mechanisms. It is not so important that you get it working. You can start wordpress with the following command:
docker run -d -P --name ch6_wordpress \
--memory 512m \
--cpu-shares 512 \
--cap-drop net_raw \
-e WORDPRESS_DB_PASSWORD=test \
mariadb:5.5
[code - typo] Page 109
The device access example is missing the "run" subcommand. The command listed as:
docker -it --rm \
--device /dev/video0:/dev/video0 \
ubuntu:latest ls -al /dev
should have been written as:
docker run -it --rm \
--device /dev/video0:/dev/video0 \
ubuntu:latest ls -al /dev
[code - typo] Page 110 - 111
Several commands are missing the "run" subcommand. In each case the command begins with
docker -d ...
and should have been written as:
docker run -d ...
[code - regression] Page 115 (bottom)
The busybox and alpine images have been updated to fix the problem described in the paragraph below. The 'su' command does not have the SUID bit set and will not provide any automatic privilege escalation.
[command correction] Page 116
Boot2Docker has been discontinued and rolled into a newer project called Docker Machine. Because a reader is unlikely to have the boot2docker command installed, the command at the top of this page should be changed from:
boot2docker ssh
to the Docker Machine equivalent:
docker-machine ssh default
where default is the name of the machine you created.
[code - regression] Page 119
The ifconfig command has since been removed from ubuntu:latest. Instead of using the ubuntu:latest image for these examples use ubuntu:trusty. The example using ifconfig should look like:
docker run --rm \
--privileged \
ubuntu:trusty ifconfig
[Illustration Mistake] Page 136
Image layer ced2 on the left side of the illustration is listed at c3d2 on the right side. These two layers should represent the same item.
[code - typo] Page 140
Containers need not be in a running state in order to export their file system. The first command on page 140 uses the "run" subcommand but the command listed will never be able to start. Replace "run" with "create." The command should appear as follows:
docker create --name export-test \
dockerinaction/ch7_packed:latest ./echo For Export
[code - missing line] Page 146
In the example Dockerfile near the top of the page the line with the RUN directive is missing part of the instruction. That line should read:
RUN apt-get update && apt-get install -y git
[code - evolution] Page 215
The registry:2 configuration file now requires the population of additional fields under "maintenance > uploadpurging." The example should currently look like:
# Filename: s3-config.yml
version: 0.1
log:
level: debug
fields:
service: registry
environment: development
storage:
cache:
layerinfo: inmemory
s3:
accesskey:
secretkey:
region:
bucket:
encrypt: true
secure: true
v4auth: true
chunksize: 5242880
rootdirectory: /s3/object/name/prefix
maintenance:
uploadpurging:
enabled: true
age: 168h
interval: 24h
dryrun: false
readonly:
enabled: false
http:
addr: :5000
secret: asecretforlocaldevelopment
debug:
addr: localhost:5001
[code - evolution] Page 216
The registry:2 configuration file now requires the population of additional fields under "maintenance > uploadpurging." The example should currently look like:
# Filename: rados-config.yml
version: 0.1
log:
level: debug
fields:
service: registry
environment: development
storage:
cache:
layerinfo: inmemory
rados:
poolname: radospool
username: radosuser
chunksize: 4194304
maintenance:
uploadpurging:
enabled: false
age: 168h
interval: 24h
dryrun: false
readonly:
enabled: false
http:
addr: :5000
secret: asecretforlocaldevelopment
debug:
addr: localhost:5001
[code - evolution] Page 218
The registry:2 configuration file now requires the population of additional fields under "maintenance > uploadpurging." The example should currently look like:
# Filename: redis-config.yml
version: 0.1
log:
level: debug
fields:
service: registry
environment: development
http:
addr: :5000
secret: asecretforlocaldevelopment
debug:
addr: localhost:5001
storage:
cache:
blobdescriptor: redis
s3:
accesskey:
secretkey:
region:
bucket:
encrypt: true
secure: true
v4auth: true
chunksize: 5242880
rootdirectory: /s3/object/name/prefix
maintenance:
uploadpurging:
enabled: true
age: 168h
interval: 24h
dryrun: false
readonly:
enabled: false
redis:
addr: redis-host:6379
password: asecret
dialtimeout: 10ms
readtimeout: 10ms
writetimeout: 10ms
pool:
maxidle: 16
maxactive: 64
idletimeout: 300s
[code - typo] Page 220
The name of the file shown should be scalable-config.yml as in previous examples. This example also requires the addition of the newer uploadpurging attributes. The mainenance section of the file should be as follows:
maintenance:
uploadpurging:
enabled: true
age: 168h
interval: 24h
dryrun: false
readonly:
enabled: false
[text - typo] Page 240
In the second paragraph the reader is instructed to, "Open ./coffee/api/api.py" this is not the correct location of the file. The correct file location is at, "./coffee/app/api.py."
[text - typo] Page 262
The refere nce to "flock.json" in the first sentence of the third paragraph should be "flock.yml."
[code - typo] Page 270
The git clone command uses the ssh protocol instead of https. The command should read as follows:
git clone https://github.com/dockerinact ... i.git 查看全部
看这本书的作者一定要看,不然坑挺多的。
一路采坑过来的哭着说。
Last updated August 21, 2016
In an effort to offer continued support beyond publication, we have listed many updates to code due to version updates.
[code - omission] Page 18
The command to start the "mailer" is missing a line. Where the book reads:
docker run -d \
--name mailer \
the proper command should read:
docker run -d \
--name mailer \
dockerinaction/ch2_mailer
[code - regression] Page 68
Newer versions of Docker have changed the structure of the JSON returned by the docker inspect subcommand. If the following command does not work then use the replacement. Original:
docker inspect --format "{{json .Volumes}}" reader
Replacement:
docker inspect --format "{{json .Mounts}}" reader
[code - regression] Page 69
Newer versions of Docker have changed the structure of the JSON returned by the docker inspect subcommand. If the following command does not work then use the replacement. Original:
docker inspect --format "{{json .Volumes}}" student
Replacement:
docker inspect --format "{{json .Mounts}}" student
[code - regression] Page 74
The alpine image entrypoint has changed since original publication and has been unset. The last command on the page should now read:
docker run --rm \
--volumes-from tools \
--entrypoint /bin/sh \
alpine:latest \
-c 'ls /operations/*'
[code - regression] Page 75
The docker exec example on the top of page 75 was printed with the wrong tool name. The correct command is:
docker exec important_application /operations/tools/diagnostics
[code - regression] Page 86
It appears that nslookup behavior in the alpine image has changed. To run the example use the busybox:1 image.
docker run --rm \
--hostname barker \
busybox:1 \
nslookup barker
[code - regression] Page 87 (top)
It appears that nslookup behavior in the alpine image has changed. To run the example use the busybox:1 image.
docker run --rm \
--dns 8.8.8.8 \
busybox:1 \
nslookup docker.com
[code - regression] Page 87 (bottom)
It appears that nslookup behavior in the alpine image has changed. To run the example use the busybox:1 image.
docker run --rm \
--dns-search docker.com \
busybox:1 \
nslookup registry.hub
[code - regression] Page 88 (bottom)
It appears that nslookup behavior in the alpine image has changed. To run the example use the busybox:1 image.
docker run --rm \
--add-host test:10.10.10.255 \
busybox:1 \
nslookup test
[code - regression] Page 106
There are a few new problems with this example. First, the named repository (dockerfile/mariadb) no longer exists. You can use mariadb:5.5 as replacement. However, the second problem is that containers created from the mariadb image perform certain initialization at startup. That initialization work requires certain capabilities and to be started with the default user. The system should instead drop permissions after the initialization work is complete. Note that the real value of this example is in demonstrating different resource isolation mechanisms. It is not so important that you get it working. You can start the database with the following command:
docker run -d --name ch6_mariadb \
--memory 256m \
--cpu-shares 1024 \
--cap-drop net_raw \
-e MYSQL_ROOT_PASSWORD=test \
mariadb:5.5
[code - regression] Page 107
Containers created from the wordpress:4.1 image perform certain initialization at startup and expect certain environment variables. That initialization work requires certain capabilities and to be started with the default user. The system should instead drop permissions after the initialization work is complete. Note that the real value of this example is in demonstrating different resource isolation mechanisms. It is not so important that you get it working. You can start wordpress with the following command:
docker run -d -P --name ch6_wordpress \
--memory 512m \
--cpu-shares 512 \
--cap-drop net_raw \
-e WORDPRESS_DB_PASSWORD=test \
mariadb:5.5
[code - typo] Page 109
The device access example is missing the "run" subcommand. The command listed as:
docker -it --rm \
--device /dev/video0:/dev/video0 \
ubuntu:latest ls -al /dev
should have been written as:
docker run -it --rm \
--device /dev/video0:/dev/video0 \
ubuntu:latest ls -al /dev
[code - typo] Page 110 - 111
Several commands are missing the "run" subcommand. In each case the command begins with
docker -d ...
and should have been written as:
docker run -d ...
[code - regression] Page 115 (bottom)
The busybox and alpine images have been updated to fix the problem described in the paragraph below. The 'su' command does not have the SUID bit set and will not provide any automatic privilege escalation.
[command correction] Page 116
Boot2Docker has been discontinued and rolled into a newer project called Docker Machine. Because a reader is unlikely to have the boot2docker command installed, the command at the top of this page should be changed from:
boot2docker ssh
to the Docker Machine equivalent:
docker-machine ssh default
where default is the name of the machine you created.
[code - regression] Page 119
The ifconfig command has since been removed from ubuntu:latest. Instead of using the ubuntu:latest image for these examples use ubuntu:trusty. The example using ifconfig should look like:
docker run --rm \
--privileged \
ubuntu:trusty ifconfig
[Illustration Mistake] Page 136
Image layer ced2 on the left side of the illustration is listed at c3d2 on the right side. These two layers should represent the same item.
[code - typo] Page 140
Containers need not be in a running state in order to export their file system. The first command on page 140 uses the "run" subcommand but the command listed will never be able to start. Replace "run" with "create." The command should appear as follows:
docker create --name export-test \
dockerinaction/ch7_packed:latest ./echo For Export
[code - missing line] Page 146
In the example Dockerfile near the top of the page the line with the RUN directive is missing part of the instruction. That line should read:
RUN apt-get update && apt-get install -y git
[code - evolution] Page 215
The registry:2 configuration file now requires the population of additional fields under "maintenance > uploadpurging." The example should currently look like:
# Filename: s3-config.yml
version: 0.1
log:
level: debug
fields:
service: registry
environment: development
storage:
cache:
layerinfo: inmemory
s3:
accesskey:
secretkey:
region:
bucket:
encrypt: true
secure: true
v4auth: true
chunksize: 5242880
rootdirectory: /s3/object/name/prefix
maintenance:
uploadpurging:
enabled: true
age: 168h
interval: 24h
dryrun: false
readonly:
enabled: false
http:
addr: :5000
secret: asecretforlocaldevelopment
debug:
addr: localhost:5001
[code - evolution] Page 216
The registry:2 configuration file now requires the population of additional fields under "maintenance > uploadpurging." The example should currently look like:
# Filename: rados-config.yml
version: 0.1
log:
level: debug
fields:
service: registry
environment: development
storage:
cache:
layerinfo: inmemory
rados:
poolname: radospool
username: radosuser
chunksize: 4194304
maintenance:
uploadpurging:
enabled: false
age: 168h
interval: 24h
dryrun: false
readonly:
enabled: false
http:
addr: :5000
secret: asecretforlocaldevelopment
debug:
addr: localhost:5001
[code - evolution] Page 218
The registry:2 configuration file now requires the population of additional fields under "maintenance > uploadpurging." The example should currently look like:
# Filename: redis-config.yml
version: 0.1
log:
level: debug
fields:
service: registry
environment: development
http:
addr: :5000
secret: asecretforlocaldevelopment
debug:
addr: localhost:5001
storage:
cache:
blobdescriptor: redis
s3:
accesskey:
secretkey:
region:
bucket:
encrypt: true
secure: true
v4auth: true
chunksize: 5242880
rootdirectory: /s3/object/name/prefix
maintenance:
uploadpurging:
enabled: true
age: 168h
interval: 24h
dryrun: false
readonly:
enabled: false
redis:
addr: redis-host:6379
password: asecret
dialtimeout: 10ms
readtimeout: 10ms
writetimeout: 10ms
pool:
maxidle: 16
maxactive: 64
idletimeout: 300s
[code - typo] Page 220
The name of the file shown should be scalable-config.yml as in previous examples. This example also requires the addition of the newer uploadpurging attributes. The mainenance section of the file should be as follows:
maintenance:
uploadpurging:
enabled: true
age: 168h
interval: 24h
dryrun: false
readonly:
enabled: false
[text - typo] Page 240
In the second paragraph the reader is instructed to, "Open ./coffee/api/api.py" this is not the correct location of the file. The correct file location is at, "./coffee/app/api.py."
[text - typo] Page 262
The refere nce to "flock.json" in the first sentence of the third paragraph should be "flock.yml."
[code - typo] Page 270
The git clone command uses the ssh protocol instead of https. The command should read as follows:
git clone https://github.com/dockerinact ... i.git
crontab定时运行图形程序
李魔佛 发表了文章 • 0 个评论 • 1087 次浏览 • 2019-08-26 15:56
export DISPLAY=:0;* * * * * export DISPLAY=:0; gedit
附一个linux下桌面提醒GUI程序,定时提醒你休息哈:
import pyautogui as pag
import datetime
def neck_rest():
f = open('neck_record.txt', 'a')
ret = pag.prompt("Rest! Protect your neck !")
if ret == 'rest':
f.write(datetime.datetime.now().strftime("%Y-%m-%d %H:%M:%S"))
f.write('\t')
f.write('Rest')
f.write('\n')
else:
f.write(datetime.datetime.now().strftime("%Y-%m-%d %H:%M:%S"))
f.write('\t')
f.write('Failed to rest')
f.write('\n')
f.close()
neck_rest()
程序保存为task.py
然后设定crontab任务:
* * * * * export DISPLAY=:0; python task.py
即可
查看全部
export DISPLAY=:0;
* * * * * export DISPLAY=:0; gedit
附一个linux下桌面提醒GUI程序,定时提醒你休息哈:
import pyautogui as pag
import datetime
def neck_rest():
f = open('neck_record.txt', 'a')
ret = pag.prompt("Rest! Protect your neck !")
if ret == 'rest':
f.write(datetime.datetime.now().strftime("%Y-%m-%d %H:%M:%S"))
f.write('\t')
f.write('Rest')
f.write('\n')
else:
f.write(datetime.datetime.now().strftime("%Y-%m-%d %H:%M:%S"))
f.write('\t')
f.write('Failed to rest')
f.write('\n')
f.close()
neck_rest()
程序保存为task.py
然后设定crontab任务:
* * * * * export DISPLAY=:0; python task.py
即可