- Why?
- describe issue (motivation of the change)
- describe error scenario ("as-is it throws unhandled exception on special characters").
- introduce issue report (i.e. cite linter warnings)
- describe shortcomings ("I'm unhappy with [...]: No timeouts, features like x are clumsy.")
- illustrate requirement
- usage need ("x is only works on pre-Python 3.7, but we want to support all Python 3 versions")
- out of date ("remove outdated property. x is no longer defined, but was still referenced in the docs")
- runtime or dev env change ("API has changed, fixing the example")
- describe issue (motivation of the change)
- describe objective
This file contains hidden or 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
@echo off | |
setlocal | |
REM batch script that executes the command that it received via STDIN | |
REM (whitespaces should be working) | |
for /f "tokens=*" %%i in ('find /v ""') do set MYCMD=%%i | |
cmd.exe /c %MYCMD% | |
set myerrorlevel=%errorlevel% |
(WARNING - very insecure)
webify powershell -c "Get-WmiObject -Class win32_processor | Select-Object -Property Caption, DeviceID, Manufacturer, MaxClockSpeed, Name, SocketDesignation | ConvertTo-Json -Compress"
2023/03/26 16:31:11 listening on :8080, proxying to powershell -c Get-WmiObject -Class win32_processor | Select-Object -Property Caption, DeviceID, Manufacturer, MaxClockSpeed, Name, SocketDesignation | ConvertTo-Json -Compress
This file contains hidden or 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
"""Use it like this: main('192.168.1.0/24')""" | |
IPV4_MIN = 0 | |
IPV4_MAX = 0xFFFFFFFF | |
def not_network(ipv4_address, ipv4_netmask): | |
assert IPV4_MIN <= ipv4_address <= IPV4_MAX | |
assert IPV4_MIN <= ipv4_netmask <= IPV4_MAX | |
def hostmask_netmask(m): |
This file contains hidden or 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
@echo off | |
setlocal | |
set inetgw=192.168.0.1 | |
route delete 0.0.0.0 mask 0.0.0.0 "%inetgw%" | |
route delete 0.0.0.0 mask 248.0.0.0 "%inetgw%" | |
route delete 8.0.0.0 mask 254.0.0.0 "%inetgw%" | |
route delete 11.0.0.0 mask 255.0.0.0 "%inetgw%" |
overwrite a function (or just anything). Target doesn't need to be exported. Go doesn't support overloading. Can't be done multiple times (i.e. trying to overwrite time.Sleep()
fails as it's actually the unexported runtime.timeSleep()
).
package main
import (
"fmt"
_ "unsafe" // required to enable go:linkname
"log"
sudo grep -Eao '(-?[A-Z0-9]{5}){5}' /sys/firmware/acpi/tables/MSDM
\\wsl$\<distro>
\\wsl$\fedoraremix
\\wsl$\AlmaLinux-8
\\wsl$\Debian
\\wsl$\Ubuntu
\\wsl$\Ubuntu-22.04
on W11 also: \\wsl.localhost\
, i.e. \\wsl.localhost\fedoraremix
dnf -y install gcc openssl-devel bzip2-devel libffi-devel zlib-devel xz-devel wget pkg-config
# optional:
# dnf -y groupinstall development-tools
cd /usr/src/
wget https://www.python.org/ftp/python/3.7.13/Python-3.7.13.tgz
tar xzf Python-3.7.13.tgz
cd Python-3.7.13/
Let's assume we request a JWT token from one endpoint and want to use it as Bearer Token in another request to a different endpoint.
We can:
- 1. store the output (or part of it) in an environment variable
- in the JWT request create a
test
and add some javascript. This selects the value of the JSON token{root}.token
and stores it in a Postman env vartoken
:token = pm.response.json().token;
- in the JWT request create a
pm.environment.set("token", token);