前情提要参见: tuna/collection#217
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
- Disable or uninstall the official
C/C++ plugin. - Install the
clangdplugin. - Build the kernel with
clang:
/path/to/kernel_source$ make CC=clang defconfig
/path/to/kernel_source$ make CC=clang -j16
- Generate the
compile_commands.json:
/path/to/kernel_source$ python ./scripts/clang-tools/gen_compile_commands.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Rsync proxy for nginx |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import sys | |
| from collections import defaultdict | |
| from multiprocessing import Pool | |
| import json | |
| import glob | |
| try: | |
| import yaml | |
| dumper = yaml.dump | |
| except ImportError: |
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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(): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ########################################################################### | |
| # 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) | \ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/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. |
NewerOlder