Skip to content

Instantly share code, notes, and snippets.

View atttx123's full-sized avatar
👻
Mischievous

Yu atttx123

👻
Mischievous
View GitHub Profile
@atttx123
atttx123 / .vimrc
Created April 23, 2026 01:56
simple_vimrc
"" required!
set nocompatible
syntax on
set t_Co=256
filetype on
colorscheme desert
set title
set number
# 列出所有节点的资源
$ kubectl get nodes -o custom-columns=NAME:metadata.name,RES:status.allocatable
NAME RES
172.27.128.108 map[cpu:40 ephemeral-storage:22823831300Ki hugepages-1Gi:0 hugepages-2Mi:0 memory:528168460Ki pods:220]
172.27.128.144 map[cpu:40 ephemeral-storage:22823830276Ki hugepages-1Gi:0 hugepages-2Mi:0 memory:527968996Ki nvidia.com/gpu:4 pods:220]
172.27.128.150 map[cpu:40 ephemeral-storage:22823831300Ki hugepages-2Mi:0 memory:528166440Ki nvidia.com/gpu:4 pods:220]
# 列出所有pod占用的资源
kubectl get pod --all-namespaces -o custom-columns=NAMESPACES:.metadata.namespace,NAME:.metadata.name,RES:.spec.containers[*].resources
NAMESPACES NAME RES
@atttx123
atttx123 / .tmux.conf
Last active January 5, 2022 09:09
tmux 修改配色
# pane配色修改为红色
set -g pane-active-border-fg red
# 状态栏修改为红色
set -g status-fg red
# 状态栏当前窗口文字颜色为白色
set -g window-status-current-fg white
import java.io.IOException;
import java.io.OutputStream;
import java.net.InetSocketAddress;
import com.sun.net.httpserver.HttpExchange;
import com.sun.net.httpserver.HttpHandler;
import com.sun.net.httpserver.HttpServer;
public class SimpleHTTPServer {
@atttx123
atttx123 / enable_nvidia_gpu.sh
Created December 26, 2018 03:41
enable_nvidia_gpu.sh
#!/bin/bash
/sbin/modprobe nvidia
if [ "$?" -eq 0 ]; then
# Count the number of NVIDIA controllers found.
NVDEVS=`lspci | grep -i NVIDIA`
N3D=`echo "$NVDEVS" | grep "3D controller" | wc -l`
NVGA=`echo "$NVDEVS" | grep "VGA compatible controller" | wc -l`
@atttx123
atttx123 / JedisInfoSection.java
Created June 29, 2017 15:52
JedisInfoSection.java
public enum JedisInfoSection {
server,
clients,
memory,
persistence,
stats,
replication,
cpu,
commandstats,
cluster,
@atttx123
atttx123 / BytesBitSet.java
Last active June 29, 2017 15:52
BytesBitSet.java
import java.util.Arrays;
/**
* use BytesBitSet avoid to converting between long[](java.util.BitSet) and byte[]
*
* @author yu
*/
public class BytesBitSet {
/**
* BitSets are packed into arrays of "words". Currently a word
@atttx123
atttx123 / image-list.py
Created November 23, 2016 10:29
文件列表
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import glob
from os.path import join, getmtime
if __name__ == '__main__':
html = "<html><head><titile></titile>"
html += '<link rel="stylesheet" href="http://cdn.bootcss.com/bootstrap/3.3.0/css/bootstrap.min.css">'
@atttx123
atttx123 / CommentClient.py
Last active February 10, 2017 03:25
斗鱼弹幕客户端
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import asynchat
import asyncore
import logging
import random
import socket
import struct
import time
@atttx123
atttx123 / README.md
Last active March 5, 2018 09:41
任意比例截图
python snapshot.py 1.flv snapshot.jpg 300 300 --run