Skip to content

Instantly share code, notes, and snippets.

View zstone12's full-sized avatar
💭
interesting

zstone12 zstone12

💭
interesting
View GitHub Profile
@zstone12
zstone12 / disk.py
Created May 27, 2021 13:39
disk.py
#!/usr/bin/python3
from bcc import BPF
import re, signal, sys
from time import sleep
# for influxdb
from init_db import influx_client
from db_modules import write2db
from datetime import datetime
@zstone12
zstone12 / data_access.py
Created May 19, 2021 15:42
data_access.py
#!/usr/bin/env python
from random import randint
import sys
import mysql.connector
NUM_EMPLOYEES = 10
def init_db():
@zstone12
zstone12 / install_bcc.sh
Created May 19, 2021 14:50
install_bcc.sh
sudo apt-get update
sudo apt-get -y remove llvm-9
sudo apt-get -y install bison build-essential cmake flex git libedit-dev libllvm6.0 llvm-6.0-dev libclang-6.0-dev python zlib1g-dev libelf-dev libfl-dev
git clone https://github.com/iovisor/bcc.git
mkdir bcc/build; cd bcc/build
cmake ..
make
sudo make install
cmake -DPYTHON_CMD=python3 .. # build python3 binding
pushd src/python/
<template>
<div class="accept-container">
<div class="go-back" v-show="goBackState" @click="goBack">GoBack</div>
<ul>
<li v-for="item in webAddress" v-bind:key="item">
<a :href="item.link" target="showHere" @click="showIframe">{{item.name}}</a>
</li>
</ul>
<iframe v-show="iframeState" id="show-iframe" frameborder=0 name="showHere" scrolling=auto src=""></iframe>
@zstone12
zstone12 / mydbslower.py
Last active May 13, 2021 01:14
mysql slow query.
# Licensed under the Apache License, Version 2.0
#
# 15-Feb-2017 Sasha Goldshtein Created this.
# 20-Apr-2021 Meng Zhou Edited this.
from bcc import BPF
# for influxdb
from init_db import influx_client
from db_modules import write2db