Skip to content

Instantly share code, notes, and snippets.

@thoroc
thoroc / README.md
Last active May 30, 2025 04:49
Docker in Incus is Awesome - The “Get my” application (Aug 2024)

Deploying the “Get my” Application with Incus OCI Containers

Overview

This guide explains how to deploy the Get my application using Incus with the new OCI container support introduced in Incus 6.3.
Get my is a lightweight web application for managing shared family task and shopping lists, created by Brian (Open Source Advocate).

For users new to Incus, refer to the introductory tutorial:

@thoroc
thoroc / README.md
Last active May 28, 2025 07:40
Self-Hosted DNS Server - Installing AdGuard Home + Unbound

Self-Hosted DNS Server - Installing AdGuard Home + Unbound

Introduction

This guide shows you how to set up a self-hosted local and secure DNS server using:

  • AdGuard Home as main DNS server with ad filter and control panel.
  • Unbound as a recursive DNS resolver, directly querying the internet root servers.
  • Docker Compose for simple and efficient orchestration.
  • Features and Benefits
@thoroc
thoroc / select_aws_profile.sh
Created April 4, 2025 14:33
Shell function to select an AWS profile when using Leapp
select_aws_profile () {
local profiles=($(leapp session list --output=json | jq -r '[.[] | select(.status=="active")] | .[].profileId'))
if [[ ${#profiles[@]} -eq 0 ]]
then
unset AWS_PROFILE
echo "AWS_PROFILE unset as there are no profiles"
elif [[ ${#profiles[@]} -eq 1 ]]
then
export AWS_PROFILE="${profiles}"
echo "AWS_PROFILE set to ${profiles}"
@thoroc
thoroc / README.md
Last active April 9, 2025 08:23
How I scraped 2.1 million jobs (including 5,335 data science jobs)

How I scraped 2.1 million jobs (including 5,335 data science jobs)

original: https://www.reddit.com/r/datascience/comments/1iynyco/how_i_scraped_21_million_jobs_including_5335_data/

Background

During my PhD in Data Science at Stanford, I got sick and tired of ghost jobs & 3rd party offshore agencies on LinkedIn & Indeed. So I wrote a script that fetches jobs from 30k+ company websites' career pages and uses GPT4o-mini to extract relevant information (ex salary, remote, etc.) from job descriptions. You can use it here: (HiringCafe). Here is a filter for Data science jobs

/*--------------------------------------------------------------
/*! normalize.css v8.0.1
--------------------------------------------------------------*/
html {
line-height: 1.15;
-webkit-text-size-adjust: 100%;
scroll-behavior: smooth;
}
@thoroc
thoroc / GIT_MIRROR.md
Last active February 12, 2025 11:48
Git clone script in Deno/Typescript

git-mirror

This was now moved to: https://github.com/thoroc/git-mirror

Deno script to clone a github/gitlab repo to ~/Projects while keeping a tree structure close to the remote url. If the project is already present, then it'll fetch from the remote.

WARNING this was developed on a MacOS, so no guaranty are offered to run on a different OS.

install

@thoroc
thoroc / README.md
Created October 9, 2024 18:32
Removel sophos AV from MacOS

Remove sophos keychain

sudo rm /Library/"Sophos Anti-Virus"/SophosSecure.keychain

Disable sophos

sudo defaults write /Library/Preferences/com.sophos.sav TamperProtectionEnabled -bool false
@thoroc
thoroc / put-event.json
Created October 7, 2024 16:50
Attempting to setup eventbridge rule to send logs to cloudwatch
[
{
"Source": "my.application",
"DetailType": "TestEvent",
"Detail": "{\"message\": \"Hello World\"}",
"EventBusName": "default"
},
{
"Source": "my.application",
"DetailType": "MyAppEvent",
@thoroc
thoroc / git-checkout-repo.sh
Created October 1, 2024 08:04
Git checkout repository, reproducing the path of the origin locally
#!/bin/bash
# put an alias in your .gitconfig to where the script lives: co-repo = ~/.bin/git-checkout-repo.sh
# don't forget to `chmod +x` it
# Input Git repository URL
REPO_URL="$1"
# Define the target base directory (where all projects should reside)
TARGET_BASE_DIR=~/Projects
@thoroc
thoroc / README.md
Last active April 16, 2024 10:14
Api Gateway with CDK (Python)

Api Gateway with CDK

source: https://www.sccbrasil.com/blog/aws/cdk-api.html

By Wolfgang Unger

Lets have a look how to create a API Gateway with CDK (Python) The first approach is using the RestApi Class and code the resources and methods. The second by using a Swagger/Open API file. Both APIs will use lambda integrations.