Ünö dî Nöi

Nobody Knows

Make Pi-hole accept DNS requests coming from Tailscale

In Pi-hole go to:

Settings → DNS → Interface settings

Pi-hole normally restricts which interfaces or source networks it answers. Tailscale traffic arrives through the tailscale0 interface, so the default local-only mode can reject it. Pi-hole Documentation

For a first test, select:

Permit all origins

or in recent Pi-hole versions: sudo pihole-FTL --config dns.listeningMode "ALL"

Then: sudo systemctl restart pihole-FTL

This setting is safe only if port 53 is not exposed to the public Internet. Your router should not forward TCP/UDP 53 to the Raspberry Pi. Pi-hole itself warns that ALL can otherwise create an open DNS resolver. Pi-hole Documentation

A more restrictive configuration can be done later.

3. Verify Pi-hole is listening on DNS port 53

On the Pi: sudo ss -lunpt | grep ':53'

You should see Pi-hole listening on port 53, for example: udp UNCONN 0 0 0.0.0.0:53 tcp LISTEN 0 32 0.0.0.0:53

Then find your Tailscale IP again: tailscale ip -4

Suppose it is: 100.88.12.34

4. Configure Tailscale DNS

Open:

Tailscale Admin Console → DNS

Under Nameservers:

Add nameserver → Custom

Enter: 100.88.12.34

Then enable:

Override DNS servers

This is important. It tells tailnet clients to use Pi-hole instead of whatever DNS their current Wi-Fi/mobile network supplies. Tailscale

So your Tailscale DNS page should effectively contain: Nameservers

100.88.12.34 Global nameserver

Override DNS servers: ON

You can leave MagicDNS enabled. MagicDNS and your Pi-hole nameserver can coexist; MagicDNS handles tailnet machine names while your configured nameserver handles normal DNS lookups. Tailscale

5. Check the iPhone Tailscale setting

On the iPhone:

Tailscale → Settings

Make sure:

Use Tailscale DNS settings is enabled.

The exact wording can vary slightly by Tailscale version.

Do not manually configure the iPhone Wi-Fi DNS to 100.88.12.34.

Let Tailscale install its VPN DNS configuration. This is what makes it work on: Home Wi-Fi Other Wi-Fi 4G / 5G hotspots

Tailscale explicitly requires clients to accept the tailnet DNS configuration for the DNS settings configured in the admin console to take effect. Tailscale

6. Test from the iPhone

Disconnect the iPhone from your home Wi-Fi and use 4G/5G. Keep Tailscale connected.

Open Safari and visit several websites.

On the Raspberry Pi run: sudo tcpdump -ni tailscale0 port 53

Then browse on the iPhone.

You should see packets similar to: 100.70.23.14.54321 > 100.88.12.34.53

If you see them, Tailscale routing is working and any remaining problem is Pi-hole configuration.

If you see nothing, the problem is on the Tailscale/iPhone DNS side.

Internet │ │ Upstream DNS e.g. Cloudflare │ ▼ ┌──────────────┐ │ Pi-hole │ │ Raspberry Pi │ │ 100.x.x.x │ └──────▲───────┘ │ DNS :53 Tailscale tunnel │ ┌───────────┴───────────┐ │ │ iPhone Laptop Tailscale Tailscale

In Tailscale: MagicDNS ON Global nameserver Pi-hole 100.x.x.x Override DNS ON

In Pi-hole initially: DNS listening mode ALL


How to use SSH Key

To create a list of servers with easy access, create or edit

Host dev-box
    HostName 192.168.1.50
    User admin
    Port 22 

To connect: Just type go ssh dev-box

To create and use an SSH Key

Generate your key: go ssh-keygen Copy the key to your server (you'll type the password one last time here): go ssh-copy-id dev-box



How to fix broken WiFi after a kernel update on MacBook Pro late 2012

Install the proprietary Broadcom STA driver

sudo apt update
sudo apt install broadcom-sta-dkms

Confirm the correct kernel headers and build tools

sudo apt install linux-headers-$(uname -r) build-essential dkms

Force a DKMS rebuild in case the kernel upgrade broke it

sudo dkms autoinstall

Load the correct driver

sudo modprobe wl

Check:

lsmod | grep wl
lsmod | grep -E 'wl|brcm|bcma'
dmesg | grep -i wl



Working with GitHub from Linux CLI

This guide shows how to create and manage a GitHub repository entirely from the Linux command line.


1. Setup Git

sudo apt update
sudo apt install git

Configure your identity (used for commits):

git config --global user.name "Your Name"
git config --global user.email "your.email@example.com"

Check configuration:

git config --list

ssh-keygen -t ed25519 -C "your.email@example.com"

Copy the public key:

cat ~/.ssh/id_ed25519.pub

Add it to GitHub under Settings → SSH and GPG keys → New SSH key.

Test connection:

ssh -T git@github.com

3. Create a Local Repository

mkdir my-project
cd my-project
git init

This creates a new Git repository in the folder.

Add a file and commit it:

echo "# My Project" > README.md
git add README.md
git commit -m "Initial commit"

4. Create a GitHub Repository from CLI

Using HTTPS (if SSH not configured)

Go to https://github.com/new and create an empty repository manually.

Then connect it:

git remote add origin https://github.com/username/my-project.git

Using SSH (preferred)

git remote add origin git@github.com:username/my-project.git

Push the local repo to GitHub:

git branch -M main
git push -u origin main

5. Making Changes and Updating the Repository

Edit files as needed, then:

git status
git add .
git commit -m "Describe changes"
git push

To pull updates from GitHub:

git pull

6. Cloning Existing Repositories

git clone https://github.com/username/repository.git
# or
git clone git@github.com:username/repository.git

7. Branching

Create and switch to a new branch:

git checkout -b feature-branch

Push a new branch to GitHub:

git push -u origin feature-branch

Merge back to main:

git checkout main
git merge feature-branch
git push

Summary

  • git init → Create a repo
  • git add / commit → Stage and save changes
  • git remote add origin → Link to GitHub
  • git push / pull → Sync changes
  • git branch / merge → Manage versions


World population from 10.000 BCE to now

One of the most amazing datasets

from ourworldindata.org

When I was born in 1966, the world population was 3.4 billion; now it is more than double that.



Coding Microbit in C++ with Debian 12

First, we need to set the environment: 1. Installing Yotta and '''srecord''' (this is needed to create .hex)

sudo apt install yotta srecord
  1. Clone example git clone https://github.com/lancaster-university/microbit-samples cd microbit-samples
  2. Setup the target for building yotta target bbc-microbit-classic-gcc-nosd@https://github.com/lancaster-university/yotta-target-bbc-microbit-classic-gcc
  3. Build example yotta build 5.Copy .hex to Microbit folder cp ./build/bbc-microbit-classic-gcc/source/microbit-samples-combined.hex /media/"user"/MICROBIT

Reference: Reference


Spring

How to find the center of a circle

Install rclone

sudo -v ; curl https://rclone.org/install.sh | sudo bash This is needed because Debian 12 install rclone too old, without ProtonDrive support

Configure rclone

rclone config Chose ProtonDrive and add user and password

Install restic

sudo apt install restic

Inizialize restic repository

restic init -r rclone:[nameof remote rclone]:[dir in ProtonDrive]

Backup a folder

restic -r rclone:[nameof remote rclone]:[dir in ProtonDrive] backup [dir to backup] --compression auto --verbose --exclude-file=[file name] Where: * [nameof remote rclone] –> name of remote set in during rclone config * [dir in ProtonDrive] –> directory in ProtonDrive where to save the backup * [file name] –> a text filename with in the list of dir and files to exclude from backup