Skip to content

Instantly share code, notes, and snippets.

View frkr's full-sized avatar
:octocat:
Fazendo a IA trabalhar pra mim

Davi frkr

:octocat:
Fazendo a IA trabalhar pra mim
View GitHub Profile
#!/usr/bin/env bash
set -euo pipefail
# ecr-update-alpine-images.sh
#
# This script:
# 1) Lists all AWS regions for the current account that have at least one ECR image.
# 2) Lists all ECR images (tagged) in each of those regions.
# 3) For each image, pulls it, checks if it is based on Alpine Linux, updates Alpine and all installed packages,
# then pushes the updated image to the same ECR repository with the "latest" tag.
#!/usr/bin/env bash
set -euo pipefail
# ecr-list-and-delete-repositories.sh
#
# This script:
# 1) Lists all AWS regions accessible to the current account
# 2) For each region, lists all ECR repositories
# 3) For each repository, displays all images with their tags and metadata
# 4) Asks user if they want to delete entire repositories (including all their images)
@frkr
frkr / mdx-preview.tsx
Created January 1, 2025 12:17
Client Markdown MDX
'use client';
import {useState, useEffect} from "react";
import {jsx, jsxs, Fragment} from "react/jsx-runtime";
import {evaluate} from "@mdx-js/mdx";
import type {FC, ReactNode} from "react";
// @ts-ignore
import type {MDXProps} from "mdx/types";
import type {EvaluateOptions} from "@mdx-js/mdx";
@frkr
frkr / docker-compose.yml
Last active September 13, 2024 02:34
N8N Swagger
version: "3.7"
services:
n8n:
image: docker.n8n.io/n8nio/n8n
restart: always
environment:
- N8N_HOST=auto.ideias.casa
- N8N_PORT=443
- N8N_PROTOCOL=https
@frkr
frkr / sendjson.ts
Created April 12, 2024 23:50
RClone check files and sendmail with SMTP
#!/usr/bin/env -S deno run --allow-net
console.log("rclone lsjson r2: --files-only --recursive | ./sendjson.ts");
import {readLines} from "https://deno.land/[email protected]/io/mod.ts";
import {SMTPClient} from "https://deno.land/x/denomailer/mod.ts";
const inputer = [];
for await (const l of readLines(Deno.stdin)) {
@frkr
frkr / denosh.ts
Created December 29, 2023 21:25
My Deno Shell Sample
#!/usr/bin/env -S deno run --allow-env --allow-net
// import { readAll } from "https://deno.land/[email protected]/io/util.ts";
//https://docs.deno.com/runtime/manual/basics/permissions#configurable-permissions
//https://docs.deno.com/runtime/manual/basics/testing/
const path = Deno.env.get("PATH");
console.log("Path:", path);
@frkr
frkr / MySQLPool.java
Created November 15, 2023 13:15
Mini Pool
public final class MySQLPool implements AutoCloseable {
private final HikariDataSource ds;
public MySQLPool(String user, String password, String url) {
HikariConfig config = new HikariConfig();
config.setJdbcUrl(url);
config.setUsername(user);
config.setPassword(password);
// config.addDataSourceProperty("cachePrepStmts", "true");
@frkr
frkr / worker.js
Created July 10, 2023 12:48
Cloudflare Worker for api-key Bearer
async function defFetch(request,env) {
const urlfinal = env.MOTOR + request.url.substring(request.url.indexOf("/",10)+1);
return fetch(
urlfinal,
{
headers: {
'Content-Type': 'application/json',
'Accept': 'application/json',
},
method: request.method,
@frkr
frkr / BROK.ts
Last active February 25, 2024 02:42
Cloudflare DurableObject Services
export const h12 = 12 * 60 * 60 * 1000;
export const h2 = 2 * 60 * 60 * 1000;
export const m15 = 15 * 60 * 1000;
export class UserDoc {
state: DurableObjectState;
constructor(state: DurableObjectState, env: Env) {
this.state = state;
@frkr
frkr / LearnGoIn5mins.md
Created May 10, 2023 15:37 — forked from prologic/LearnGoIn5mins.md
Learn Go in ~5mins