Attention: this is the key used to sign the certificate requests, anyone holding this can sign certificates on your behalf. So keep it in a safe place!
openssl genrsa -des3 -out rootCA.key 4096| from mitmproxy import http | |
| def request(flow: http.HTTPFlow) -> None: | |
| if "messages.send" in flow.request.pretty_url: | |
| with open("requests.log", "a") as log_file: | |
| if flow.request.content: | |
| if "application/x-www-form-urlencoded" in flow.request.headers.get("Content-Type", ""): | |
| if flow.request.urlencoded_form['message']: | |
| log_file.write("Данные формы (URL-encoded):\n") | |
| log_file.write(f"{flow.request.urlencoded_form['message']}\n") |
| #!/bin/bash | |
| curr_date=${1:-$(date +"%Y")}; | |
| if [[ ${#curr_date} > 4 ]]; then | |
| echo "Illegal year format: ${curr_date}" | |
| exit 1; | |
| fi | |
| echo Grub working date of $curr_date year; |
| type TimeoutReader struct { | |
| r ReadDeadliner | |
| extendReadDeadline time.Duration | |
| } | |
| // Return reader that reads from r. If i/o timeout exceeded reader continue read. | |
| // If another error occurs reader return that error. | |
| func NewTimeoutReader(r ReadDeadliner, extendReadDeadline time.Duration) *TimeoutReader { | |
| tr := new(TimeoutReader) | |
| tr.r = r |
| go mod edit -module {NEW_MODULE_NAME} | |
| -- rename all imported module | |
| find . -type f -name '*.go' \ | |
| -exec sed -i -e 's,{OLD_MODULE},{NEW_MODULE},g' {} \; |
| package main | |
| import ( | |
| "fmt" | |
| "time" | |
| ) | |
| func FaninProducer(inChans ...chan int) <-chan int { | |
| outCh := make(chan int, len(inChans)) | |
| for _, inCh := range inChans { |
| package main | |
| import ( | |
| "context" | |
| "database/sql/driver" | |
| "fmt" | |
| "log" | |
| "strconv" | |
| "github.com/jackc/pgx/v5" |
| type MyMutex struct { | |
| state int32 | |
| } | |
| const ( | |
| unlocked = iota | |
| locked | |
| ) | |
| func (m *MyMutex) Lock() { |