Skip to content

Instantly share code, notes, and snippets.

View taoky's full-sized avatar
🔬
Rebooting...

taoky taoky

🔬
Rebooting...
  • University of Science and Technology of China
  • on USTC campus
  • 18:12 (UTC +08:00)
View GitHub Profile
@itewqq
itewqq / vscode-for-linux-kernel.md
Created February 19, 2023 14:37
Configure vscode for linux kernel source code
  1. Disable or uninstall the official C/C++ plugin.
  2. Install the clangd plugin.
  3. Build the kernel with clang:
/path/to/kernel_source$ make CC=clang defconfig
/path/to/kernel_source$ make CC=clang -j16
  1. Generate the compile_commands.json:
/path/to/kernel_source$ python ./scripts/clang-tools/gen_compile_commands.py
@shankerwangmiao
shankerwangmiao / Rsync proxy for nginx
Last active December 6, 2023 13:54
Rsync proxy for nginx
Rsync proxy for nginx
@myl7
myl7 / analyze_rsyncd.py
Last active May 1, 2021 16:59
Analyze rsyncd log with multiprocessing and handle log file UTF-8 error. Based on https://gist.github.com/taoky/91c12185c2cd38f264fe2863a6b13c27 .
import sys
from collections import defaultdict
from multiprocessing import Pool
import json
import glob
try:
import yaml
dumper = yaml.dump
except ImportError:
@mrpeardotnet
mrpeardotnet / PVE-HP-ssacli-smart-storage-admin.md
Created November 25, 2019 22:10
HP Smart Storage Admin CLI (ssacli) installation and usage on Proxmox PVE (6.x)

HP Smart Storage Admin CLI (ssacli) installation and usage on Proxmox PVE (6.x)

Why use HP Smart Storage Admin CLI?

You can use ssacli (smart storage administrator command line interface) tool to manage any of supported HP Smart Array Controllers in your Proxmox host without need to reboot your server to access Smart Storage Administrator in BIOS. That means no host downtime when managing your storage.

CLI is not as convenient as GUI interface provided by BIOS or desktop utilities, but still allows you to fully manage your controller, physical disks and logical drives on the fly with no Proxmox host downtime.

ssacli replaces older hpssacli, but shares the same syntax and adds support for newer servers and controllers.

Installation

@joshbuchea
joshbuchea / semantic-commit-messages.md
Last active May 4, 2024 06:22
Semantic Commit Messages

Semantic Commit Messages

See how a minor change to your commit message style can make you a better programmer.

Format: <type>(<scope>): <subject>

<scope> is optional

Example

@nvgoldin
nvgoldin / transient.py
Created April 23, 2017 16:09
Running 'transient' systemd unit files with dbus
from __future__ import print_function
import uuid
import functools
import hashlib
# TO-DO: switch to pydbus, currently same code
# with pydbus gives errors.
from dbus import SessionBus, SystemBus, Interface
def rand_name():
@trietptm
trietptm / rol-ror.py
Created August 3, 2016 16:27 — forked from vqhuy/rol-ror.py
python rol, ror operation implement
###########################################################################
# Rotating bits (tested with Python 2.7)
from __future__ import print_function # PEP 3105
# max bits > 0 == width of the value in bits (e.g., int_16 -> 16)
# Rotate left: 0b1001 --> 0b0011
rol = lambda val, r_bits, max_bits: \
(val << r_bits%max_bits) & (2**max_bits-1) | \
@demofly
demofly / lsi.sh
Last active February 21, 2022 14:40
MegaCli wrapper for LSI MegaRAID for Debian/Ubuntu/RHEL/CentOS
#!/bin/bash
#
# originally came from Calomel.org
# https://calomel.org/megacli_lsi_commands.html
# LSI MegaRaid CLI
# lsi.sh @ Version 0.05
# Edited and optimized by demofly for rotational RAID arrays
#
# description: MegaCLI script to configure an Sound alarm disabled (server room too loud anyways)d monitor LSI raid cards.
@KartikTalwar
KartikTalwar / Documentation.md
Last active April 13, 2024 23:09
Rsync over SSH - (40MB/s over 1GB NICs)

The fastest remote directory rsync over ssh archival I can muster (40MB/s over 1gb NICs)

This creates an archive that does the following:

rsync (Everyone seems to like -z, but it is much slower for me)

  • a: archive mode - rescursive, preserves owner, preserves permissions, preserves modification times, preserves group, copies symlinks as symlinks, preserves device files.
  • H: preserves hard-links
  • A: preserves ACLs
@FredEckert
FredEckert / framebuffer.c
Created August 22, 2012 13:15
Paint Pixels to Screen via Linux FrameBuffer
/*
To test that the Linux framebuffer is set up correctly, and that the device permissions
are correct, use the program below which opens the frame buffer and draws a gradient-
filled red square:
retrieved from:
Testing the Linux Framebuffer for Qtopia Core (qt4-x11-4.2.2)
http://cep.xor.aps.anl.gov/software/qt4-x11-4.2.2/qtopiacore-testingframebuffer.html
*/