Skip to content

Instantly share code, notes, and snippets.

View justin2061's full-sized avatar

Justin.Lee justin2061

  • self
  • 台灣
  • 17:36 (UTC +08:00)
View GitHub Profile
Linux中常用的監控CPU整體性能的工具有:
§ mpstat: mpstat 不但能查看所有CPU的平均信息,還能查看指定CPU的信息。
§ vmstat:只能查看所有CPU的平均信息;查看cpu隊列信息;
§ iostat: 只能查看所有CPU的平均信息。
§ sar: 與mpstat 一樣,不但能查看CPU的平均信息,還能查看指定CPU的信息。
@justin2061
justin2061 / cheatsheet-elasticsearch.md
Created January 12, 2024 02:55 — forked from ruanbekker/cheatsheet-elasticsearch.md
Elasticsearch Cheatsheet : Example API usage of using Elasticsearch with curl
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
## 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]}
@justin2061
justin2061 / Dockerfile
Last active July 13, 2022 04:23 — forked from matt-bertoncello/Dockerfile
Dockerfile and python script to run selenium with headless chromedriver in debian docker container.
# 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
@justin2061
justin2061 / cache-warmer-3.sh
Created January 19, 2022 14:01 — forked from chales/cache-warmer-3.sh
A couple of simple options to parse sitemap.xml to warm the cache or for other actions such as generating memory_profiler checks.
# 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
@justin2061
justin2061 / docker_ufw_setup.sh
Created November 2, 2020 08:23 — forked from rubot/docker_ufw_setup.sh
easy fix for DOCKER-USER and ufw
#!/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
@justin2061
justin2061 / Docker_UFW_IPTABLES.md
Created November 2, 2020 08:20 — forked from menxit/Docker_UFW_IPTABLES.md
Docker UFW and iptables
  1. Disable iptables
$ sudo vim /etc/docker/daemon.json
{
  "iptables": false
}
@justin2061
justin2061 / Docker_UFW_IPTABLES.md
Created November 2, 2020 08:20 — forked from rubot/Docker_UFW_IPTABLES.md
Docker UFW and iptables
  1. Disable iptables
$ sudo vim /etc/docker/daemon.json
{
  "iptables": false
}
@justin2061
justin2061 / atik-indi-phd2-raspbian-instructions.md
Created October 25, 2020 16:39 — forked from jkutner/atik-indi-phd2-raspbian-instructions.md
Turn a Raspberry Pi into an Astrophotography Autoguider

Turn a Raspberry Pi into an Astrophotography Autoguider

@codefinger

I hate when my images turn out like this:

Drift

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.