Skip to content

Instantly share code, notes, and snippets.

@ClearSeve
ClearSeve / 00readme.txt
Created August 5, 2025 08:07 — forked from yankay/00readme.txt
快速 启动一套 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
@ClearSeve
ClearSeve / README.md
Created February 28, 2024 08:58 — forked from NiceGuyIT/README.md
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

@ClearSeve
ClearSeve / macaddress.cpp
Created January 11, 2024 08:06 — forked from hash3liZer/macaddress.cpp
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();
@ClearSeve
ClearSeve / README.md
Created November 21, 2023 06:04 — forked from tomazzaman/README.md
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.

@ClearSeve
ClearSeve / pdfdecrypt.cpp
Created January 10, 2023 13:29 — forked from witwall/pdfdecrypt.cpp
Decrypt PDF(remove pdf password and limitations) with pdfium
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "../fpdfsdk/include/fpdfview.h"
#include "../fpdfsdk/include/fpdfsave.h"
/*
author:Steven Lee