Skip to content

Instantly share code, notes, and snippets.

View oilbeater's full-sized avatar
🎯
Focusing

Mengxin Liu oilbeater

🎯
Focusing
View GitHub Profile
我现在需要回应客户安全团队对 Kube-OVN 未修复的 CVE 的询问,需要给出对应的 CVE 是否会对安全产生影响。
你可以去 https://access.redhat.com/security/cve/cve-xxxx-xxxx 或者 https://ubuntu.com/security/CVE-XXXX-XXXX 获取这些 CVE 尚未被上游修复的理由。并结合 Kube-OVN 的软件特性给出最终的评估和 Root Cause Analysis。
输出格式为 csv:
CVE-ID, Risk Assessment: Affected or Unaffected, Root Cause Analysis
一个例子为:
CVE-2024-56433,Unaffected,Since the container does not expose login functionality or permit shell-based access, the practical risk is negligible.
@oilbeater
oilbeater / providers.yaml
Created September 28, 2025 03:08
RayCast AI with DeepSeek
# ~/.config/raycast/ai.providers.yaml
providers:
- id: deepseek
name: DeepSeek
base_url: https://api.deepseek.com
# Specify at least one api key if authentication is required.
# Optional if authentication is not required or is provided elsewhere.
# If individual models require separate api keys, then specify a separate `key` for each model's `provider`
api_keys:
deepseek: "YOUR OWN KEY HERE"
@oilbeater
oilbeater / fetch_ubuntu_cve_notes.py
Last active September 19, 2025 07:04
This script will automatically fetch a CVE note from canonical team to know why the CVE is still unfixed
#!/usr/bin/env python3
"""fetch_ubuntu_cve_notes.py
---------------------------------------------
Given one or more CVE identifiers, download the corresponding
Ubuntu security advisory page (https://ubuntu.com/security/<CVE>)
and print the text that appears under the **Notes** heading.
Dependencies
------------
```bash
@oilbeater
oilbeater / manifest.sh
Created June 28, 2024 02:08
release kube-ovn images
#!/bin/bash
set -x
docker manifest rm kubeovn/kube-ovn:${VERSION}
docker manifest rm kubeovn/vpc-nat-gateway:${VERSION}
docker pull kubeovn/kube-ovn:${VERSION}-x86
docker pull kubeovn/kube-ovn:${VERSION}-arm
docker pull kubeovn/vpc-nat-gateway:${VERSION}-x86
docker pull kubeovn/vpc-nat-gateway:${VERSION}-arm
@oilbeater
oilbeater / gist:6e8c7359cc4283168e567ecfa6743a08
Created April 30, 2024 07:59
describe how linux memory management work with watermark
Linux memory management is a complex system designed to efficiently allocate and manage system memory resources across various processes. The concept of watermarks is crucial in this system, playing a significant role in balancing memory allocation and ensuring system stability. Here's a simplified explanation of how memory management works in Linux, particularly focusing on the role of watermarks:
### 1. **Memory Zones**
Linux divides physical memory into several zones, such as DMA (Direct Memory Access), DMA32, and Normal zones. These divisions are based on memory addressing limitations of hardware devices and other architectural requirements.
### 2. **Pages**
The fundamental unit of memory management in Linux is the page. Memory allocation requests from processes are handled in terms of pages.
### 3. **Watermarks**
Each memory zone in Linux has defined watermarks, which are thresholds used to manage memory pressure and availability. There are typically three watermark levels in each zone:
@oilbeater
oilbeater / close.sh
Last active March 8, 2024 10:58
shut down when ssh idle for more than 5 minutes
#!/bin/bash
# docker run --name=close --network=host --privileged --restart=always -d close:v0.0.1
while true; do
if [ -f dump ]; then
rm dump
fi
timeout 5m tcpdump -nn tcp and port 22 and greater 44 -w dump
yum install -y yum-utils
yum-config-manager \
--add-repo \
https://download.docker.com/linux/centos/docker-ce.repo
yum install -y docker-ce docker-ce-cli containerd.io
systemctl enable docker
systemctl start docker
cat <<EOF | sudo tee /etc/yum.repos.d/kubernetes.repo
[kubernetes]
#!/usr/bin/env bash
set -euo pipefail
REGISTRY="index.alauda.cn/alaudak8s"
POD_CIDR="10.16.0.0/16" # Do NOT overlap with NODE/SVC/JOIN CIDR
SVC_CIDR="10.96.0.0/12" # Do NOT overlap with NODE/POD/JOIN CIDR
JOIN_CIDR="100.64.0.0/16" # Do NOT overlap with NODE/POD/SVC CIDR
VERSION="v1.0.0"
echo "[Step -1] Delete flannel and galaxy resource on host"
@oilbeater
oilbeater / prome-http-handler
Created February 11, 2020 02:41
Prometheus HTTP Handler
package main
import (
"net/http"
"github.com/prometheus/client_golang/prometheus/promhttp"
)
func main() {
http.Handle("/metrics", promhttp.Handler())
@oilbeater
oilbeater / resolv-conf-reset.md
Last active November 18, 2019 02:14
generated by networkmanager resolv.conf

edit /etc/sysconfig/network-scripts/ifcfg-eth0

it will looks like

TYPE=Ethernet
PROXY_METHOD=none
BROWSER_ONLY=no
BOOTPROTO=none
DEFROUTE=yes