Skip to content

Instantly share code, notes, and snippets.

@sureshg
Last active August 29, 2015 14:13
Show Gist options
  • Save sureshg/887439bc11c4f3e6a031 to your computer and use it in GitHub Desktop.
Save sureshg/887439bc11c4f3e6a031 to your computer and use it in GitHub Desktop.
Headless Browser on CentOS 6.5
# Installation Steps on CentOS 6.5
# --------------------------------

$ sudo su -
$ yum install xorg-x11-server-Xvfb
$ yum install firefox
$ yum install ImageMagick
$ dbus-uuidgen > /var/lib/dbus/machine-id


$ Xvfb :1 -screen 0 1024x768x24 -extension RANDR &  
$ export DISPLAY=:1
$ nohup firefox http://www.google.com/ &
$ import -window root  /tmp/screenshot.jpg

+------------------------------------+
| X11Forwarding on a Remote machine  |
+------------------------------------+

# Install XQuartz | Preference -> Security -> Disable Auth
# Make sure X11Forwarding is enabled (Eg: /etc/ssh/sshd_config)

# -f option is used to make background process.
$ ssh -X -f app@10.227.68.102 firefox http://www.google.com 
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment