国内从 Docker Hub 拉取镜像有时会遇到困难,此时可以配置镜像加速器。
Dockerized 实践 https://github.com/y0ngb1n/dockerized
| You are Lyra, a master-level AI prompt optimization specialist. Your mission: transform any user input into | |
| precision-crafted prompts that unlock AI's full potential across all platforms. | |
| ## THE 4-D METHODOLOGY | |
| ### 1. DECONSTRUCT | |
| - Extract core intent, key entities, and context | |
| - Identify output requirements and constraints | |
| - Map what's provided vs. what's missing |
| FROM node:12-alpine | |
| RUN apk --no-cache add git | |
| RUN git clone https://github.com/jsbin/jsbin.git /jsbin | |
| WORKDIR /jsbin | |
| RUN npm install -g grunt-cli | |
| RUN npm install | |
| RUN grunt build |
| MetricCategory | MetricName | MetricDimensions | MetricType | MetricTable | MetricNamespace | MetricOrigin | Comments | |
|---|---|---|---|---|---|---|---|---|
| Node-CPU | cpuAllocatableNanoCores | Objectname='K8SNode', Instancename=<nodename> | Gauge | Perf | Amount of cpu that is allocatable by Kubernetes to run pods, expressed in nanocores/nanocpu unit | |||
| Node-CPU | cpuCapacityNanocores | Objectname='K8SNode', Instancename=<nodename> | Gauge | Perf | Total CPU capacity of the node in nanocore/nanocpu unit | |||
| Node-CPU | cpuUsageNanocores | Objectname='K8SNode', Instancename=<nodename> | Gauge | Perf | CPU used by node in nanocore/nanocpu unit | |||
| Node-Memory | memoryAllocatableBytes | Objectname='K8SNode', Instancename=<nodename> | Gauge | Perf | Amount of memory in bytes that is allocatable by kubernetes to run pods | |||
| Node-Memory | memoryCapacityBytes | Objectname='K8SNode', Instancename=<nodename> | Gauge | Perf | Total memory capacity of the node in bytes | |||
| Node-Memory | memoryRssBytes | Objectname='K8SNode', Instancename=<nodename> | Gauge | Perf | Rss memory used by the node in bytes. Collected only for L |
| # Put this file in /etc/nginx/sites-available | |
| # Then "ln -s /etc/nginx/sites-available/aria2-nginx.conf /etc/nginx/sites-enabled" | |
| # Then "sudo service nginx restart" | |
| server { | |
| listen 80; | |
| listen [::]:80; | |
| root /var/www/aria2; # Put your aria2 web ui here, such as AriaNg | |
| index index.html; | |
| server_name DOMAIN_NAME; | |
| location / { |
国内从 Docker Hub 拉取镜像有时会遇到困难,此时可以配置镜像加速器。
Dockerized 实践 https://github.com/y0ngb1n/dockerized
Sometimes we might want to print some text in Bash and we might want it to be centered to the centre of the terminal. It is a cheap way how we can increase clarity of output of our script and make it look much more attractive.
The whole magic is hidden in a program called tput.
To get number of rows and cols of current terminal, we need just two simple shell substitutions:
TERM_ROWS="$(tput rows)"| #!/bin/bash | |
| case $# in | |
| 0) | |
| echo "Usage: $0 {start|stop}" | |
| exit 1 | |
| ;; | |
| 1) | |
| case $1 in | |
| start) |
| - Open Automator | |
| - File -> New -> Service | |
| - Change "Service Receives" to "files or folders" in "Finder" | |
| - Add a "Run Shell Script" action | |
| - Change "Pass input" to "as arguments" | |
| - Paste the following in the shell script box: open -n -b "com.microsoft.VSCode" --args "$*" | |
| - Save it as something like "Open in Visual Studio Code" |
| https://code.google.com/p/android/issues/detail?id=32696#c5 | |
| If you have a certificate that is not | |
| trusted by Android, when you add it, it goes in the personal cert store. | |
| When you add a cert in this personal cert store, the system requires a | |
| higher security level to unlock the device. But if you manage to add your | |
| cert to the system store then you don't have this requirement. Obviously, | |
| root is required to add a certificate to the system store, but it is quiet | |
| easy. |