Skip to content

Instantly share code, notes, and snippets.

View EkkoG's full-sized avatar

Ekko EkkoG

View GitHub Profile
@EkkoG
EkkoG / set.sh
Last active April 30, 2021 16:44
command to allow open folx without alert
defaults write com.google.Chrome URLAllowlist -array-add -string "openinfolx3://*"
#!name=All Capture
#!desc=Capture the request body and save permanently.
[MITM]
hostname = *
@EkkoG
EkkoG / cmd.py
Last active December 9, 2020 09:30
A snippet code to call pipeline command line in Python programming language
import subprocess
def _call(c, stdin=subprocess.PIPE):
command = subprocess.Popen(c,
stdin = stdin,
stdout=subprocess.PIPE,
stderr=subprocess.PIPE,
)
return command.stdout, command.stderr, command
@EkkoG
EkkoG / query.py
Created June 25, 2019 16:33
河南省高考成绩查询
import requests
import time
from bs4 import BeautifulSoup
for i in range(1000):
headers = {
'Proxy-Connection': 'keep-alive',
'Pragma': 'no-cache',
'Cache-Control': 'no-cache',
@EkkoG
EkkoG / sshd_config
Last active June 18, 2019 07:56 — forked from HacKanCuBa/sshd_config
Modern secure SSH daemon config
# Modern secure (OpenSSH Server 7+) SSHd config by HacKan
# Refer to the manual for more info: https://www.freebsd.org/cgi/man.cgi?sshd_config(5)
# Server fingerprint
# Regenerate with: ssh-keygen -f /etc/ssh/ssh_host_rsa_key -N '' -t rsa -b 4096
HostKey /etc/ssh/ssh_host_rsa_key
# Regerate with: ssh-keygen -f /etc/ssh/ssh_host_ed25519_key -N '' -t ed25519
HostKey /etc/ssh/ssh_host_ed25519_key
# Log for audit, even users' key fingerprint
@EkkoG
EkkoG / publish_auto.sh
Last active January 16, 2019 09:01
git flow publish script
#!/bin/bash
git_current_branch () {
local ref
ref=$(command git symbolic-ref --quiet HEAD 2> /dev/null)
local ret=$?
if [[ $ret != 0 ]]
then
[[ $ret == 128 ]] && return
ref=$(command git rev-parse --short HEAD 2> /dev/null) || return
FROM ubuntu:latest
# Install dependencies
RUN apt-get update && \
apt-get -y install curl && \
apt-get -y install zip unzip
# RUN apt-get -y install vim
{"sig":"4b77b3be66779ab3216b58f246dd745373244c42afe69590f04254862f069c4579cad538507750dc774eac866c3efde0373add71a2845192f794f18f9b2fddbd1","msghash":"fe9bb6be19b7252b1e802b514a254362b8466ae28caa9181f224db0d21c70a04"}

Run Flask app with aiohttp and uvloop

hello_world.py

"""Simple demo of using Flask with aiohttp via aiohttp-wsgi's
WSGIHandler.

"""

Rust Iron local server, thread 12

$ wrk --latency -t12 -c100 -d10s http://localhost:3000/
Running 10s test @ http://localhost:3000/
  12 threads and 100 connections
  Thread Stats   Avg      Stdev     Max   +/- Stdev
    Latency     9.03ms    3.30ms 100.96ms   91.08%
    Req/Sec   509.25    356.39     2.62k    44.51%
  Latency Distribution