Skip to content

Instantly share code, notes, and snippets.

View 3r1co's full-sized avatar

Eric Muellenbach 3r1co

View GitHub Profile
// Please find the full, tested version in
// https://github.com/influxdata/influxdb_iox/blob/fe155e15fb2ad166aee66b0458e63c24a8128dd4/query/src/exec/task.rs#L101-L118
pub struct DedicatedExecutor {
state: Arc<Mutex<State>>,
}
/// Runs futures (and any `tasks` that are `tokio::task::spawned` by
/// them) on a separate Tokio Executor
struct State {
@jeremychone
jeremychone / rust-xp-01-s3.rs
Last active October 11, 2024 13:18
Rust Quick Example to connect to S3 and Minio bucket server
#![allow(unused)] // silence unused warnings while exploring (to comment out)
use std::{error::Error, str};
use s3::bucket::Bucket;
use s3::creds::Credentials;
use s3::region::Region;
use s3::BucketConfiguration;
// Youtube Walkthrough - https://youtu.be/uQKBW8ZgYB8
@fardjad
fardjad / minikube-on-wsl2-with-podman.md
Last active June 3, 2024 13:48
[Minikube on WSL2 with Podman] Tips for running a local development Kubernetes cluster on WSL2 with Podman #wsl2 #minikube #podman #kubernetes #docker
# eks.yml
on:
pull_request:
push:
branches: # array of glob patterns matching against refs/heads. Optional; defaults to all
- master # triggers on pushes that contain changes in master
name: Build and Deploy to EKS
env:
@turtlemonvh
turtlemonvh / aws_prices.md
Created July 26, 2019 16:58
AWS disk cost analysis: EBS vs instance storage
@outofcoffee
outofcoffee / find-ecr-image.sh
Last active March 1, 2024 13:35
Check if Docker image exists with tag in AWS ECR
#!/usr/bin/env bash
# Example:
# ./find-ecr-image.sh foo/bar mytag
if [[ $# -lt 2 ]]; then
echo "Usage: $( basename $0 ) <repository-name> <image-tag>"
exit 1
fi
IMAGE_META="$( aws ecr describe-images --repository-name=$1 --image-ids=imageTag=$2 2> /dev/null )"
@hallazzang
hallazzang / README.md
Last active August 8, 2022 09:19
Example of how to implement throttling in Asyncio/Aiohttp

Example of how to implement throttling in Asyncio/Aiohttp

This gist consists of 4 files:

throttler.py - Throttler class implementation
asyncio_throttling_example.py - Throttling general coroutines
aiohttp_throttling_example_client.py - Throttling aiohttp requests
aiohttp_throttling_example_server.py - Web server for testing aiohttp_throttling_example_client.py
@khardix
khardix / download.py
Created October 6, 2017 11:26
Python AsyncIO/aiohttp downloader with progressbars
#!/usr/bin/env python3.6
import asyncio
from contextlib import closing
import aiohttp
import tqdm
async def download(session, url, progress_queue):
@nblair
nblair / nexus-repo-manager-privilege-example.groovy
Last active November 13, 2023 17:54
A groovy script to create Content Selectors, privileges, and roles programmatically via the Nexus Repository Manager 3 Scripting API.
import org.sonatype.nexus.common.entity.*
import org.sonatype.nexus.security.*
import org.sonatype.nexus.security.authz.*
import org.sonatype.nexus.selector.*
import com.google.common.collect.ImmutableMap
// use container.lookup to fetch internal APIs we need to use
def selectorManager = container.lookup(SelectorManager.class.name)
def securitySystem = container.lookup(SecuritySystem.class.name)
@PaulSec
PaulSec / aws_scan.py
Created May 10, 2017 08:05
Quick script to scan for AWS (S3 Buckets) and retrieves bunch of info out of it
import subprocess
import argparse
import re
import sys
import requests
def do_dig(domain):
command = "dig {} | grep IN".format(domain)
try:
output = subprocess.check_output(command, shell=True, stdin=subprocess.PIPE, stderr=subprocess.STDOUT)