Skip to content

Instantly share code, notes, and snippets.

@quanhua92
quanhua92 / k3s_or_nomad.md
Last active February 25, 2026 04:15
HA Nomad Cluster

Nomad generally uses less CPU and RAM than K3s for the same basic cluster functionality. Nomad is widely regarded as one of the most efficient and lightweight orchestrators available.

For your 5-VPS setup, Nomad's single-binary, minimal approach will result in lower resource utilization and operational overhead compared to K3s, which, despite being "lightweight," still runs the full set of Kubernetes control plane components.

⚖️ Nomad vs. K3s Resource Footprint

The difference in resource consumption stems from the architectural complexity of the two systems.

Resource Nomad Agent (Server/Client) K3s Agent / Server
@yankay
yankay / 00readme.txt
Last active August 5, 2025 08:07
快速 启动一套 kubespray 集群(Ubuntu)
# 安装 kubespray
cd /opt
git clone https://github.com/kubernetes-sigs/kubespray.git
cd kubespray
pip3 install -r requirements.txt -i http://mirrors.aliyun.com/pypi/simple/ --trusted-host mirrors.aliyun.com
# 配置集群
# Copy ``inventory/sample`` as ``inventory/mycluster``
cp -rfp inventory/sample inventory/mycluster
@hash3liZer
hash3liZer / macaddress.cpp
Created January 31, 2020 10:23
Getting MAC address of Ethernet Interface of a PC in C++
#include <stdio.h>
#include <Windows.h>
#include <Iphlpapi.h>
#include <Assert.h>
#include <string>
#pragma comment(lib, "iphlpapi.lib")
char* getMAC();
@y0ngb1n
y0ngb1n / docker-registry-mirrors.md
Last active March 19, 2026 09:56
国内的 Docker Hub 镜像加速器,由国内教育机构与各大云服务商提供的镜像加速服务 | Dockerized 实践 https://github.com/y0ngb1n/dockerized
@ogavrisevs
ogavrisevs / Dockerfile
Last active November 13, 2023 01:17
Spring boot sample app with attached prometheus_jmx
FROM openjdk:8-jre-alpine
RUN apk update && apk upgrade && apk --update add curl && rm -rf /tmp/* /var/cache/apk/*
ENV VERSION 0.11.0
ENV JAR jmx_prometheus_javaagent-$VERSION.jar
RUN mkdir -p /opt/jmx_exporter
RUN curl -L https://repo1.maven.org/maven2/io/prometheus/jmx/jmx_prometheus_javaagent/$VERSION/$JAR -o /opt/jmx_exporter/$JAR
RUN chmod +x /opt/jmx_exporter/$JAR
@NiceGuyIT
NiceGuyIT / README.md
Last active October 28, 2024 08:16
nginx JSON to Filebeat to Logstash to Elasticsearch

Intro

This is an example configuration to have nginx output JSON logs to make it easier for Logstash processing. I was trying to get nginx > Filebeat > Logstash > ES working and it wasn't until I connected Filebeat directly to Elasticsearch that I saw the expected data. Google led me to ingest-convert.sh and I realized filebeat setup works for Filebeat > ES but not Filebeat > Logstash > ES. This is because Logstash does not use ingest pipelines by default. You have to enable them in the elasticsearch output block.

Having nginx log JSON in the format required for Elasticsearch means there's very little processing (i.e. grok) to be done in Logstash. nginx can only output JSON for access logs; the error_log format cannot be changed.

Extra fields are output and not used by the Kibana dashboards. I included them in case they might be useful. Since they are not declared in the filebeat setup, their default is "string" when yo

@cereal-s
cereal-s / ping.gs.php
Created September 8, 2017 13:44
Get number of pages from a PDF, using GhostScript.
<?php
/**
* Return the number of pages of a PDF.
*
* Imagick::pingImage() takes too much when dealing with big files.
*
* Command to execute:
*
* gs -q -dNODISPLAY -c "(%s) (r) file runpdfbegin pdfpagecount = quit"

jdk提供的各种工具存放在JAVA_HOME/bin/,使用时为了方便请将JAVA_HOME/bin/加入到Path

图形界面集成工具

  • 1、VisualVM:提供在Java 虚拟机(Java Virutal Machine, JVM) 上运行的Java 应用程序的详细信息
  • 2、jConsole:Java 自带性能监控工具
  • 3、TProfiler:阿里巴巴TProfiler是一个可以在生产环境长期使用的性能分析工具
  • 4、ha456.jar:IBM HeapAnalyzer
  • 5、BTrace:一个可以在不改代码、不重启应用的情况下,动态的查看程序运行细节的工具
  • 6、MAT:MAT(Memory Analyzer Tool)(Eclipse Memory Analyzer),一个基于Eclipse的内存分析工具,是一个快速、功能丰富的Java heap分析工具,它可以帮助我们查找内存泄漏和减少内存消耗
@stevekm
stevekm / pdf_conversions.md
Last active May 3, 2024 19:33
Commands to convert multi-page PDF to/from multiple PNG files with GhostScript & ImageMagick
@tomazzaman
tomazzaman / README.md
Last active April 19, 2024 17:01
Kill supervisor on Docker when any of the services fail

Killing supervisor if any of it's child processes fail

The trick is to only register the listener for events that indicate failure, namely

  • PROCESS_STATE_STOPPED
  • PROCESS_STATE_EXITED
  • PROCESS_STATE_FATAL

Once they do, we should send a SIGQUIT to Supervisor.