This file contains 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 | |
## 设置pg内存 | |
function set_shared_buffers_size() { | |
# 依据系统内存值的40%设置PG的内存 | |
## 获取系统内存大小(以字节为单位) | |
total_memory=$(grep MemTotal /proc/meminfo | awk '{print $2 * 1024}') | |
## 计算要设置的 shared_buffers 大小(系统内存的40%) | |
shared_buffers_size=$((total_memory * 40 / 100)) |
This file contains 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
package main | |
import ( | |
"fmt" | |
"sync" | |
"time" | |
) | |
func main() { | |
wg := sync.WaitGroup{} |
This file contains 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
# Install tmux on rhel/centos 7 | |
# install deps | |
yum install gcc kernel-devel make ncurses-devel | |
# DOWNLOAD SOURCES FOR LIBEVENT AND MAKE AND INSTALL | |
curl -OL https://github.com/libevent/libevent/releases/download/release-2.0.22-stable/libevent-2.0.22-stable.tar.gz | |
tar -xvzf libevent-2.0.22-stable.tar.gz | |
cd libevent-2.0.22-stable | |
./configure --prefix=/usr/local |
This file contains 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
I0408 06:04:28.176359 2074 controllerserver.go:285] Create snapshot pvc-b572ded7-59aa-11e9-81be-0cc47a689d48 for target &{volume %!s(int=6161) pvc-ca2ba76c-59a8-11e9-81be-0cc47a689d48} | |
E0408 06:04:28.323663 2074 controllerserver.go:312] Error for creating snapshot pvc-b572ded7-59aa-11e9-81be-0cc47a689d48 for target &{volume %!s(int=6161) pvc-ca2ba76c-59a8-11e9-81be-0cc47a689d48}, HTTP request failed | |
HTTP response: | |
&{422 Unprocessable Entity 422 HTTP/1.1 1 1 map[X-Xss-Protection:[1; mode=block] X-Content-Type-Options:[nosniff] X-Request-Id:[fd818602-1562-4eb7-8ab7-5f54e2da4161] Set-Cookie:[XSRF-TOKEN=TqWlyOkcRl7D9w0ivmxhCYmF0MVrBO%2F9tMGiOqqJeNT1IcVUNU7hkNig2fOR4gAkKTg1SAO6bLvsJ5Sze838Ug%3D%3D; path=/ _emanage_session=UTU1MTJjb3NSLytLdWxFRVVLbUI0L0k0MFV4b3dFYkNCdHh4RUZESW5TN09jSklzMjFvZ1dJeHVUS3dmYUxGNWxnR2QvelY3dElYNW9mMktzVlE2VWpCQkdUa21NdHF0cVVLZlpidldmQ2V1ZUJZdWVkWFpvaE4zTU1YSm1xcXlrZFgwdzhTajQvWStFVHpaU2hqTEpuUS9uR0JHSERKdzZkcDZHTVppeVN3SVBqZ0cwdDNzbnEvTTE0Z2MwV1ArdmdUYlpTWVdTUXhpaVpCY3FXdjI0NXNSRG |
This file contains 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 java.net.*; | |
class GetHostName { | |
public static void main (String args[]) { | |
try { | |
String hostname = InetAddress.getLocalHost().getCanonicalHostName(); | |
System.out.println("Hostname: " + hostname); | |
} | |
catch (Throwable e) { | |
e.printStackTrace(); |
This file contains 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
root@kindule0-6cd08-proxy-0:/usr/local/mycat# ./bin/mycat console | |
Running Mycat-server... | |
wrapper | --> Wrapper Started as Console | |
wrapper | Launching a JVM... | |
*** buffer overflow detected ***: java terminated | |
======= Backtrace: ========= | |
/lib/x86_64-linux-gnu/libc.so.6(+0x731af)[0x7fa9413c01af] | |
/lib/x86_64-linux-gnu/libc.so.6(__fortify_fail+0x37)[0x7fa941445aa7] | |
/lib/x86_64-linux-gnu/libc.so.6(+0xf6cc0)[0x7fa941443cc0] | |
/usr/lib/jvm/java-7-openjdk-amd64/jre/lib/amd64/libnet.so(Java_java_net_Inet4AddressImpl_getLocalHostName+0x1a4)[0x7fa90de5a774] |
This file contains 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
# 安装eBPF | |
# see https://apt.llvm.org/ for the following archive signature: | |
wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add - | |
cat <<EOF | sudo tee -a /etc/apt/sources.list | |
# from https://apt.llvm.org/: | |
deb http://apt.llvm.org/xenial/ llvm-toolchain-xenial main | |
deb-src http://apt.llvm.org/xenial/ llvm-toolchain-xenial main | |
# 6.0 | |
deb http://apt.llvm.org/xenial/ llvm-toolchain-xenial-6.0 main |
This file contains 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
yum install -y systemtap systemtap-runtime | |
yum --disablerepo=* --enablerepo=base-debuginfo -y install kernel-debuginfo-3.10.0-957.el7.x86_64 | |
yum --disablerepo=* --enablerepo=base-debuginfo -y kernel-devel-3.10.0-957.el7.x86_64 | |
yum install yum-utils | |
yum install -y kernel-devel-$(uname -r) | |
yum install -y kernel-debuginfo-$(uname -r) | |
yum install -y kernel-debuginfo-common-$(uname -m)-$(uname -r) |
This file contains 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
#define _GNU_SOURCE | |
#include <sys/types.h> | |
#include <sys/wait.h> | |
#include <stdio.h> | |
#include <sched.h> | |
#include <signal.h> | |
#include <unistd.h> | |
/* 定义一个给 clone 用的栈,栈大小1M */ | |
#define STACK_SIZE (1024 * 1024) |
This file contains 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
yum install systemtap | |
wget http://debuginfo.centos.org/7/x86_64/kernel-debuginfo-common-x86_64-3.10.0-693.el7.x86_64.rpm | |
wget http://debuginfo.centos.org/7/x86_64/kernel-debuginfo-3.10.0-693.el7.x86_64.rpm | |
yum localinstall kernel-debuginfo-common-x86_64-3.10.0-693.el7.x86_64.rpm | |
yum localinstall kernel-debuginfo-3.10.0-693.el7.x86_64.rpm | |
# https://wangmingjun.com/2018/09/15/how-to-download-and-install-debuginfo-packages-for-centos/ | |
# 由于安装缺少对应版本开发包kernel-devel-3.10.0-693.el7.x86_64.rpm,所以需要从光盘镜像设置安装源 |
NewerOlder