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
#!/bin/bash | |
set -e | |
echo "[Startup] Measuring host compute power..." | |
# CPU Test | |
START=$(date +%s%N) | |
for i in {1..100000}; do echo "$i" | sha256sum > /dev/null; done | |
END=$(date +%s%N) | |
CPU_MS=$(( (END - START) / 1000000 )) |
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
import ssl | |
import socket | |
import requests | |
from urllib.parse import urljoin | |
from cryptography import x509 | |
from cryptography.hazmat.backends import default_backend | |
from bs4 import BeautifulSoup | |
import hashlib | |
def fetch_ssl_chain(domain, port=443): |
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
#!/bin/bash | |
set -e | |
MAVEN_VERSION=3.9.6 | |
MAVEN_DIR="$HOME/.maven/apache-maven-$MAVEN_VERSION" | |
MAVEN_BIN="$MAVEN_DIR/bin/mvn" | |
echo "=== Checking Java ===" | |
if ! command -v java >/dev/null 2>&1; then |
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
-- Create a temporary table with a JSON column for grouping variables. | |
CREATE TEMP TABLE temp_counts ( | |
group_vars json, -- holds grouping variables (e.g., calc_date, formatted_date, etc.) | |
count_result integer | |
) ON COMMIT DROP; | |
DO $$ | |
DECLARE | |
begin_date date := '2023-01-01'; -- Replace with your desired begin date. | |
end_date date := '2023-01-10'; -- Replace with your desired end date. |
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
using k8s; | |
using k8s.Models; | |
using Newtonsoft.Json; | |
using System.Collections.Generic; | |
namespace OpenShiftModels | |
{ | |
public class Route : IKubernetesObject<V1ObjectMeta>, ISpec<RouteSpec> | |
{ | |
[JsonProperty("apiVersion")] |
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
import tkinter as tk | |
from tkinter import filedialog, messagebox | |
import simplekml | |
def add_coordinate(): | |
if len(coordinates) < 10: | |
lat = lat_entry.get() | |
lon = lon_entry.get() | |
diameter = diameter_entry.get() |
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
import psycopg2 | |
import pandas as pd | |
from psycopg2 import sql | |
from concurrent.futures import ThreadPoolExecutor, as_completed | |
import threading | |
# Database connection details | |
DB_CONFIG = { | |
"host": "localhost", | |
"dbname": "your_database", |
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
using System; | |
using System.Collections.Concurrent; | |
using System.IO; | |
using System.Text; | |
using System.Threading; | |
using System.Threading.Tasks; | |
using Microsoft.Extensions.Hosting; | |
using Microsoft.Extensions.Logging; | |
public class KubernetesPodLogFileWriterService : IHostedService, IDisposable |
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
using System; | |
using System.Collections.Concurrent; | |
using System.Threading; | |
using System.Threading.Tasks; | |
using k8s; | |
using k8s.Models; | |
using Microsoft.Extensions.Hosting; | |
using Microsoft.Extensions.Logging; | |
public class KubernetesPodWatcherService : BackgroundService |
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
services.AddAuthentication(options => | |
{ | |
options.DefaultAuthenticateScheme = CookieAuthenticationDefaults.AuthenticationScheme; | |
options.DefaultSignInScheme = CookieAuthenticationDefaults.AuthenticationScheme; | |
options.DefaultChallengeScheme = OpenIdConnectDefaults.AuthenticationScheme; | |
}) | |
.AddCookie() | |
.AddOpenIdConnect(options => | |
{ | |
options.Authority = "https://<openshift-auth-server>"; |
NewerOlder