Skip to content

Instantly share code, notes, and snippets.

View jramiresbrito's full-sized avatar
🎯
Focusing

João Victor Ramires Guimarães Brito jramiresbrito

🎯
Focusing
View GitHub Profile
@arthurmde
arthurmde / postgres_queries_and_commands.sql
Last active April 9, 2024 13:41 — forked from rgreenjr/postgres_queries_and_commands.sql
Useful PostgreSQL Queries and Commands
-- show running queries (9.2)
SELECT pid, age(clock_timestamp(), query_start), usename, query
FROM pg_stat_activity
WHERE query != '<IDLE>' AND query NOT ILIKE '%pg_stat_activity%'
ORDER BY query_start desc;
-- show long-running queries (greater than 5 minutes)
SELECT
pid,
now() - pg_stat_activity.query_start AS duration,
@coltenkrauter
coltenkrauter / fix-wsl2-dns-resolution.md
Last active May 12, 2025 10:36
Fix DNS resolution in WSL2

Permanent WSL DNS Fix (WSL 2.2.1+)

If you're encountering ping github.com failing inside WSL with a Temporary failure in name resolution, you're not alone — this has been a long-standing issue, especially when using VPNs or corporate networks.

This issue is now fixed robustly with DNS tunneling, which preserves dynamic DNS behavior and avoids limitations like WSL’s former hard cap of 3 DNS servers in /etc/resolv.conf.

DNS tunneling is enabled by default in WSL version 2.2.1 and later, meaning that if you're still seeing DNS resolution issues, the first and most effective fix is simply to upgrade WSL. Upgrading WSL updates the WSL platform itself, but does not affect your installed Linux distributions, apps, or files.

To upgrade WSL, follow these steps,

@rujmah
rujmah / rails_with_rspec_mongoid.md
Last active March 4, 2023 14:59
Quick setup for rails/rspec/mongoid spec_helper

dev bit of Gemfile

group :development, :test do
  gem "rspec-rails"
  gem 'capybara'
  gem 'factory_girl_rails'
  gem 'forgery'
  gem "database_cleaner"
  gem "mongoid-rspec"