国内从 Docker Hub 拉取镜像有时会遇到困难,此时可以配置镜像加速器。
Dockerized 实践 https://github.com/y0ngb1n/dockerized
# Stick this in lib/tasks/assets.rake or similar | |
# | |
# A bug was introduced in rails in 7f1a666d causing the whole application cache | |
# to be cleared everytime a precompile is run, but it is not neccesary and just | |
# slows down precompiling. | |
# | |
# Secondary consequences are the clearing of the whole cache, which if using | |
# the default file cache could cause an application level performance hit. | |
# | |
# This is already fixed in sprockets-rails for rails 4, but we patch here for |
# This task will stop and disable a service without failing if the service does not exist. | |
# Requires Ansible 1.4 or newer. | |
# Update Dec 2016: Have rewritten this for the latest version of ansible and put conditions for both Ubuntu and CentOS | |
- name: "disable unused services" | |
service: name={{item}} state=stopped enabled=no | |
register: command_result | |
failed_when: "unused_disable|failed and ('find' not in unused_disable.msg and 'found' not in unused_disable.msg)" | |
with_items: |
{ | |
// http://eslint.org/docs/rules/ | |
"ecmaFeatures": { | |
"binaryLiterals": false, // enable binary literals | |
"blockBindings": false, // enable let and const (aka block bindings) | |
"defaultParams": false, // enable default function parameters | |
"forOf": false, // enable for-of loops | |
"generators": false, // enable generators | |
"objectLiteralComputedProperties": false, // enable computed object literal property names |
# Ever want to change the storage class of every item in an AWS bucket? | |
# Requirements: | |
# Gems: | |
# fog-aws - http://fog.io | |
# Usage: | |
# All items in the bucket: | |
# set_storage_class_for_s3_files("REDUCED_REDUNDANCY") | |
# Only items in the 'foobar' folder |
docker logs nginx 2>&1 | grep "127." | |
# ref: http://stackoverflow.com/questions/34724980/finding-a-string-in-docker-logs-of-container |
国内从 Docker Hub 拉取镜像有时会遇到困难,此时可以配置镜像加速器。
Dockerized 实践 https://github.com/y0ngb1n/dockerized
Disclaimer: