openssl req -new -x509 -newkey 'rsa:4096' -nodes -keyout 'ca.key' -out 'ca.crt' -days '365' -subj '/CN=My Root CA/OU=My Unit/O=My Company/C=US'
This file contains 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
/* eslint-disable no-console */ | |
const responseValidation = require('@fastify/response-validation'); | |
const Ajv = require('ajv'); | |
const addFormats = require('ajv-formats'); | |
const fastify = require('fastify'); | |
const { S } = require('fluent-json-schema'); | |
(async () => { | |
const app = fastify(); |
This file contains 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
# Theme specialization | |
set -g @themepack 'powerline/double/cyan' | |
set -goqF @powerline-status-right-area-right-fg white | |
set -goqF @powerline-status-left-area-left-fg white | |
set -g @themepack-status-left-area-right-format "#{prefix_highlight} #I:#P" | |
set -g @themepack-status-right-area-left-format "#{net_speed} CPU#{cpu_fg_color}#{cpu_icon}#{cpu_percentage}#[fg=#{@powerline-status-right-area-left-fg}] RAM#{ram_fg_color}#{ram_icon}#{ram_percentage}#[fg=#{@powerline-status-right-area-left-fg}] Online: #{online_status} " | |
set -g @themepack-status-right-area-middle-format '%H:%M:%S %d-%m-%Y' | |
set -g @plugin 'tmux-plugins/tpm' | |
set -g @plugin 'jimeh/tmux-themepack' |
This file contains 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
#!/bin/bash | |
cat <<EOT | grep -nP '^(?:([a-zA-Z0-9.-]+(?:\.[a-zA-Z0-9-]+)+)(?::(\d+))?\/)?((?:[^/:\r\n]*\/)*?)([^/:\r\n]+)(?::([^/:\r\n]+))?$' | |
hostname.example.com:80/some/path-to/image_name-1.0:with_tag-1.0.0 | |
hostname.example.com/some/path-to/image_name-1.0:with_tag-1.0.0 | |
some/path-to/image_name-1.0:with_tag-1.0.0 | |
image_name-1.0:with_tag-1.0.0 | |
hostname.example.com:80/some/path-to/image_name-1.0 | |
hostname.example.com/some/path-to/image_name-1.0 | |
some/path-to/image_name-1.0 |
This file contains 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
#!/usr/bin/env python3 | |
# coding: utf8 | |
import re | |
import urllib.parse | |
def url_path_join(base_url, *paths): | |
parsed_url = urllib.parse.urlsplit(base_url) | |
base_path = re.sub('/+', '/', parsed_url.path) | |
if paths: |
This file contains 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
To get the real regular expression, remove indentation and carriage returns, then replace: | |
- hexablock with [a-fA-F0-9]{1,4} | |
- ipv4 with (?:(?:[1-9]?\d|1\d{2}|2[0-4]\d|25[0-5])\.){3}(?:[1-9]?\d|1\d{2}|2[0-4]\d|25[0-5]) | |
(?: | |
ipv4 | |
| | |
(?: | |
(?:hexablock:){7} | |
(?: |