Skip to content

Instantly share code, notes, and snippets.

View Thearas's full-sized avatar
:shipit:
Focusing

Thearas Thearas

:shipit:
Focusing
View GitHub Profile
@Thearas
Thearas / VSCode-Python Liniting
Created January 15, 2024 08:39 — forked from pavank/VSCode-Python Liniting
PyLint Settings for VSCode
# pylint.rc file in workspace folder
========================================
[MASTER]
# A comma-separated list of package or module names from where C extensions may
# be loaded. Extensions are loading into the active Python interpreter and may
# run arbitrary code.
extension-pkg-whitelist=
# Add files or directories to the blacklist. They should be base names, not
@Thearas
Thearas / migrate-redhat-to-centos8-stream.yml
Last active July 18, 2022 09:34
Migrate redhat to centos8-stream
---
- hosts: jinshannew
vars:
remote_user: root
tasks:
- name: Remove the existing repos
file:
state: absent
path: /etc/yum.repos.d/centos-base.repo
- name: Creating /etc/yum.repos.d/elrepo.repo
@Thearas
Thearas / detect_high_cpu.md
Created December 13, 2021 08:03
macOS app high CPU
xctrace record --template 'Time Profiler' --time-limit 10s --attach <app_name>
open <the_out_profile.trace>
@Thearas
Thearas / elasticsearch_and_kibana.yaml
Last active May 16, 2022 09:36
Setup Elasticsearch and Kibana for development
apiVersion: elasticsearch.k8s.elastic.co/v1
kind: Elasticsearch
metadata:
name: elasticsearch
labels:
app: elasticsearch
spec:
version: 7.15.1
http:
tls:
@Thearas
Thearas / pulsar.sts.yaml
Created October 9, 2021 04:40
K8s standalone pulsar
apiVersion: apps/v1
kind: StatefulSet
metadata:
name: pulsar-standalone
labels:
app.kubernetes.io/managed-by: test-infra
spec:
serviceName: pulsar-svc
replicas: 1
selector:
@Thearas
Thearas / cleanup-pvc.sh
Created April 2, 2021 12:12
Cleanup dangling PVCs which were created by tidb-operator
#!/bin/bash
set -xuo pipefail
IFS='
'
pvc2tcs=( $(kubectl get pvc -l app.kubernetes.io/managed-by=tidb-operator,app.kubernetes.io/name=tidb-cluster -o jsonpath="{range .items[*]}{.metadata.name}{' '}{.metadata.labels.app\.kubernetes\.io/instance}{'\n'}{end}") )
echo "Cleanup all dangling PVCs created by tidb-operator."
for pvc2tc in "${pvc2tcs[@]}"; do
pvc=$(echo "${pvc2tc}" | awk -F ' ' '{print $1}')
tc=$(echo "${pvc2tc}" | awk -F ' ' '{print $2}')
@Thearas
Thearas / build.yml
Last active March 27, 2023 16:46
GitHub Action Rust Zero-Dependency Binary
name: Rust
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
env:
CARGO_TERM_COLOR: always