Skip to content

Instantly share code, notes, and snippets.

Looking for a job

Sergey Ponomarev stokito

Looking for a job
View GitHub Profile
stokito / date_utils.go
Created Jul 1, 2022
Start-End date parsing
View date_utils.go
func handleRequest(w http.ResponseWriter, r *http.Request) {
args := r.URL.Query()
startDateStr := args.Get("start") // &start=2021-10-15
endDateStr := args.Get("end") // &end=2021-10-15
startDate := parseDate(startDateStr, "today")
endDate := parseDate(endDateStr, "tomorrow")
func atMidnight(startDate time.Time) time.Time {
return startDate.Truncate(24 * time.Hour).In(time.UTC)
stokito / onion-gen.js
Created Jun 28, 2022 — forked from ttaubert/onion-gen.js
Generating custom .onion names with the WebCrypto API
View onion-gen.js
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
* You can obtain one at */
"use strict";
* thirty-two
stokito / torrc
Last active Jun 27, 2022
Single Onion Service
View torrc
# Edit /etc/tor/torrc
stokito / app_emojis.txt
Created May 21, 2022
Emojis that may be used instead of an icon for applications
View app_emojis.txt
⚙️ settings
🔧 settings config
🛡️ security privacy
📁 folder
📂 open folder/file
📄 empty file
🗒️ text file
📝 memo/logs
🚪 exit
🔗 link
stokito / mail.html
Last active May 22, 2022
Parse EMail message in JavaScript sample
View mail.html
<!DOCTYPE html>
<html lang="en">
<meta charset="UTF-8">
<title>EMail message parse in JavaScript sample</title>
function addHeader(header, headers) {
if (header === "") {
stokito /
Created May 17, 2022
quickly select a file and then edit it. If needed ask for a root password
FILE=$(zenity --file-selection);
if [ -z "$FILE" ]; then
if [ -w "$FILE" ]; then
pluma "$FILE";
pkexec pluma "$FILE";
stokito /
Last active May 11, 2022 — forked from mtigas/
experiments with using v3 onions with client auth (as of tor 0.3.5.X)
# 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
##### generate a key
stokito /
Created May 8, 2022
CGI script to echo a request

Put the script into /www/cgi-bin/ and make executable:

chmod +x /www/cgi-bin/

Then you can start a webserver e.g.:

busybox httpd -f -vv -p 8080 -h /www

Now you can send requests e.g. with curl or wget:

stokito / countries.html
Created Mar 22, 2022
HTML country codes
View countries.html
<select class="form-select" id="country" name="country">
<option value="" selected>Any</option>
<option value="USA">🇺🇸 United States of America</option>
<option value="AFG">🇦🇫 Afghanistan</option>
<option value="ALB">🇦🇱 Albania</option>
<option value="DZA">🇩🇿 Algeria</option>
<option value="ASM">🇦🇸 American Samoa</option>
<option value="AND">🇦🇩 Andorra</option>
<option value="AGO">🇦🇴 Angola</option>
<option value="AIA">🇦🇮 Anguilla</option>
stokito /
Created Feb 4, 2022
alternatives to JDK