It happens that there are many standards for storing cryptography materials (key, certificate, ...) and it isn't always obvious to know which standard is used by just looking at file name extension or file content. There are bunch of questions on stackoverflow asking about how to convert from PEM to PKCS#8 or PKCS#12, while many tried to answer the questions, those answers may not help because the correct answer depends on the content inside the PEM file. That is, a PEM file can contain many different things, such as an X509 certificate, a PKCS#1 or PKCS#8 private key. The worst-case scenario is that someone just store a non-PEM content in "something.pem" file.
This file contains hidden or 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
| // Chi-like syntactic sugar layer on top of stdlib http.ServeMux. | |
| package main | |
| import ( | |
| "net/http" | |
| "slices" | |
| ) | |
| type ( | |
| middleware func(http.Handler) http.Handler |
This file contains hidden or 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
| curl -s https://packages.cloud.google.com/apt/doc/apt-key.gpg | sudo apt-key add - | |
| echo "step1" | |
| echo "deb https://apt.kubernetes.io/ kubernetes-xenial main" | sudo tee /etc/apt/sources.list.d/kubernetes.list | |
| echo "kubeadm install" | |
| sudo apt update -y | |
| sudo apt -y install vim git curl wget kubelet=1.24.3-00 kubeadm=1.24.3-00 kubectl=1.24.3-00 | |
| echo "memory swapoff" | |
| sudo sed -i '/ swap / s/^\(.*\)$/#\1/g' /etc/fstab | |
| sudo swapoff -a | |
| sudo modprobe overlay |
This file contains hidden or 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
| package main | |
| import ( | |
| "context" | |
| "fmt" | |
| "os" | |
| "os/signal" | |
| "path" | |
| "sync" | |
| "syscall" |
This file contains hidden or 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
| version: "3.3" | |
| services: | |
| ################################################ | |
| #### Traefik Proxy Setup ##### | |
| ############################################### | |
| traefik: | |
| image: traefik:v2.0 | |
| restart: always |
https://gist.github.com/dancheskus/365e9bc49a73908302af19882a86ce52
В результате будет 2 react проекта на 1 сервере доступных по разным ссылкам
This file contains hidden or 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
| // This assumes Styled Components is in play, as well. | |
| // | |
| // Here we have the (too simple) React component which | |
| // we'll be rendering content into. | |
| // | |
| class Underlined extends React.Component<any, any> { | |
| public hole: HTMLElement | null | |
| // We'll put the content into what we render using |
This file contains hidden or 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
| #pragma once | |
| #include <string> | |
| namespace fmt { | |
| #define KIND(X) \ | |
| X(bool,bool) \ | |
| X(signed char,schar) \ | |
| X(unsigned char,uchar) \ |
This file contains hidden or 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
| // With the VK_KHR_maintenance1 extension, you can specify negative viewport height. | |
| // This allows negative height to be specified in the height field to perform a | |
| // y-inversion of the clip-space to framebuffer-space transform. This allows you | |
| // to avoid having to use gl_Position.y = -gl_Position.y, and makes porting to other | |
| // APIs like DirectX12 much easier. | |
| // You negate the height *and* move the "origin" to the bottom left. | |
| // Unlike the original AMD extension which just negated height. | |
| VkViewport viewport = {}; |
NewerOlder