My Elasticsearch cheatsheet with example usage via rest api (still a work-in-progress)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Linux中常用的監控CPU整體性能的工具有: | |
§ mpstat: mpstat 不但能查看所有CPU的平均信息,還能查看指定CPU的信息。 | |
§ vmstat:只能查看所有CPU的平均信息;查看cpu隊列信息; | |
§ iostat: 只能查看所有CPU的平均信息。 | |
§ sar: 與mpstat 一樣,不但能查看CPU的平均信息,還能查看指定CPU的信息。 |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## ref: https://stackoverflow.com/questions/62764148/how-to-import-requirements-txt-from-an-existing-project-using-poetry | |
$reqs = @(cat requirements.txt) | |
for($i = 0; $i -lt $reqs.length; $i++){poetry add $reqs[$i]} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# define base image as python slim-buster. | |
FROM python:3.7-slim-buster as base | |
## start builder stage. | |
# this is the first stage of the build. | |
# it will install all requirements. | |
FROM base as builder | |
# install all packages for chromedriver: https://gist.github.com/varyonic/dea40abcf3dd891d204ef235c6e8dd79 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This can be added to your cron job to run right after Drupal's cron or combine them into a single command so | |
# that it automatically executes when the cron run completes. | |
wget -q http://www.example.com/sitemap.xml -O - | egrep -o "http://www\.example\.com[^<]+" | wget -q -i - -O /dev/null --wait 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
set -eu | |
# Solves the problem with open ports with docker and ufw | |
# As Docker uses the nat table, the filter table FORWARD chain is used and does not touch ufw-input chains as expected. | |
# Even for ufw-forward chains it would not work, as DOCKER chains are inserted in front. | |
# This is a simple fix that worked for me. | |
# https://github.com/moby/moby/issues/4737#issuecomment-420264979 | |
# Unfortunately this fix stops forwarding users origin ip to host mode configured service |
- Disable iptables
$ sudo vim /etc/docker/daemon.json
{
"iptables": false
}
- Disable iptables
$ sudo vim /etc/docker/daemon.json
{
"iptables": false
}
I hate when my images turn out like this:
You can barely see the Crab Nebula drifting through the frame because I didn't align my mount well. To keep my telescope fixed on an object during long exposures, I needed an autoguider. But I also hate having a laptop in the field, which is required for most autoguiding solutions. To avoid this burdensome piece of equipment, I turned a Raspberry Pi with a touchscreen case into an on-board autoguiding system for my astrophotography rig.
NewerOlder