Skip to content

Script that permits the Copy & Paste function in the console of a DigitalOcean droplet

License

Notifications You must be signed in to change notification settings

aqlvin/dropletcp

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 

Repository files navigation

Disclaimer

As of August 14th 2018, this script is no longer needed. See Digital Ocean's Release Notes.

The Droplet console now supports pasting information into the console.

Description

This is a handy little script for those who are using DigitalOcean's servers and are unable to 'Copy & Paste' to the console of their droplet.


Functionality

  • Permits 'Copy & Paste' function by opening a small dialog window where the user can paste whatever they wish to appear in the console. (uses sendkeys with JavaScript)
  • Allows the user to use their own keyboard language.

Usage

  1. Open your web browser's 'Console'. The hotkeys for this varies depending on OS and web browser.
OS Browser Hotkey
Windows Firefox CTRL+SHIFT+K
Chrome CTRL+SHIFT+J
IE / Edge F12 -> Console
OS X Firefox CMD+OPT+K
Chrome CMD+OPT+J
Safari CMD+OPT+C
  1. Enter the console command found under 'SCRIPT' and press Enter.
  2. Copy and paste the text you want to be entered in the console or manually type it.
  3. Press OK or hit Enter.
  4. You should now see the text being entered in the console of your droplet.

Script

!function(){function t(){function n(t,e){s=s.concat(RFB.messages.keyEvent(t,e))}var o=e.shift(),s=[],i=o.charCodeAt(),c=-1!=='!@#$%^&*()_+{}:"<>?~|'.indexOf(o),r=XK_Shift_L;c&&n(r,1),n(i,1),n(i,0),c&&n(r,0),rfb._sock.send(s),e.length>0&&setTimeout(t,10)}var e=prompt("Enter text to be sent to console").split("");t()}();

About

Script that permits the Copy & Paste function in the console of a DigitalOcean droplet

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published