Skip to content

Instantly share code, notes, and snippets.

@schnerd
Last active February 8, 2023 06:49
Show Gist options
  • Star 4 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save schnerd/d3456f49b53942639b3fafa32a6d6a83 to your computer and use it in GitHub Desktop.
Save schnerd/d3456f49b53942639b3fafa32a6d6a83 to your computer and use it in GitHub Desktop.
setup.sh
# Install Google Chrome
# https://askubuntu.com/questions/79280/how-to-install-chrome-browser-properly-via-command-line
sudo apt-get install libxss1 libappindicator1 libindicator7
wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb
sudo dpkg -i google-chrome*.deb # Might show "errors", fixed by next line
sudo apt-get install -f
# Install Node Stable (v7)
curl -sL https://deb.nodesource.com/setup_7.x | sudo -E bash -
sudo apt-get install -y nodejs
# Run Chrome as background process
# https://chromium.googlesource.com/chromium/src/+/lkgr/headless/README.md
# --disable-gpu currently required, see link above
google-chrome --headless --hide-scrollbars --remote-debugging-port=9222 --disable-gpu &
# Install script dependencies
npm install chrome-remote-interface minimist
# Take the screenshot
nodejs index.js --url="http://www.eff.org"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment