Skip to content

Instantly share code, notes, and snippets.

View harunhasdal's full-sized avatar

Harun Hasdal harunhasdal

View GitHub Profile
@harunhasdal
harunhasdal / set-aws-default-profile.sh
Created September 3, 2025 10:41
Set default aws profile configuration in `~/.aws/config` from a named profile. Usage: `./set-aws-default-profile.sh <profile_name>`
#!/bin/bash
echo "Updating default profile (~/.aws/config) with values from $1"
region=$(aws configure get $1.region)
credential_process=$(aws configure get $1.credential_process)
aws configure set default.region "$region"
aws configure set default.credential_process "$credential_process"
@harunhasdal
harunhasdal / setup-claude-code-mcp-servers.sh
Last active July 28, 2025 10:56
set up claude-code MCP servers
claude mcp add strands -s local "uvx" "strands-agents-mcp-server"
claude mcp add aws-api -s user -e AWS_REGION="us-west-2" "uvx" "awslabs.aws-api-mcp-server@latest"
claude mcp add aws-documentation -s project -e FASTMCP_LOG_LEVEL="ERROR" -e AWS_DOCUMENTATION_PARTITION="aws" "uvx" "awslabs.aws-documentation-mcp-server@latest"
@harunhasdal
harunhasdal / clone-subfolder.sh
Created July 17, 2025 13:49
Clone and checkout only a subfolder in a github repository
REPO_URL="github url"
REPO_NAME="local folder name defaults to repo name"
SUBFOLDER_PATH_NO_LEADING_SLASH="path to the folder with no leading slash, but ending with a slash"
git clone --depth 1 --no-checkout $REPO_URL
cd $REPO_NAME
git sparse-checkout set $SUBFOLDER_PATH_NO_LEADING_SLASH
@harunhasdal
harunhasdal / .vimrc
Created December 13, 2024 02:01
Good default for `.vimrc` to configure VIM with some visual consistency
" Show line numbers
set number
" Load plugins and indent according to detected file type
filetype on
filetype plugin on
filetype indent on
" Turn on syntax highlighting
syntax on
@harunhasdal
harunhasdal / getFavicon.js
Created July 28, 2014 12:19
Download favicon.ico from a website using NodeJS
var request = require("request");
var fs = require("fs");
request("https://github.com/favicon.ico").pipe(fs.createWriteStream('favicon.ico'));