This file contains hidden or 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 -e | |
| PROMPT="I hope you will read the entire project code and look for areas that can be refactored. Refactoring directions include code structure, readability, extensibility, maintainability, and performance. | |
| If the file list does not exist in .context/File.md, first list all the files, recording the filenames in todo format in .context/File.md. | |
| Then, perform the following operations for each file one by one: | |
| 1. Sequentially select a file from .context/File.md that has not been completed as a todo, read it, look for refactoring points, and record them in todo format in .context/REFACTOR.md. | |
| 2. If the file is too long, slice it for reading. | |
| 3. If there are no refactoring suggestions for the file, there is no need to record refactoring points. | |
| 4. Mark the currently read file as completed in the file list in .context/File.md. |
This file contains hidden or 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
| 我现在需要回应客户安全团队对 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. |
This file contains hidden or 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
| # ~/.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" |
This file contains hidden or 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 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 |
This file contains hidden or 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
| #!/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 |
This file contains hidden or 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 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: |
This file contains hidden or 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
| #!/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 |
This file contains hidden or 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
| 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] |
This file contains hidden or 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 -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" |
This file contains hidden or 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
| package main | |
| import ( | |
| "net/http" | |
| "github.com/prometheus/client_golang/prometheus/promhttp" | |
| ) | |
| func main() { | |
| http.Handle("/metrics", promhttp.Handler()) |
NewerOlder