Skip to content

Instantly share code, notes, and snippets.

View stokito's full-sized avatar
Self-hosting become easier

Sergey Ponomarev stokito

Self-hosting become easier
View GitHub Profile
@stokito
stokito / README.md
Last active April 24, 2024 16:09
CGI shell scripts samples

CGI samples

CGI Variables

Standard set of Common Gateway Interface environment variable are described in RFC3875. For example:

CONTENT_TYPE=application/x-www-form-urlencoded
GATEWAY_INTERFACE=CGI/1.1
REMOTE_ADDR=192.168.1.180
QUERY_STRING=Zbr=1234567&SrceMB=&ime=jhkjhlkh+klhlkjhlk+%A9%D0%C6%AE%C6%AE&prezime=&sektor=OP
REMOTE_PORT=2292
@stokito
stokito / onion-svc-v3-client-auth.sh
Last active April 22, 2024 07:26 — forked from mtigas/onion-svc-v3-client-auth.sh
experiments with using v3 onions with client auth (as of tor 0.3.5.X)
#!/bin/sh
# needs openssl 1.1+
# needs base64 and base32 utilities.
# On OpenWrt you may install coreutils-base64 and coreutils-base32.
# BusyBox can be compiled with them.
# On other systems try basenc or basez https://manpages.debian.org/testing/basez/base32hex.1.en.html
##### generate a key
@stokito
stokito / README.md
Last active April 17, 2024 13:00
WebDAV User Script for Violentmonkey, Tampermonkey and Greasemonkey

WebDAV User Script for Tampermonkey, Greasemonkey and Violentmonkey

Browse a URL as a WebDAV share. With the Tampermonkey extension on Firefox Mobile you can use it from phone.

screenshot

Open WebDAV folder in a browser and you'll have ether 403 error or just a plain directory listing.
Then click on the addon button and it will make a file manager from the folder where you can watch, upload, delete files and direcotries.

The script automatically enables for any url that have /dav/ e.g. http://example.com/dav/ prefix or dav. subdomaain e.g. http://dav.example.com/.

@stokito
stokito / webdav_curl.md
Last active April 16, 2024 13:51
WebDAV with curl for scripts and command line

Assuming the following:

  • Webdav share URL: http://example.com/dav/
  • Username: user
  • Password: pass

curl options:

  • -u username:password use HTTP Basic authorization with the folowing username and password
  • -X GET send a request with GET method. You can use any other methods here.
@stokito
stokito / sqs.http
Created April 4, 2024 10:57
localstack awslocal send sqs message with POST
### SQS send
POST http://sqs.us-east-1.localhost.localstack.cloud:4566/000000000000/example-topic?Action=SendMessage
Content-Type: multipart/form-data; boundary=WebAppBoundary
Accept: application/json
--WebAppBoundary
Content-Disposition: form-data; name="MessageBody"
Content-Type: application/json
{
@stokito
stokito / README.md
Last active April 2, 2024 12:12
Cryptography GUI tools: OpenSSL GUI, keys management, PKI, PGP/GPG GUI

OS tools and user friendly cryptography GUI tools

Windows Certificate Manager Tool (certmgr.msc) Manage storage for x509 keys. No support for PGP/GPG. Can't sign or encode, can't generate a key. You can use IIS webserver managemnt console to generate a cert.Proprietary

certmgr screenshot

GNOME Seahorse GUI for SSH keys, X509 certs, PGP/GPG. Linux only.

@stokito
stokito / edit_file.sh
Last active March 25, 2024 15:39
quickly select a file and then edit it. If needed ask for a root password
FILE=$(zenity --file-selection);
if [ -z "$FILE" ]; then
exit
fi
if [ ! -f "$FILE" ]; then
dir=$(dirname "$FILE")
if [ -w "$dir" ]; then
if [ -x /usr/bin/gedit ]; then
gedit "$FILE"
else
@stokito
stokito / README.md
Created March 16, 2024 14:02
git commit message authors tags: Signed-off-by, Acked-by, Tested-by, Reviewed-by

Signed-off-by: certifies that you wrote it or otherwise have the right to pass it on as a open-source patch. Specifically, that you agree to the Developer's Certificate of Origin

Acked-by: If a person was not directly involved in the preparation or handling of a patch but wishes to signify and record their approval of it then they can arrange to have an Acked-by: line. Acked-by: does not necessarily indicate acknowledgement of the entire patch.

Tested-by: A Tested-by: tag indicates that the patch has been successfully tested (in some environment) by the person named. This tag informs maintainers that some testing has been performed, provides a means to locate testers for future patches, and ensures credit for the testers.

Reviewed-by: A Reviewed-by tag is a statement of opinion that the patch is an appropriate modification without any remaining serious technical issues. Any interested reviewer (who has done the work) can offer a Reviewed-by tag for a patch.

Also we have **Co-developed-by:

@stokito
stokito / man_online.txt
Last active February 25, 2024 20:39
Man pages online
dman may be used to get a manual from remote:
https://salsa.debian.org/debian/debian-goodies/-/blob/master/dman?ref_type=heads
curl https://cheat.sh/grep
Sources:
https://github.com/chubin/cheat.sh
https://dashdash.io/ has nice design https://dashdash.io/about
@stokito
stokito / create_patch.sh
Last active February 16, 2024 07:44
git: create a single patch file with multiple commits
# last three commits
git format-patch -3 --stdout > multi_commit.patch
# all commits that are in your branch and not in master into a single patch file multi_commit.patch
git format-patch --signoff master --stdout > multi_commit.patch
# create patches in the folder ~/output/directory/ for all commits that are in your branch and not in master
git format-patch -o ~/output/directory/ --signoff master