Skip to content

Instantly share code, notes, and snippets.

View h0hmj's full-sized avatar

h0hmj h0hmj

View GitHub Profile
@h0hmj
h0hmj / bench.go
Last active April 12, 2024 06:33
rados bench 4MB io
package main
import (
"fmt"
"os"
"sort"
"time"
"github.com/Workiva/go-datastructures/queue"
"github.com/alecthomas/kong"
@h0hmj
h0hmj / demo.txt
Last active March 26, 2024 06:37
root@k8s:~# cat pod.yaml
apiVersion: v1
kind: Pod
metadata:
name: admin
spec:
containers:
- name: shell
image: ubuntu:22.04
command: ["sleep", "infinity"]
deleteRules:
- orgId: 1
uid: ceph-ceph_mon_down_quorum_at_risk
- orgId: 1
uid: ceph-ceph_mon_down
- orgId: 1
uid: ceph-ceph_mon_diskspace_critical
- orgId: 1
uid: ceph-ceph_mon_diskspace_low
- orgId: 1
@h0hmj
h0hmj / ceph_alerts.yml
Last active March 18, 2024 05:29 — forked from timfeirg/ceph_alerts.yml
ceph monitoring
apiVersion: 1
groups:
- folder: ceph-alerts
interval: 10s
name: cluster health
orgId: 1
rules:
- annotations:
description: The cluster state has been HEALTH_ERROR for more than 5 minutes.
Please check 'ceph health detail' for more information.
@h0hmj
h0hmj / tool.py
Last active December 18, 2023 08:42
#!/usr/bin/python3
import sqlite3 # if you use rqlite, you need to change db connection things
import yaml
import os
import logging
DBPATH = "/root/.curveadm/data/curveadm.db"
CLUSTER_NAME = "test"
IMAGE = "curveadm-harbor.org:8888/curve/curvebs:v1.2.7-rc3_47a5267"
DATA_DIR_PREFIX = "/test/data"
@h0hmj
h0hmj / fix.py
Last active November 28, 2023 07:01
fix curveadm cluster after migration
import os
import yaml
import sqlite3
class CurveadmHostsHandler:
def __init__(self):
self.data = None
def load(self, path=None):
#!/usr/bin/python3
import requests
def _make_http_request_retard(url, payload: dict, method='GET'):
payload_str = "&".join("%s=%s" % (k, v) for k, v in payload.items())
response = requests.request(method, url, params=payload_str)
return response.content
snapclone_api_url = "http://127.0.0.1:5555/SnapshotCloneService"
(venv) root@uuu:~# dpkg -l|grep amdgpu
ii amdgpu-core 1:5.4.50403-1538762.22.04 all Core meta package for unified amdgpu driver.
ii amdgpu-dkms 1:5.18.13.50403-1538762.22.04 all amdgpu driver in DKMS format.
ii amdgpu-dkms-firmware 1:5.18.13.50403-1538762.22.04 all firmware blobs used by amdgpu driver in DKMS format
ii amdgpu-install 5.4.50403-1538762.22.04 all AMDGPU driver repository and installer
ii amdgpu-lib 1:5.4.50403-1538762.22.04 amd64 Meta package to install amdgpu userspace components.
ii amdgpu-lib32 1:5.4.50403-1538762.22.04 amd64 Meta package to support i386 runtime on amd64 architecture
ii gst-omx-amdgpu 1:1.0.0.1.50403-1538762.22.04 amd64 GStreamer OpenMAX plugins
ii libdrm-amdgp
Collecting environment information...
PyTorch version: 2.0.0+rocm5.4.2
Is debug build: False
CUDA used to build PyTorch: N/A
ROCM used to build PyTorch: 5.4.22803-474e8620
OS: Ubuntu 22.04.2 LTS (x86_64)
GCC version: (Ubuntu 11.3.0-1ubuntu1~22.04) 11.3.0
Clang version: Could not collect
CMake version: version 3.25.0
@h0hmj
h0hmj / 1.yaml
Last active March 1, 2023 08:41
apiVersion: v1
kind: Pod
metadata:
name: curvefs-csi-test
spec:
containers:
- name: web-server
image: nginx
volumeMounts:
- name: mypvc