国内从 Docker Hub 拉取镜像有时会遇到困难,此时可以配置镜像加速器。
Dockerized 实践 https://github.com/y0ngb1n/dockerized
# This file contains only partial paths to match on | |
# This file should reside in the same directory as the haproxy.cfg simply due to the way it is configured in the sample snippet-but they can go anywhere in the /etc/haproxy directory | |
/my-partial- https://subdomain3.mydomain.com/my-new-full-path |
国内从 Docker Hub 拉取镜像有时会遇到困难,此时可以配置镜像加速器。
Dockerized 实践 https://github.com/y0ngb1n/dockerized
Some Jenkinsfile examples |
const puppeteer = require('puppeteer'); | |
(async () => { | |
const browser = await puppeteer.launch(); | |
const page = await browser.newPage(); | |
// Adjustments particular to this page to ensure we hit desktop breakpoint. | |
page.setViewport({width: 1000, height: 600, deviceScaleFactor: 1}); | |
await page.goto('https://www.chromestatus.com/samples', {waitUntil: 'networkidle'}); |
sudo rm -rfv /Library/Caches/com.apple.iconservices.store; sudo find /private/var/folders/ \( -name com.apple.dock.iconcache -or -name com.apple.iconservices \) -exec rm -rfv {} \; ; sleep 3;sudo touch /Applications/* ; killall Dock; killall Finder |
su | |
mkdir /mnt/root | |
# You may use fdisk -l to list the devices | |
mount /dev/mapper/fedora-root /mnt/root | |
# Mount the boot partition, maybe /dev/sda1 | |
# As the system has both Ubuntu and Fedora installed, | |
# so sda3 in my case | |
mount /dev/sda<3> /mnt/root/boot |
When a Spring Boot app starts up with default (INFO) logging, there are some noticeable gaps (pauses). It's worth focusing on the gaps when looking for efficiency savings because of the amount of time they take, and because no-one bothered to log anything, so the chances are the app is doing something repetitive. We can tweak the logging levels to try and fill in the gaps and find out what is going on in there.
Basic empty web app with actuators has three such gaps:
0 1410ms
|------|---------------------------|-----|------|---------|--------|--------|
| 578 | |144(5)| | 133(6) |
#!/bin/bash | |
# remove exited containers: | |
docker ps --filter status=dead --filter status=exited -aq | xargs -r docker rm -v | |
# remove unused images: | |
docker images --no-trunc | grep '<none>' | awk '{ print $3 }' | xargs -r docker rmi | |
# remove unused volumes: | |
find '/var/lib/docker/volumes/' -mindepth 1 -maxdepth 1 -type d | grep -vFf <( |
#!/bin/bash | |
veth_in_use=() | |
veth_unused=() | |
veth_all=() | |
function veth_interface_for_container() { | |
local pid=$(docker inspect -f '{{.State.Pid}}' "${1}") | |
mkdir -p /var/run/netns | |
ln -sf /proc/$pid/ns/net "/var/run/netns/${1}" |