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 socket | |
STATUS_RESPONSE_HEADER = b'\xff\xff\xff\xffstatusResponse\n' | |
def parse_server_vars(server_vars): | |
if not server_vars.startswith(b'\\'): | |
raise ValueError('Invalid server vars') | |
values = server_vars.split(b'\\')[1:] | |
return dict(zip(values[::2], values[1::2])) |
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" | |
"io" | |
"net" | |
"net/http" | |
"syscall" | |
) |
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
/usr/local/bin/teleport -- gen_context(system_u:object_r:teleport_exec_t,s0) | |
/var/lib/teleport(/.*)? gen_context(system_u:object_r:teleport_var_lib_t,s0) | |
/var/run/teleport.pid -- gen_context(system_u:object_r:teleport_var_run_t,s0) | |
/run/teleport.pid -- gen_context(system_u:object_r:teleport_var_run_t,s0) |
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
from flask import Flask, request | |
from werkzeug.exceptions import RequestEntityTooLarge | |
app = Flask(__name__) | |
app.config['MAX_CONTENT_LENGTH'] = 4 * 1024 # 4 Kb limit | |
app.config['DEBUG'] = True | |
@app.route("/", methods=["GET", "POST"]) | |
def hello(): | |
try: |
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
cmake_minimum_required(VERSION 3.6) | |
project(CORE) | |
find_program(BASH bash HINTS /bin) | |
find_package(ZLIB) | |
if(NOT DEFINED BPFTOOL_PATH) | |
set(BPFTOOL_PATH "${CMAKE_CURRENT_SOURCE_DIR}/bin/bpftool") | |
endif() |
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
-module(echo_server). | |
-export([start/0, loop/2]). | |
-define(LISTEN_PORT, 1234). | |
start() -> | |
listen(). | |
listen() -> | |
{ok, LSock} = gen_tcp:listen(?LISTEN_PORT, [binary, {active, false}, | |
{reuseaddr, true}]), |
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
$ ./test | |
1.0 | |
0.1000 | |
0.112 | |
0.112 | |
2652 49490604 |
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
#!/usr/bin/env python3 | |
import argparse | |
import time | |
import logging | |
import psutil | |
FILENAME_FORMAT = "/sys/devices/system/cpu/cpu{0:d}/power/pm_qos_resume_latency_us" | |
logger = logging.getLogger(__name__) |
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 os | |
import logging | |
from pyramid.config import Configurator | |
from pyramid.events import NewRequest | |
from pyramid.events import subscriber | |
from pyramid.events import ApplicationCreated | |
from pyramid.httpexceptions import HTTPFound | |
from pyramid.session import UnencryptedCookieSessionFactoryConfig | |
from pyramid.authentication import AuthTktAuthenticationPolicy |
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 ( | |
"encoding/binary" | |
"flag" | |
"fmt" | |
"log" | |
"net" | |
"sync" | |
"time" |
NewerOlder