Created
July 20, 2017 01:32
-
-
Save rufo/0e8ff4c44568f4b988fc958b32d18532 to your computer and use it in GitHub Desktop.
Sinatra app for unlocking your PC via VNC (for steam)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'bundler/inline' | |
gemfile true do | |
source 'https://rubygems.org' | |
gem 'ruby-vnc', '~>1.1.0', require: 'net/vnc' | |
gem 'sinatra', '~>2.0.0' | |
end | |
require 'sinatra/base' | |
class UnlockApp < Sinatra::Base | |
set :bind, '0.0.0.0' | |
get '/' do | |
"<html><body><a href='/unlock'>open your eyes</a></body></html>" | |
end | |
get '/unlock' do | |
Net::VNC.open '192.168.212.101:0', shared: true, password: 'vncpassword' do |vnc| | |
vnc.button_press | |
sleep 1 | |
vnc.type 'pin' | |
vnc.key_press :return | |
end | |
"<html><body>door is open</body></html>" | |
end | |
run! | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment