Skip to content

Instantly share code, notes, and snippets.

View mzaglia's full-sized avatar

Matheus C. Zaglia mzaglia

  • Geopixel
  • São José dos Campos, SP - Brazil
View GitHub Profile
@mzaglia
mzaglia / SETUP_FIGMA_MCP_WSL.md
Created May 25, 2026 19:50 — forked from QuentinFrc/SETUP_FIGMA_MCP_WSL.md
Setup Figma MCP (Windows | WSL2)

MCP Figma Configuration with WSL2

This guide explains how to configure the MCP Figma server running on Windows to be accessible from Claude Code in WSL2.

Problem

The MCP Figma server runs on Windows at 127.0.0.1:3845, but Claude Code in WSL2 cannot access it directly because 127.0.0.1 in WSL refers to WSL's localhost, not Windows' localhost.

Solution

@mzaglia
mzaglia / create_folder_existing_user
Last active April 22, 2026 17:27
Create folder for existing user in linux
sudo cp -ar /etc/skel/. /home/$USER && sudo chown $USER:$USER /home/$USER && sudo chmod 700 /home/$USER
@mzaglia
mzaglia / GdalJava.md
Created April 24, 2024 12:24
GDAL 3.5.3 with Java Bindings

Download and compile GDAL

apt-get install -y build-essential wget cmake swig ant libgeos-dev libproj-dev proj-data proj-bin swig libkml-dev libxml2-dev libsqlite3-dev libspatialite-dev openjdk-8-jdk
# clone gdal
wget -N https://github.com/OSGeo/gdal/releases/download/v3.5.3/gdal-3.5.3.tar.gz
tar -xzf gdal-3.5.3.tar.gz
cd gdal-3.5.3
mkdir build && cd build
cmake .. -DBUILD_JAVA_BINDINGS=ON -DBUILD_PYTHON_BINDINGS=OFF -DCMAKE_INSTALL_PREFIX=/usr
cmake --build . --target install -- -j8
@mzaglia
mzaglia / autoYoutubeTheater.md
Last active April 1, 2024 13:26
Youtube auto theater mode

Open devtools and paste the following in the console:

document.cookie = 'wide=1; expires='+new Date('3099').toUTCString()+'; path=/';
@mzaglia
mzaglia / portainer.conf
Created June 6, 2022 20:33
Portainer subpath NGINX
upstream portainer {
server 127.0.0.1:9000;
}
server {
listen 80;
location /portainer/ {
proxy_http_version 1.1;
proxy_set_header Connection "";
@mzaglia
mzaglia / wsl2_no_internet.ps1
Created May 1, 2021 13:42
WSL2 No internet
echo "Restarting WSL Service"
Restart-Service LxssManager
echo "Restarting Host Network Service"
Stop-Service -name "hns"
Start-Service -name "hns"
echo "Restarting Hyper-V adapters"
Get-NetAdapter -IncludeHidden | Where-Object `
{$_.InterfaceDescription.StartsWith('Hyper-V Virtual Switch Extension Adapter')} `
| Disable-NetAdapter -Confirm:$False
Get-NetAdapter -IncludeHidden | Where-Object `
@mzaglia
mzaglia / hyper-v-static-ip.md
Last active September 28, 2025 16:14
Static IP Hyper-V Ubuntu VM

First in a powershell create a new network switch

New-VMSwitch -SwitchName "SwitchName" -SwitchType Internal
Get-NetAdapter       // (note down ifIndex of the newly created switch as INDEX)
New-NetIPAddress -IPAddress 192.168.0.1 -PrefixLength 24 -InterfaceIndex <INDEX>
New-NetNat -Name MyNATnetwork -InternalIPInterfaceAddressPrefix 192.168.0.0/24

In your ubuntu server open your network netplan

@mzaglia
mzaglia / wsl_vhdx.md
Last active August 16, 2021 04:45
WSL Change vhdx
  1. Backup current vhdx file from %LOCALAPPDATA%\Packages\<PackageFamilyName>\LocalState\ext4.vhdx to D:\ext4.vhdx (Most important step. If you can't find correct vhdx file, you shouldn't go ahead)
  2. Remove current distro, like wsl --unregister Ubuntu-20.04
  3. Reinstall distro from Microsoft Store
  4. Export and import wsl --export Ubuntu-20.04 D:\wsl.tar
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@mzaglia
mzaglia / app.py
Created March 23, 2020 15:08
werkzeug HTTPExceptions as JSON
from flask import Flask
from werkzeug.exceptions import HTTPException
app = Flask(__name__)
@app.errorhandler(HTTPException)
def http_exception_handler(e):
return {'code': e.code, 'description': e.description}
if __name__ == '__main__':