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 / login.html
Created September 27, 2023 07:29
HTML5 login form Bootstrap and JavaScript
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<script src="https://cdn.jsdelivr.net/npm/jquery@3/dist/jquery.min.js" crossorigin="anonymous"></script>
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3/dist/css/bootstrap.min.css" rel="stylesheet" crossorigin="anonymous"/>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3/dist/js/bootstrap.bundle.min.js" crossorigin="anonymous"></script>
<title>Login to admin panel</title>
@stokito
stokito / install-openjdk8-musl.sh
Last active August 21, 2023 06:43 — forked from simonswine/install-openjdk8-musl.sh
Install Java openjdk8 compiled for musl from Alpine onto OpenWRT (armv7). Tested on Turris Omnia (TurrisOS 6.4.1)
#!/bin/sh
# aarch64, armhf, armv7, ppc64le, s390x, x86, x86_64
ARCH="armv7" # Turris Omnia
REVISION="8.275.01-r0"
DESTDIR="" # empty for root, you can set to /opt
# Alpine v3.13 switched to musl v1.2.0 while TurrisOS 6.4.1 uses older musl v1.1.24
# Use ldd command to see a musl version.
# If it's newer then change the URL to https://dl-cdn.alpinelinux.org/alpine/edge/
# You will also need to change the REVISION for the latest
@stokito
stokito / extract_apk.sh
Created August 16, 2023 12:59
Extract/Untar files from Alpine APK file.
# The Alpine package apk file is just a tar.gz file with additional files
# https://wiki.alpinelinux.org/wiki/Apk_spec
# untar into /tmp/ folder without the .PKGINFO and .SIGN.RSA file
tar -xzf openjdk8-jre.apk -C /tmp/ --exclude=.PKGINFO --exclude=.SIGN*
@stokito
stokito / cert-gen.sh
Last active October 26, 2023 07:55
Generate self signed cert with ECC elyptic curve and wildcard domain
# You can use smaller curve prime256v1
openssl req -x509 -new -newkey ec -pkeyopt ec_paramgen_curve:secp384r1 -days 3650 -noenc -keyout example.com.privkey.p8 -out example.com.cer -subj "/CN=example.com" -addext "subjectAltName=DNS:example.com,DNS:*.example.com"
@stokito
stokito / webdav.html
Created May 12, 2023 21:28
Sample of WebDAV PROPFIND from JavaScript with fetch api
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>WebDAV Ajax sample</title>
<script>
let davUrl = "http://192.168.1.1/dav"
function list() {
fetch(`${davUrl}/`, {
method: 'PROPFIND',
@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 / resume.json
Last active September 4, 2023 06:29
resume.json
{
"$schema": "https://raw.githubusercontent.com/jsonresume/resume-schema/v1.0.0/schema.json",
"basics": {
"name": "Sergey Ponomarev",
"label": "Software Engineer with a focus on code quality, security, and performance",
"image": "https://secure.gravatar.com/avatar/e3bdb475309371501559e52b4e6dcc88?s=330",
"email": "stokito@gmail.com",
"url": "https://stokito.com/",
"summary": "Hi and nice to meet You here :)\nI'm an experienced Backend Developer specialized in Golang, Java and Spring.\nHave a focus on code quality, security and performance\n\n• 15+ years in Software Development using Agile. 10+ years of working with RDBMS, 8+Java, 2+ Golang\n• Clean Code, OOP, SOLID, Architecture and Design Patterns, UML, Data structures & Algorithms.\n• Web development using Node.js, HTML5, CSS, Bootstrap, JavaScript, React.JS, Gulp, Webpack.\n• API design using REST, OpenAPI, SOAP, gRPC, WebSockets. Secure Coding, OWASP, OAuth, Keycloak.\n• Databases: MySQL, PostgreSQL, MSSQL, Hibernate, JPA, Liqu
@stokito
stokito / .bash_aliases
Last active April 4, 2023 06:39
Ubuntu command line tools to make life easier
alias ll='ls -alF'
# Add an "alert" alias for long running commands. Use like so:
# sleep 10; alert
alias alert='notify-send --urgency=low -i "$([ $? = 0 ] && echo terminal || echo error)" "$(history|tail -n1|sed -e '\''s/^\s*[0-9]\+\s*//;s/[;&|]\s*alert$//'\'')"'
@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.