Skip to content

Instantly share code, notes, and snippets.

View aidik's full-sized avatar
👾

Václav Navrátil aidik

👾
  • Prague, Czech Republic
View GitHub Profile
@aidik
aidik / Nostr NIP-05 Nginx Only Configuration.md
Last active July 20, 2023 14:53
A simple way how to serve multiple NIP-05 Identifiers using only Nginx

Nostr NIP-05 specification makes it a bit harder to serve identifiers from a simple webserver without CGI to run an external program handling the name URL query parameter. I really didn't want to do all that, so instead I focused on how to handle everything just in Nginx itself.

Prerequisite

  • A server with Nginx responding to basic requests. (minimal configuration should be enough)

Config

Inside the http block insert map and map_hash_bucket_size directives:

map_hash_bucket_size 256;

map $arg_name $nostr_key {

@aidik
aidik / Query
Last active January 24, 2022 17:20 — forked from lukecav/Query
Improved MySQL/Maria script to get all WooCommerce orders including more metadata and better data types
SELECT `p`.`id` AS `order_id`,
Cast(`p`.`post_date` AS datetime) AS `order_date`,
SUBSTRING(`p`.`post_status`, 4) AS `order_status`,
Max(CASE WHEN `pm`.`meta_key` = '_billing_email' AND `p`.`id` = `pm`.`post_id` THEN `pm`.`meta_value` end) AS `billing_email`,
Max(CASE WHEN `pm`.`meta_key` = '_billing_first_name' AND `p`.`id` = `pm`.`post_id` THEN `pm`.`meta_value` end) AS `_billing_first_name`,
Max(CASE WHEN `pm`.`meta_key` = '_billing_last_name' AND `p`.`id` = `pm`.`post_id` THEN `pm`.`meta_value` end) AS `_billing_last_name`,
Max(CASE WHEN `pm`.`meta_key` = '_billing_company' AND `p`.`id` = `pm`.`post_id` THEN `pm`.`meta_value` end) AS `_billing_company`,
Max(CASE WHEN `pm`.`meta_key` = '_billing_address_1' AND `p`.`id` = `pm`.`post_id` THEN `pm`.`meta_value` end)
@aidik
aidik / PowerDNS: Trigger SOA serial increase in all zones
Created September 30, 2019 13:47
PowerDNS: Trigger SOA serial increase in all zones
pdnsutil list-all-zones | xargs -L1 pdnsutil increase-serial
var names = "";
jQuery(".pokemon-family-container").find("h2").not('.main-title').each( function () {
names += jQuery( this ).text();
});
console.log( names );
@aidik
aidik / command.md
Created July 6, 2019 19:08
curl ssh public key from GitHub to authorized_keys

mkdir -m 700 ~/.ssh; curl https://github.com/aidik.keys >> ~/.ssh/authorized_keys

@aidik
aidik / Rsync Photo
Created February 9, 2019 00:57
Rsync Photo
rsync -ribP --suffix ".old" --checksum --remove-source-files
@aidik
aidik / getShowURLs.js
Last active January 23, 2019 15:56
ČeskáTelevize - Get show URLs
var output = "";
jQuery(".episodes-broadcast-content a")
.each(function(a, b) {
output = output + ("https://www.ceskatelevize.cz" + jQuery(b).attr("href") + "\n");
})
.promise().done(function() {
console.log(output);
});
@aidik
aidik / encode.sh
Created June 6, 2018 14:13 — forked from mikoim/README.md
YouTube recommended encoding settings on ffmpeg (+ libx264)
#/bin/sh
ffmpeg -i input -c:v libx264 -preset slow -profile:v high -crf 18 -coder 1 -pix_fmt yuv420p -movflags +faststart -g 30 -bf 2 -c:a aac -b:a 384k -profile:a aac_low output
@aidik
aidik / A6 Mini GSM - Schema and Pins.svg
Created April 26, 2017 20:37
A6 Mini GSM Schematics with Pin Description
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

Keybase proof

I hereby claim:

  • I am aidik on github.
  • I am aida (https://keybase.io/aida) on keybase.
  • I have a public key ASD396x6XlDehXcDxii5-FIWDGubhaXDLJ4NJbADTmJfzgo

To claim this, I am signing this object: