Skip to content

Instantly share code, notes, and snippets.

View ruyrocha's full-sized avatar

Ruy Rocha ruyrocha

  • Anywhere with internet connection.
View GitHub Profile
@ruyrocha
ruyrocha / OpenAI_Nginx_DenyList
Created September 5, 2024 04:01 — forked from JayPeet/OpenAI_Nginx_DenyList
Nginx OpenAI Deny List
# IPs taken from:
# https://openai.com/searchbot.json
# https://openai.com/chatgpt-user.json
# https://openai.com/gptbot.json
# And presumably could change.
location /
{
#deny OAI-SearchBot
deny 20.42.10.176/28;
@ruyrocha
ruyrocha / LEIAME.md
Created March 8, 2024 00:11 — forked from thiagokokada/LEIAME.md
[Vivo Fibra] Usando RTF3507VW-N1 em modo bridge

[Vivo Fibra] Usando RTF3507VW-N1 em modo bridge

Por que usar o RTF3507VW-N1 em modo bridge?

O roteador Askey RTF3507VW-N1 fornecido pela Vivo tem vários problemas:

  • Existe um cache interno de DNS (usando o dnsmasq?) bugado: ao fazer a mesma requisição DNS duas vezes seguidas, a primeira resposta vem correta, porém na seguinte temos:
@ruyrocha
ruyrocha / macbook_pro_ubuntu_install.md
Created November 24, 2023 09:01 — forked from cjonesy/macbook_pro_ubuntu_install.md
Installing Ubuntu on MacBook Pro

Macbook Pro - Ubuntu Install

Requirements

2 USB drives > 2GB

Pre-Install

Create bootable USB drive

  1. Grab the latest Ubuntu Desktop iso image
@ruyrocha
ruyrocha / rust-command-line-utilities.markdown
Created August 13, 2023 22:06 — forked from sts10/rust-command-line-utilities.markdown
A curated list of command-line utilities written in Rust

A curated list of command-line utilities written in Rust

Note: I have moved this list to a proper repository. I'll leave this gist up, but it won't be updated. To submit an idea, open a PR on the repo.

Note that I have not tried all of these personally, and cannot and do not vouch for all of the tools listed here. In most cases, the descriptions here are copied directly from their code repos. Some may have been abandoned. Investigate before installing/using.

The ones I use regularly include: bat, dust, fd, fend, hyperfine, miniserve, ripgrep, just, cargo-audit and cargo-wipe.

  • atuin: "Magical shell history"
  • bandwhich: Terminal bandwidth utilization tool
@ruyrocha
ruyrocha / vagrant-vmware-tech-preview-apple-m1-pro.md
Created April 12, 2022 01:19 — forked from sbailliez/vagrant-vmware-tech-preview-apple-m1-pro.md
Vagrant and VMWare Tech Preview on Apple M1 Pro

Vagrant and VMWare Tech Preview on Apple M1 Pro

This document summarizes notes taken while to make the VMWare Tech preview work on Apple M1 Pro, it originated from discussions in hashicorp/vagrant-vmware-desktop#22

Installing Rosetta

First install Rosetta if not already done, this is needed to run x86 code:

@ruyrocha
ruyrocha / tdee.js
Created September 2, 2020 15:47 — forked from qmmr/tdee.js
Calculate your BMR & TDEE
// Total Daily Energy Expenditure
function TDEE (data) {
this.weight = data.weight || 60
this.height = data.height || 180
this.age = data.age || 20
this.sex = data.sex || 'male'
this.bodyType = data.bodyType || 'ectomorph'
this.numberOfWorkouts = data.numberOfWorkouts || 3
this.durationOfWorkout = data.durationOfWorkout || 45
this.ratios = data.ratios || {
@ruyrocha
ruyrocha / javascript.rb
Last active October 28, 2018 01:46
Capybara with headless Chrome
Capybara.register_driver :chrome do |app|
# Ensure a reasonable amount of time for Read/Open timeouts
http_client = Selenium::WebDriver::Remote::Http::Default.new(
read_timeout: 30,
open_timeout: 30
)
# Explicitly set the Chrome capabilities
browser_capabilities = Selenium::WebDriver::Remote::Capabilities.chrome(
'chromeOptions' => {
@ruyrocha
ruyrocha / no_animations.rb
Created October 24, 2018 13:49 — forked from keithtom/no_animations.rb
Rack Middleware to disable Disable CSS3/jQuery Animations for Capybara
module Rack
# disable CSS3 and jQuery animations in test mode for speed, consistency and avoiding timing issues.
# Usage for Rails:
# in config/environments/test.rb
# config.middleware.use Rack::NoAnimations
class NoAnimations
def initialize(app, options = {})
@app = app
end
@ruyrocha
ruyrocha / docker-cleanup-resources.md
Created April 3, 2018 19:00 — forked from bastman/docker-cleanup-resources.md
docker cleanup guide: containers, images, volumes, networks

Docker - How to cleanup (unused) resources

Once in a while, you may need to cleanup resources (containers, volumes, images, networks) ...

delete volumes

// see: https://github.com/chadoe/docker-cleanup-volumes

$ docker volume rm $(docker volume ls -qf dangling=true)

$ docker volume ls -qf dangling=true | xargs -r docker volume rm

Hetzner Online AG http://www.hetzner.de/
SoftLayer http://www.softlayer.com/
UA Servers https://itldc.com/
webexxpurts.com http://webexxpurts.com/
Host Europe http://www.hosteurope.de/
OVH http://www.ovh.co.uk/
HostKey http://www.hostkey.com/
PEER 1 http://www.peer1.com/
3NT UK http://3nt.com/
eukhost.com http://eukhost.com/