Skip to content

Instantly share code, notes, and snippets.

View lkrimphove's full-sized avatar

Lukas Krimphove lkrimphove

View GitHub Profile
@lkrimphove
lkrimphove / auto-setup-windows.ps1
Last active June 7, 2024 06:44
Uses winget to quickly setup new computers
param (
[string]$PackageListSource
)
function Get-PackageList {
param (
[string]$Source
)
if ($Source -match "^https?:\/\/") {
### CLOUDFRONT
module "cloudfront" {
source = "terraform-aws-modules/cloudfront/aws"
comment = "Outdoor Activities Cloudfront"
is_ipv6_enabled = true
price_class = "PriceClass_100"
wait_for_deployment = false
create_origin_access_identity = true
### LAMBDA
module "lambda_function" {
source = "terraform-aws-modules/lambda/aws"
function_name = "outdoor-activities-generator"
description = "Generates a map containing your outdoor activities"
handler = "main.lambda_handler"
runtime = "python3.11"
timeout = 60
data "http" "mime_types" {
url = "https://gist.githubusercontent.com/lkrimphove/46988dc2ac63ad5ad9c95e6109e3c37e/raw/2349abeb136f1f8dbe91c661c928a5ce859432f9/mime.json"
request_headers = {
Accept = "application/json"
}
}
locals {
mime_types = jsondecode(data.http.mime_types.response_body)
}
### CREATE MAP
import folium
from folium import plugins as folium_plugins
if LOCATION:
location = LOCATION
else:
location=[df.Latitude.mean(), df.Longitude.mean()]
### CONFIG
# LOCATION = None
LOCATION = [48.13743, 11.57549] # latitude, longitude
ZOOM_START = 10
ACTIVITY_TYPES = {
'Hiking': {
'icon': 'person-hiking',
'color': 'green'
@lkrimphove
lkrimphove / mime.json
Last active May 8, 2023 08:46
File extension to mime type map
{
"123": "application/vnd.lotus-1-2-3",
"1km": "application/vnd.1000minds.decision-model+xml",
"3dml": "text/vnd.in3d.3dml",
"3ds": "image/x-3ds",
"3g2": "video/3gpp2",
"3gp": "video/3gpp",
"3gpp": "video/3gpp",
"3mf": "model/3mf",
"7z": "application/x-7z-compressed",
@lkrimphove
lkrimphove / parse_obsidian_links.py
Created April 13, 2023 10:20
Pre-commit hook that parses Obsidian.md links to regular Markdown links
@lkrimphove
lkrimphove / aws-resource-monitor.py
Created March 30, 2023 06:37
a Lambda function for monitoring your AWS resources
import os
import json
import logging
from dataclasses import dataclass
from datetime import datetime
from typing import Any
import requests
import boto3
@lkrimphove
lkrimphove / deploy.yml
Created February 23, 2023 21:00
gist-sync
on: [push]
jobs:
gist-sync:
name: gist-sync
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- uses: popsiclestick/gist-sync-action@v1.2.0