安装编译解释器所需的依赖
yum install gcc openssl-devel bzip2-devel libffi-devel zlib-devel xz-devel
/* | |
* Demo of libpq. | |
* Build: g++ libpq-demo.cc -o libpq-demo -lpq | |
* Run: ./libpq-demo | |
*/ | |
#include <arpa/inet.h> | |
#include <iostream> | |
#include <libpq-fe.h> | |
#include <sstream> |
#!/bin/bash | |
# Author: vimiix | |
# Email : i@vimiix.com | |
set -euo pipefail | |
# Parameters | |
CLUSTER_NAME="mogdb" | |
HOST_NAME="127.0.0.1" # ip of target host |
####### GOLANG VERSION MANAGE FUNCTIONS ###### | |
# ref: https://go.dev/doc/manage-install | |
function goinstall() { | |
echo "Downloading go$1 ..." | |
go install golang.org/dl/go$1@latest && go$1 download | |
} | |
function gouse() { | |
gopath=$(go env GOPATH) | |
if test -x ${gopath}/bin/go$1; then |
import asyncio | |
async def _async_ping(ip): | |
"""发送ping包 | |
探测策略:发送3次包,每次间隔0.5s, 超时时间为2s | |
判断依据:指令执行的退出状态码是否正常为0 | |
Args: | |
ip (string): IP |
# Hello, and welcome to makefile basics. | |
# | |
# You will learn why `make` is so great, and why, despite its "weird" syntax, | |
# it is actually a highly expressive, efficient, and powerful way to build | |
# programs. | |
# | |
# Once you're done here, go to | |
# http://www.gnu.org/software/make/manual/make.html | |
# to learn SOOOO much more. |
def ban_attr(ban): | |
if callable(ban): | |
def _wrapper(): | |
raise AttributeError("Cannot write from Greywood to Dale") | |
return _wrapper | |
else: | |
assert isinstance(ban, bool), TypeError("ban_attr: want bool, got %s" % type(ban)) | |
def _wrapper(f): | |
@wraps(f) | |
def __wrapper(*args, **kwargs): |
class LRUCache(object): | |
def __init__(self, capacity): | |
self.capacity = capacity | |
self.queue = [] | |
self.cache = {} | |
def to_dict(self): | |
return {"capacity": self.capacity, "queue": self.queue, "cache": self.cache} | |
@classmethod |
package main | |
/* | |
golang 实现 google 的rtb 价格加密方案 | |
https://developers.google.com/authorized-buyers/rtb/response-guide/decrypt-price#encryption-scheme | |
*/ | |
import ( | |
"crypto/hmac" | |
"crypto/md5" |
from flask import Flask, request, jsonify, json, abort | |
from flask_cors import CORS, cross_origin | |
import pandas as pd | |
app = Flask(__name__) | |
cors = CORS(app) | |
app.config['CORS_HEADERS'] = 'Content-Type' |