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
data=`echo | openssl s_client -servername $1 -connect $1:443 2>/dev/null | openssl x509 -noout -enddate | sed -e 's#notAfter=##'` | |
ssldate=`date -d "${data}" '+%s'` | |
nowdate=`date '+%s'` | |
diff="$((${ssldate}-${nowdate}))" | |
echo $((${diff}/86400)) |
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
#what is the value Pp1d4 in the repos at https://github.com/Sean-Bradley/ECDSA_secp256k1_JordonMatrix_nodejs | |
#it's used to get the modular cubed root | |
#I want to find y in equation y² = x³ + 7 in a finite field P | |
P = 0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f | |
Pp1d4 = 0x3fffffffffffffffffffffffffffffffffffffffffffffffffffffffbfffff0c | |
#Pp1d4 = P plus 1 divided by 4 | |
#getting cubed root in a finite field | |
print(pow(16, Pp1d4, P)) # = 4 |
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
import * as THREE from 'three' | |
import { OrbitControls } from 'three/examples/jsm/controls/OrbitControls' | |
import Stats from 'three/examples/jsm/libs/stats.module' | |
import { GUI } from 'three/examples/jsm/libs/dat.gui.module' | |
const scene = new THREE.Scene() | |
const camera = new THREE.PerspectiveCamera(75, window.innerWidth / window.innerHeight, 0.1, 100) | |
camera.position.z = 2 |
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
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="utf-8"> | |
<title>Three.js Tutorials by Sean Bradley : https://sbcode.net/threejs/</title> | |
<meta name="viewport" content="width=device-width, initial-scale=1"> | |
<style> | |
body { | |
overflow: hidden; |
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
[Unit] | |
Description=Promtail service | |
After=network.target | |
[Service] | |
Type=simple | |
User=promtail | |
ExecStart=/usr/local/bin/promtail -config.file /usr/local/bin/config-promtail.yml | |
[Install] |
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
server: | |
http_listen_port: 9080 | |
grpc_listen_port: 0 | |
positions: | |
filename: /tmp/positions.yaml | |
clients: | |
- url: http://127.0.0.1:3100/loki/api/v1/push |
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
[Unit] | |
Description=Loki service | |
After=network.target | |
[Service] | |
Type=simple | |
User=loki | |
ExecStart=/usr/local/bin/loki -config.file /usr/local/bin/config-loki.yml | |
[Install] |
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
auth_enabled: false | |
server: | |
http_listen_port: 3100 | |
ingester: | |
lifecycler: | |
address: 127.0.0.1 | |
ring: | |
kvstore: |
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
"""Chain of Responsibility Pattern | |
Chain of responsibility pattern is a behavioural pattern used to achieve loose coupling | |
in software design. | |
In this example, a request from a client is passed to a chain of objects to process them. | |
The objects in the chain will decide how to process them and/or pas them to the next in the chain. | |
The objects can also modify the next in the chain if for example you wanted to run objects in a recursive manner. | |
""" | |
from abc import ABCMeta, abstractstaticmethod |
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
"""The Command Design Pattern in Python | |
The command pattern is a behavioural design pattern, in which an abstraction | |
exists between an object that invokes a command, and the object that performs it. | |
This is part 2 of the Command Design Pattern tutorial, | |
where I create a slider, instead of the switch from part 1. | |
The slider also accepts a variable percentage, rather than an ON/OFF | |
The history also records the variable settingg | |
And I also add UNDO/REDO to the Invoker so that you can go backawards and forwards through time |
NewerOlder