Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save lcdsantos/b0ad33c0be3f026c8a87829c64a0c0ad to your computer and use it in GitHub Desktop.

Select an option

Save lcdsantos/b0ad33c0be3f026c8a87829c64a0c0ad to your computer and use it in GitHub Desktop.
// This will open up a prompt for text to send to a console session on digital ocean
// Useful for passwords
(function () {
var t = prompt("Enter text to be sent to console, (This wont send the enter keystroke)").split("");
function f() {
console.log('asdf');
window.rfb.sendKey(t.shift().charCodeAt());
if (t.length > 0) {
setTimeout(f, 10);
}
}
f();
})();
// Minified version:
!function(){function t(){window.rfb.sendKey(e.shift().charCodeAt()),e.length>0&&setTimeout(t,10)}var e=prompt("Enter text to be sent to console, (This wont send the enter keystroke)").split("");t()}();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment