Skip to content

Instantly share code, notes, and snippets.

@thoroc
thoroc / README.md
Last active June 20, 2025 05:26
How to install Anbox in Fedora 30

source

Open a terminal and type the following commands:

sudo dnf install dkms
sudo dnf install kernel-devel
@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 / README.md
Last active May 15, 2025 13:49
Dockerizing all the things: Running Ansible inside Docker container

Automating things in software development is more than useful and using Ansible is one way to automate software provisioning, configuration management, and application deployment. Normally you would install Ansible to your control node just like any other application but an alternate strategy is to deploy Ansible inside a standalone Docker image. But why would you do that? This approach has benefits to i.a. operational processes.

Although Ansible does not require installation of any agents within managed nodes, the environment where Ansible is installed is not so simple to setup. In control node it requires specific Python libraries and their system dependencies. So instead of using package manager to install Ansible and it’s dependencies we just pull a Docker image.

By creating an Ansible Docker image you get the Ansible version you want and isolate all of the required dependencies from the host machine which potentially might break things in other area

@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

@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 / provider.py
Created April 29, 2022 14:54
Custom Faker Provider
# Based on the following:
# https://www.datainsightonline.com/post/how-to-generate-fake-dataset-with-python-faker-library
# https://deparkes.co.uk/2020/12/28/python-fake-data-with-faker/
from faker.providers import BaseProvider
from faker import Faker
import pandas as pd
from loguru import logger
fake = Faker("en_GB")
@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

/*--------------------------------------------------------------
/*! normalize.css v8.0.1
--------------------------------------------------------------*/
html {
line-height: 1.15;
-webkit-text-size-adjust: 100%;
scroll-behavior: smooth;
}
@thoroc
thoroc / list-duplicates.md
Last active November 18, 2024 10:09
[SQL] Find duplicates in a list of records