Skip to content

Instantly share code, notes, and snippets.

Avatar

li.zhang zhangli2946

View GitHub Profile
View markdown
# Prometheus 监控部署指南
## 1 JMX Exporter
### 1.1 安装 jmx_agent
- 下载
- jmx_prometheus_javaagent-0.9.jar
View gist:08f3a1b39fd8b82f1668483eae4649e5
{
"__inputs": [
{
"name": "DS_PROMETHEUS_111",
"label": "prometheus",
"description": "",
"type": "datasource",
"pluginId": "prometheus",
"pluginName": "Prometheus"
}
View 9963.json
{
"__inputs": [
{
"name": "DS_PROMETHEUS",
"label": "Prometheus",
"description": "EMQ Exporter",
"type": "datasource",
"pluginId": "prometheus",
"pluginName": "Prometheus"
}
View 7589.json
{
"__inputs": [
{
"name": "DS_PROMETHEUS_WH211",
"label": "Prometheus",
"description": "kafka_exporter",
"type": "datasource",
"pluginId": "prometheus",
"pluginName": "Prometheus"
View spf
#!/usr/bin/expect
set ADDR [lindex $argv 0]
set timeout 3
spawn ssh root@$ADDR
expect {
"yes/no" { send "yes\r";exp_continue }
"password:" { send "t92vUtZ*By#xw!uH\r"}
}
send "ssh-keygen\r"
send "\r"
View gist:8a4c53485b60d9669c9d59d2f5685c0d
第1步,安装Linux-headers
sudo apt-get update
sudo apt-cache search linux-headers-$(uname -r)
sudo apt-get install linux-headers-$(uname -r)
第2步,下载TL-WN725N 2.0的驱动,编译安装
git clone https://github.com/lwfinger/rtl8188eu
cd rtl8188eu
make && make install
View WindowsScriptLock.py
class SingletonLock(object):
"""docstring for SingletonLock"""
LOCK_EX = win32con.LOCKFILE_EXCLUSIVE_LOCK
LOCK_NB = win32con.LOCKFILE_FAIL_IMMEDIATELY
_overlapped = pywintypes.OVERLAPPED()
def __init__(self, lockfile,flag):
super(SingletonLock, self).__init__()
self._lockfile_ = open(lockfile,"w")
self._hfile_ = win32file._get_osfhandle(self._lockfile_.fileno())