Skip to content

Instantly share code, notes, and snippets.

@emilssolmanis
Created March 10, 2012 18:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save emilssolmanis/2012351 to your computer and use it in GitHub Desktop.
Save emilssolmanis/2012351 to your computer and use it in GitHub Desktop.
Open tabs opened on a remote host locally in Opera
# The temp file is needed to avoid infinite loop cases, Opera writes to the
# autosave file when it opens a new tab. While technically this shouldn't
# happen if you open from a remote host, better safe than sorry.
function open_tabs_from {
ssh $1 "fgrep -A2 \"history url\" ~/.opera/sessions/autosave.win | grep 0= | cut -d \"=\" -f 2-" > /tmp/opera.tabs
cat /tmp/opera.tabs | xargs -I{} opera -newtab {}
rm /tmp/opera.tabs
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment