Skip to content

Instantly share code, notes, and snippets.

@langecrew
langecrew / OAI_CONFIG_LIST
Last active October 11, 2024 19:46
Taking the Autogen Teachable Agent one step further with some customization
[
{
"model": "gpt-4",
"api_key": "PASTE_YOUR_API_KEY_HERE"
},
{
"model": "gpt-4-1106-preview",
"api_key": "PASTE_YOUR_API_KEY_HERE"
},
{
@VishDev12
VishDev12 / general-cpu-provisioner.yaml
Created October 16, 2022 05:19
A Karpenter provisioner for general purpose workloads, with focus on cost control.
# The default provisioner used by Karpenter.
apiVersion: karpenter.sh/v1alpha5
kind: Provisioner
metadata:
name: general-cpu
spec:
# Terminate nodes x seconds after
# the last pod is removed from it.
ttlSecondsAfterEmpty: 30
@sgtoj
sgtoj / aws_sso.py
Last active October 2, 2024 14:22
AWS SSO Credentials File Updater for AWS SDKs
#!/usr/bin/env python3
import json
import os
import sys
from configparser import ConfigParser
from datetime import datetime
from pathlib import Path
import boto3
@jayers99
jayers99 / cloudtrailFun.sh
Last active October 9, 2019 21:41
AWS Cloudtrail AWS Cli with jq fun
aws cloudtrail lookup-events --profile dev --max-results 10 \
--lookup-attributes AttributeKey=EventName,AttributeValue=GetTrailStatus --query 'Events[*].CloudTrailEvent' | jq -r . | jq .
# events by some user
aws cloudtrail lookup-events --profile dev --max-results 50 \
--lookup-attributes AttributeKey=Username,AttributeValue=someUserName --query 'Events[*].CloudTrailEvent' | jq -r . | jq .eventName
# write events
aws cloudtrail lookup-events --profile dev --max-results 100 \
--lookup-attributes AttributeKey=ReadOnly,AttributeValue=false --query 'Events[*].CloudTrailEvent' | jq -r .
@phobson
phobson / js-d.ipynb
Created December 17, 2018 16:34
json-based dockside
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@devasat
devasat / aws-cli.sh
Last active June 9, 2024 04:18
AWS CLI Examples
# ********** EC2 ***********
# describe ec2 instances
aws ec2 describe-instances \
--query 'Reservations[*].Instances[*].[InstanceId,Tags[?Key==`Name`].Value|[0],State.Name,
PrivateIpAddress,PublicIpAddress]' \
--output table
# stopped instances
@nqbao
nqbao / ssm_parameter_store.py
Last active August 25, 2024 04:07
Python class to provide a dictionary-like interface to access AWS SSM Parameter Store easily
# Copyright (c) 2018 Bao Nguyen <[email protected]>
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in all
@mackwage
mackwage / windows_hardening.cmd
Last active October 28, 2025 19:25
Script to perform some hardening of Windows OS
:: Windows 10 Hardening Script
:: This is based mostly on my own personal research and testing. My objective is to secure/harden Windows 10 as much as possible while not impacting usability at all. (Think being able to run on this computer's of family members so secure them but not increase the chances of them having to call you to troubleshoot something related to it later on). References for virtually all settings can be found at the bottom. Just before the references section, you will always find several security settings commented out as they could lead to compatibility issues in common consumer setups but they're worth considering.
:: Obligatory 'views are my own'. :)
:: Thank you @jaredhaight for the Win Firewall config recommendations!
:: Thank you @ricardojba for the DLL Safe Order Search reg key!
:: Thank you @jessicaknotts for the help on testing Exploit Guard configs and checking privacy settings!
:: Best script I've found for Debloating Windows 10: https://github.com/Sycnex/Windows10Debloater
:
@ohze
ohze / install-docker-compose.sh
Last active May 11, 2021 15:32 — forked from lmakarov/install-docker-compose.sh
Install docker-compose in boot2docker 1.7.0+
#!/bin.sh
DOCKER_COMPOSE_VERSION=1.14.0
# Download docker-compose to the permanent storage
echo 'Downloading docker-compose to the permanent VM storage...'
sudo mkdir -p /var/lib/boot2docker/bin
sudo curl -sL https://github.com/docker/compose/releases/download/${DOCKER_COMPOSE_VERSION}/docker-compose-`uname -s`-`uname -m` -o /var/lib/boot2docker/bin/docker-compose
sudo chmod +x /var/lib/boot2docker/bin/docker-compose
sudo ln -sf /var/lib/boot2docker/bin/docker-compose /usr/local/bin/docker-compose
@ezeeetm
ezeeetm / blueGreenDeploy.ps1
Created December 18, 2015 14:01
blueGreenDeploy.ps1
<#
.SYNOPSIS
Command line utility for initiating blue-green deployments, to be called by a build step, or by another script, in a Jenkins job.
.PARAMETER region
Optional/has default value. Specifies the AWS region, e.g. 'us-east-1'. See script Param section for allowed values.
.PARAMETER environment
Required. Specifies a friendly name for the environment, e.g. 'dev'. See script Param section for allowed values.