Skip to content

Instantly share code, notes, and snippets.

@N0xFF
N0xFF / README.md
Last active April 3, 2018 17:20 — forked from csfrancis/gdb_ruby_backtrace.py
Debug and getting a backtrace of stuck Ruby process with gdb

Steps

Get the PID ps -Af | grep ruby

Attach to the process sudo gdb -p PID

Enter in Python python

Run snippet gdb_ruby_backtrace.py

@N0xFF
N0xFF / README.MD
Created July 27, 2022 13:11
MikroTik stuck on `TLS handshake, Client hello (1)`

Problem:

curl -v https://xxx/
*   Trying x.x.x.x:443...
* TCP_NODELAY set
* Connected to xxx (x.x.x.x) port 443 (#0)
* ALPN, offering h2
* ALPN, offering http/1.1
* successfully set certificate verify locations:
* CAfile: /etc/ssl/certs/ca-certificates.crt
@N0xFF
N0xFF / chrome_update
Created September 6, 2023 08:14
Install/Update Chrome for Testing and Chromedriver in Ubuntu
#!/usr/bin/env bash
# Use @puppeteer/browsers to system-wide install the latest stable release of Chrome and Chromedriver.
# By default to home directory.
cd ~
mkdir -p bin
output=($(npx @puppeteer/browsers install chrome@stable)) &&\
ln -sfv ${output[1]} ~/bin/chrome &&\
@N0xFF
N0xFF / application_system_test_case.rb
Created September 2, 2024 07:56
Save/show browser logs (Chome + Selenium + Capybara + Rails)
class ApplicationSystemTestCase < ActionDispatch::SystemTestCase
Capybara.register_driver :chrome_headless do |app|
client = Selenium::WebDriver::Remote::Http::Default.new
client.read_timeout = ENV.fetch("SELENIUM_READ_TIMEOUT", 120).to_i
options = Selenium::WebDriver::Chrome::Options.new
options.add_argument('--headless=new') if ENV["HEADLESS"] != "false"
options.add_argument('--disable-extensions')
options.add_argument('--disable-gpu')
options.add_option("goog:loggingPrefs", { browser: "ALL" })