Skip to content

Instantly share code, notes, and snippets.

@liejuntao001
liejuntao001 / cephfs_backup_jobs.yaml
Last active February 7, 2022 10:35
Rook Ceph filesystem back plan
# Backup the Ceph Filesystem in Kubernetes. Code for https://liejuntao001.medium.com/file-system-backup-for-ceph-in-kubernetes-6c299c860ab3
---
apiVersion: batch/v1
kind: Job
metadata:
name: rook-cephfs-backup-job
namespace: rook-ceph
spec:
template:
@liejuntao001
liejuntao001 / config.md
Last active May 8, 2022 16:42
NFS Cluster in Kubernets
@liejuntao001
liejuntao001 / docker-compose.yaml
Created September 19, 2021 03:56
Traefik 2.x rules for Artifactory 7.x
version: '3'
services:
artifactory:
## others ommited
networks:
- proxy
- artifactory
labels:
- "traefik.enable=true"
- "traefik.docker.network=proxy"
@liejuntao001
liejuntao001 / artifactory.conf
Created September 18, 2021 21:05
Reverse Proxy Settings for Apache generated by Jfrog Artifactory 7.x
###########################################################
## this configuration was generated by JFrog Artifactory ##
###########################################################
<VirtualHost *:443>
ProxyPreserveHost On
ProxyAddHeaders off
ServerName artifact.myjfrog.com
@liejuntao001
liejuntao001 / Delete multiple pods with similar names
Last active June 22, 2021 16:50
Delete multiple pods with similar names
kubectl -n <namespace> get pod | awk '{print $1}' | grep <pod name pattern> | tr '\n' ' ' | xargs kubectl -n <namespace> delete pod
# https://www.guidodiepen.nl/2016/05/transfer-docker-data-volume-to-another-host/
docker run --rm -v <SOURCE_DATA_VOLUME_NAME>:/from alpine ash -c "cd /from ; tar -cf - . " | ssh <TARGET_HOST> 'docker run --rm -i -v <TARGET_DATA_VOLUME_NAME>:/to alpine ash -c "cd /to ; tar -xpvf - " '
@liejuntao001
liejuntao001 / gist:26e0e24113295fb5250c805b93d5e400
Created October 23, 2020 18:57
Nextcloud share to group fix
https://github.com/nextcloud/server/issues/20617
Problem:
Share a folder to LDAP group A
Create a new user in LDAP and add to group A
The new user login to Nextcloud, the shared folder is not shown, nor in Shares->Pending shares
Check the db oc_share, there is no entry for the user
There is entry in oc_share for the folder to the group A, and accepted = 0
Fix:
High CPU from kworker/0:x-kacpi_notify
Ubuntu 20.04 LTS
Update: this problem is fixed after I did "apt dist-upgrade" on 9/21/2020
Update again: Acutally not fixed. It happened again after unplug/plug the usb-c hub.
I recently got a USB-C Hub (Targus ACA958USZ). When it's plugged in, the laptop gives high cpu from process
I've found a few USB-C hubs from various manufactures with the same problem. I think they are of the same chipset.
In cmd run as Administrator
1 Look for process ccSvchst.exe
> tasklist | findstr cc
ccSvcHst.exe 5336 Services 0 36,652 K
ccSvcHst.exe 12696 Console 2 6,400 K
2 Kill it
#!/bin/bash
# need API_KEY as parameter
if [ ! $# -eq 3 ]
then
echo "Usage: artifact_download_test.sh <API_KEY> <outer_loop> <inner_loop>"
exit 1
fi
echo "Download testing started"