Skip to content

Instantly share code, notes, and snippets.

@billmeyer
billmeyer / replace.md
Last active November 9, 2022 19:07
Replace a value in a read only HTML input using JS

Enter this in the Chrome DevTools console:

// Use the element selector to get the input field
elem = document.querySelector("input[name='ingestion_key']")
elem.value = elem.value.replace(/[0-9a-f]/g, 'x')
@billmeyer
billmeyer / Grafana Server Config.md
Last active January 12, 2021 20:22
Configure Grafana Server to use a Proxy Server

Configure Grafana Server to use a Proxy Server

  1. Add these lines to /etc/default/grafana-server:

     HTTPS_PROXY=http://<username>:<password>@<ip>:<port>/
     HTTP_PROXY=http://<username>:<password>@<ip>:<port>/
     NO_PROXY=localhost,127.0.0.0/8,::1,<other ip/networks to ignore>
    
  2. Restart the grafana server instance to take effect:

@billmeyer
billmeyer / README.md
Last active December 30, 2020 11:20
Setting PROXY variables for Go apps

Set https_proxy in Mac OS or Linux

To set the https_proxy environment variable in Mac OS or Linux:

Use the command specific to your shell. For example, in bash, use the export command, as in the example below:

export https_proxy=http://my.proxyserver.com:8080

Add and Remove user from group on macOS

Procedure

Add user ernie to group _www.

sudo dseditgroup -o edit -a ernie -t user _www
@billmeyer
billmeyer / README.md
Last active August 17, 2020 15:46
Sauce Connect for Desktop/Emulator/Simulator and Real Device *AUTOMATED* Testing
@billmeyer
billmeyer / README.md
Last active July 30, 2020 18:04
Sauce Connect for Real Device *LIVE* Testing

Starting Sauce Connect for Real Device LIVE Testing

NOTE: These instructions only apply to Real Device LIVE Testing. For Live Desktop, Automated Desktop, Automated Emulator, Automated Simulator, and Automated Real Device testing, a separate Sauce Connect instance is needed. Reference this Gist for details: https://gist.github.com/billmeyer/5cdb1ff770b0552ef0e49c49ba122d47.

Get started by downloading the Sauce Connect executable from https://wiki.saucelabs.com/display/DOCS/Downloading+Sauce+Connect+Proxy.

See https://wiki.saucelabs.com/display/DOCS/System+and+Network+Requirements+for+Sauce+Connect+Proxy for network-specific requirements.

Prerequisites

Start the tunnels

  1. Set environment variables needed by Sauce Connect:
  • SAUCE_USERNAME
  • SAUCE_ACCESS_KEY
  1. In Terminal 1:

Setup

  1. Copy the files attached to this Gist and place them in their respective directories:

  2. Be sure to changes the permissions on /root/sauceconnect/*.yml to user readable:

    $ sudo chmod 600 /root/sauceconnect/*.yml

and that the file is owned by root:

@billmeyer
billmeyer / Opening the Web Inspector to Debug Applications in the iOS Simulator.md
Last active January 28, 2020 14:20
Opening the Web Inspector to Debug Applications in the iOS Simulator/Mobile Safari
  1. Launch a manual session with the iOS simulator of your choice.
  2. In the manual session, open Safari (desktop). To do this:
  3. Click outside the simulator, activating Finder.
  4. Select File in the menu → New Finder Window.
  5. Select ApplicationsSafari and open it.
  6. Check to see if Develop is in the menu for Safari. If it isn't:
  • Select SafariPreferences.
  • Go to the Advanced tab, and check the box at the bottom to turn ON the develop menu.
  • Check to see if the web inspector is active for the iOS Simulator (it should be enabled by default):
  • Select Settings (for iOS Simulator) → SafariAdvanced (scroll to the bottom of the settings page) &arr; Turn on web inspector.
@billmeyer
billmeyer / README.md
Last active December 17, 2019 04:14
Command Line Selenium Session

Create the Session

NOTE: Be sure to set the SAUCE_USERNAME and SAUCE_ACCESS_KEY environment variables first!

    curl -v -u ${SAUCE_USERNAME}:${SAUCE_ACCESS_KEY} \
        https://ondemand.saucelabs.com/wd/hub/session -X POST \
        -d '{"desiredCapabilities": {"browserName":"firefox"}}' | jq "."