Skip to content

Instantly share code, notes, and snippets.

@ilyesAj
ilyesAj / Bedrock-api.json
Created August 28, 2025 13:05
Bedrock api postman collection
{
"info": {
"_postman_id": "a30303a4-d220-44ec-9abb-a2ba83ef54bf",
"name": "Amazon Bedrock API",
"description": "Amazon Bedrock is a fully managed service that offers a choice of high-performing foundation models (FMs) from leading AI companies like AI21 Labs, Anthropic, Cohere, Meta, Mistral AI, Stability AI, and Amazon through a single API, along with a broad set of capabilities you need to build generative AI applications with security, privacy, and responsible AI. Using Amazon Bedrock, you can easily experiment with and evaluate top FMs for your use case, privately customize them with your data using techniques such as fine-tuning and Retrieval Augmented Generation (RAG), and build agents that execute tasks using your enterprise systems and data sources. Since Amazon Bedrock is serverless, you don't have to manage any infrastructure, and you can securely integrate and deploy generative AI capabilities into your applications using the AWS services you are already familiar with.\n\nThe Amazon Bedrock
@ilyesAj
ilyesAj / busybox.yaml
Last active January 25, 2023 12:32
copy file into file storage StatS using CaaS
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: pv-mounter
spec:
selector:
matchLabels:
app: pv-mounter
template:
@ilyesAj
ilyesAj / awscli-cp-job-buffered.yaml
Last active August 24, 2022 13:07
a buffered version of s3 copy using kubernetes
apiVersion: v1
kind: Namespace
metadata:
name: s3-copy
---
apiVersion: batch/v1
kind: Job
metadata:
name: s3-copy-bucket-a
namespace: s3-copy
@ilyesAj
ilyesAj / awscli-cp-job.yaml
Created August 22, 2022 14:31
aws cp job kubernetes
apiVersion: v1
kind: Namespace
metadata:
name: s3-copy
---
apiVersion: batch/v1
kind: Job
metadata:
name: s3-bucket-a-sync
namespace: s3-copy
#!/bin/bash
# this script will allow you to append policy within a bucket
# you need to install jq awscli to use this script
[ $# != 1 ] && { echo "Usage: $0 \"bucket_name\""; exit 1; }
bucket="$1"
json_to_add="{\"Effect\":\"Allow\",\"Principal\":{\"AWS\":\"arn:aws:iam::ACCOUNT-B:user/s3-cross-account\"},\"Action\":[\"s3:ListBucket\",\"s3:GetObject\"],\"Resource\":[\"arn:aws:s3:::${bucket}\",\"arn:aws:s3:::${bucket}/*\"]}"
# get bucket policy
aws s3api get-bucket-policy --bucket ${bucket} --query Policy --output text > policy-${bucket}.json
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Principal": {
"AWS": "arn:aws:iam::Account-B:user/s3-cross-account"
},
"Action": [
"s3:GetObject",
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Principal": {
"AWS": "arn:aws:iam::ACCOUNT_B:user/s3-cross-account"
},
"Action": [
"s3:ListBucket",
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "ReadBucketA",
"Effect": "Allow",
"Action": [
"s3:ListBucket",
"s3:GetObject"
],
@ilyesAj
ilyesAj / gitlab-ci.yaml
Last active June 12, 2022 21:58
ci to to test runner autoscale
job:
parallel: 50
image: alpine:latest
script:
- echo "hello my friend"
- sleep 60
tags:
- k8s,ops
...
hpa:
minReplicas: 1
maxReplicas: 10
metrics:
- type: External
external:
metricName: gitlab_runner_jobs_builds_concurrent_saturation
targetAverageValue: 0.4