Consider the following scenario: you are going to rolling update your cluster, and it turns out your network bandwidth is limited for some reason and size of built docker image is not small enough. What’s worse, every instance of cluster will need to pull the docker image before start-up… Read More
Author: clsung
It happens the docker daemon wasn’t alive when I login to the console.
1 2 3 4 5 6 7 8 9 10 11 |
Container Linux by CoreOS beta (1353.4.0) Failed Units: 2 docker.service docker.socket $ sudo systemctl start docker.service Failed to start docker.service: Unit early-docker.target not found. $ grep -ri 'early-docker.target' system/docker.service:After=docker.socket early-docker.target network.target system/docker.service:Requires=docker.socket early-docker.target |
After review the release document, it seems early-docker.target should be remove in all related target.
When reading salt’s source code, it seems we have a ‘source_hash_update’ option on “archive.extracted”, however when I added so, salt complains:
1 2 3 4 5 |
Warnings: 'source_hash_update', 'group' and 'user' are invalid keyword arguments for 'archive.extracted'. If you were trying to pass additional data to be used in a template context, please populate 'context' with 'key: value' pairs. Your approach will work until Salt Carbon is out. Please update your state files. |
多想幾天,可以不用重新發明輪子。 :p
Read More
Perform a yum search docker, we can see two docker available:
docker.x86_64 : Automates deployment of containerized applications
docker-io.x86_64 : Automates deployment of containerized applications
Well, at least for today, the docker.x86_64, which is mentioned in , is still 0.11. So please install the docker-io.x86_64, which is 1.0.0-1.el7.
Updated 20140829: there’s more up-to-date repo for docker.
Updated 20150111: it seems the repo is out of managed now. And official repo is upgraded to 1.3.2. Thus the official repo is recommended now.
% # just use original one
% # curl -O https://copr.fedoraproject.org/coprs/goldmann/docker-io/repo/epel-7/goldmann-docker-io-epel-7.repo
% # sudo mv goldmann-docker-io-epel-7.repo
% # yum update
% # yum install docker-io
% sudo service docker start
Redirecting to /bin/systemctl start docker.service
To install EPEL-7
1 |
% rpm -ivh http://dl.fedoraproject.org/pub/epel/beta/7/x86_64/epel-release-7-0.2.noarch.rpm |
Also, enable it by default, edit /etc/yum.repos.d/remi.repo and set ‘enable=1’ under section of [remi] and [remi-
Install pre-requirements:
1 |
% yum install gmp-devel mpfr-devel libmpc-devel |
Download and extract gcc 4.8.2 source tar ball:
1 |
% curl -O ftp://ftp.gnu.org/gnu/gcc/gcc-4.8.2/gcc-4.8.2.tar.gz; tar zxf gcc-4.8.2.tar.gz |
1 |
% cd gcc-4.8.2; ./configure --enable-languages=c,c++ --disable-multilib |
Build and install:
% make; make install<
In python, for cropping image I use PIL. However the dependencies of PIL is huge, also need to install some lib*-dev packages.
So I choose go to crop images:
Usage:
% go run crop.go large.jpeg thumbna
#!/usr/bin/env python
import string
import random
out_file = 'text_file.txt'
file_size = 1024 * 1024
rands = lambda x: ''.join(random.choice(string.letters + string.digits) for x in xrange(x))
with open(out_file, 'w') as f:
f.write(rands(file_size))