Skip to content

Instantly share code, notes, and snippets.

View ryanjafari's full-sized avatar
🏠
Working from home

Ryan Jafari ryanjafari

🏠
Working from home
View GitHub Profile
@ryanjafari
ryanjafari / path.js
Created October 26, 2023 19:54
ast-types mod
"use strict";;
Object.defineProperty(exports, "__esModule", { value: true });
var tslib_1 = require("tslib");
var types_1 = tslib_1.__importDefault(require("./types"));
var Op = Object.prototype;
var hasOwn = Op.hasOwnProperty;
function pathPlugin(fork) {
var types = fork.use(types_1.default);
var isArray = types.builtInTypes.array;
var isNumber = types.builtInTypes.number;
@ryanjafari
ryanjafari / [projectSlug].jsx
Created September 22, 2023 20:01
Loading images from static imports or from filesystem for use with Next.js Image element
import Head from 'next/head'
import Image from 'next/image'
import { useCallback, useEffect, useState } from 'react'
import { Button } from '@/components/Button'
import { Modal } from '@/components/Modal'
import { SimpleLayout } from '@/components/SimpleLayout'
import screenEdivv1 from '@/images/screens/edivv/1-edivv-home-page.png'
import screenEdivv2 from '@/images/screens/edivv/2-edivv-featured-items.png'
{
// Place your k8s workspace snippets here. Each snippet is defined under a snippet name and has a scope, prefix, body and
// description. Add comma separated ids of the languages where the snippet is applicable in the scope field. If scope
// is left empty or omitted, the snippet gets applied to all languages. The prefix is what is
// used to trigger the snippet and the body will be expanded and inserted. Possible variables are:
// $1, $2 for tab stops, $0 for the final cursor position, and ${1:label}, ${2:another} for placeholders.
// Placeholders with the same ids are connected.
// Example:
// "Print to console": {
// "scope": "javascript,typescript",
I0601 16:36:14.305510 5554 loader.go:372] Config loaded from file: /Users/rjafari/.kube/config
I0601 16:36:14.306143 5554 round_trippers.go:466] curl -v -XGET -H "Accept: application/com.github.proto-openapi.spec.v2@v1.0+protobuf" -H "User-Agent: kubectl/v1.24.1 (darwin/arm64) kubernetes/3ddd0f4" 'https://talos.k8s:6443/openapi/v2?timeout=32s'
I0601 16:36:14.317303 5554 round_trippers.go:495] HTTP Trace: DNS Lookup for talos.k8s resolved to [{10.214.147.200 }]
I0601 16:36:14.319957 5554 round_trippers.go:510] HTTP Trace: Dial to tcp:10.214.147.200:6443 succeed
I0601 16:36:14.329235 5554 round_trippers.go:553] GET https://talos.k8s:6443/openapi/v2?timeout=32s 200 OK in 23 milliseconds
I0601 16:36:14.329281 5554 round_trippers.go:570] HTTP Statistics: DNSLookup 5 ms Dial 2 ms TLSHandshake 5 ms ServerProcessing 3 ms Duration 23 ms
I0601 16:36:14.329291 5554 round_trippers.go:577] Response Headers:
I0601 16:36:14.329300 5554 round_trippers.go:580] Content-Type: application/octet-stre
# Configuration file for dnsmasq.
#
# Format is one option per line, legal options are the same
# as the long options legal on the command line. See
# "/usr/sbin/dnsmasq --help" or "man 8 dnsmasq" for details.
# Listen on this specific port instead of the standard DNS port
# (53). Setting this to zero completely disables DNS function,
# leaving only DHCP and/or TFTP.
#port=5353
Usage: dnsmasq [options]
Valid options are:
-a, --listen-address=<ipaddr> Specify local address(es) to listen on.
-A, --address=/<domain>/<ipaddr> Return ipaddr for all hosts in specified domains.
-b, --bogus-priv Fake reverse lookups for RFC1918 private address ranges.
-B, --bogus-nxdomain=<ipaddr> Treat ipaddr as NXDOMAIN (defeats Verisign wildcard).
-c, --cache-size=<integer> Specify the size of the cache in entries (defaults to 150).
-C, --conf-file=<path> Specify configuration file (defaults to /etc/dnsmasq.conf).
-d, --no-daemon Do NOT fork into the background: run in debug mode.
kubectl describe issuer letsencrypt-staging
kubectl get certificate
kubectl describe certificate quickstart-example-tls
kubectl describe secret quickstart-example-tls
kubectl describe certificate
kubectl describe order quickstart-example-tls-889745041
kubectl describe challenge quickstart-example-tls-889745041-0
curl -kivL -H 'Host: example.your-domain.com' 'http://35.199.164.14'
if ($yaml.machine | empty?) {
echo 'yaml is empty'
} {
if ($yaml.machine.network | empty?) {
echo 'network is empty'
} {
echo 'network is not empty'
}
}
#!/bin/sh
AUTHORIZED_KEYS=/root/.ssh/authorized_keys
KEYS_RC=-1
COUNT=0
while [ ${KEYS_RC} -ne 0 ] && [ ${COUNT} -lt 60 ]
do
KEYS_DATA=$(podman exec unifi-os mongo --port 27117 --eval 'db.setting.find({key: {$eq: "mgmt"}}, {x_ssh_keys: 1, _id: 0});' --quiet ace)
KEYS_RC=$?