Btsync With Vnc


Journeyman

Recommended Posts

A while back I was helping my uncle troubleshoot some problems on his PC.  I had my uncle - the type of person that doesn't know what a right-click is - install a VNC server program on his desktop so that I could help him out a bit better.  Having him install it and enable port forwarding was only half of the work, getting him to find his external IP address, as simple as it is, was the other half.  Whenever I helped him, he would always have to find that external IP address since it would change every month or so.  So BTSync is now helping me with this.

 

The solution: instead of having a paid service to take care of the dynamic IP (like No-IP.org), I wrote a small script to be run on the VNC server PC that will be hidden from view and poll every so often to see if the external IP has changed.  If it has, it will write the IP address to a simple text file, and sync it right on over to my box 1100 miles away.  On my end, (the VNC viewer end,) I have another script that integrates nicely with VNC so that his current IP address is always in the drop-down menu of server selections in the viewer.

 

It's definitely a hack, and there's probably an easier way to do it, but sometimes it's just the fun of making something work - even if it is the hard way.

Link to comment
Share on other sites

Guest proactiveservices

It's definitely a hack, and there's probably an easier way to do it, but sometimes it's just the fun of making something work - even if it is the hard way.

I definitely agree here :-D

 

Depending on what flavour of VNC you're using, you may be able to have the server (uncle) call in to a "listening viewer" on your end. You then tell the VNC server to connect to listening viewer on your-computer.no-ip.org and voila.

Link to comment
Share on other sites

Here's a good example: freedns.afraid.org

 

... and a script for CloudFlare: ;)(original source unknown), but they have decent tutorials/scripts too if you need one.

#!/usr/bin/env pythonimport urllib2, json, socketfrom urllib import urlencodedef setipforsubdomain(subdomain, domain, email, tkn, apiaddr, ip):	dictionary = dict([		('a', 'rec_edit'), 		('type', 'A'), 		('z', domain), 		('tkn', tkn), 		('email', email), 		('name', subdomain), 		('content', ip), 		('service_mode', '0'), 		('ttl', '1')])	rec_all = urllib2.urlopen(apiaddr, urlencode(dict([		('a', 'rec_load_all'), 		('tkn', tkn), 		('email', email), 		('z', domain)])))	rec_all = json.loads(rec_all.read())	for dicts in rec_all['response']['recs']['objs']:		if dicts['name'] == host:			id = dicts['rec_id']		else:			pass	dictionary['id'] = id	rec_edit = urllib2.urlopen(apiaddr, urlencode(dictionary))	print urlencode(dictionary)	print rec_edit.read()if __name__ == "__main__":	subdomain = "dyn"	domain = "domain.tld"	email = "cloudflare-login@domain.tld"	tkn = "secret_api_token"	apiaddr = "https://www.cloudflare.com/api_json.html"	host = "%s.%s" % (subdomain, domain)	ip = urllib2.urlopen("http://icanhazip.com").read()[:-1]	current_ip = socket.gethostbyname(host)	if ip == current_ip:		pass	else:		setipforsubdomain(subdomain, domain, email, tkn, apiaddr, ip)
Link to comment
Share on other sites

  • 2 weeks later...

you should use teamviewer instead.

 

Thanks.  That may be an option for the future.  One thing about it is that it looks like in order to have all of the features, you need to have a login.  I know I didn't mention this, but I've gotten to the point where I already have so many usernames (& corresponding passwords) to remember, I really don't want another one.  That's what makes this BTSync hack so nice.  The IP database is synced, so I don't have to login or remember anything.  VNC is still secured by a password, so I'm not too worried about security.  Yes, it's still another password to remember, but for me the difficulty is getting the right username to match the password!  I do appreciate your feedback though, everybody!

Don Friesen: Forgot Password - YouTube  <--This is totally me.

 

It looks like, and correct me if I'm wrong, that with Team Viewer, you can get away with not having to login, but just having the other person read you off a number and then you can connect.  This is another issue for me for a couple reasons.  One, I like to remotely access my NAS from outside the local network with VNC.  I have this same hack set up on there such that I don't have to have anyone at the other end read off a number.  And Two, my uncle is a bit dyslexic.  I often have to have him read off a number three times before he gets it right.  (I used to have him get on Skyfex because it was simple, but they only offer 10 minutes free.)  It's easier if I just tell him to open up the viewer, and I can take over from there.

 

 

 

There's related requests for RDP/VNC integration into Sync in this thread over in the Feature Requests forum.

 

If this is something you'd like to see integrated with Sync in the future, feel free to add your voices to that thread!

 

Thanks!  Definitely going to be following that thread!

Link to comment
Share on other sites

Only need to remember the login once. And the password you can set too.

I can't be the only one thinking about this. What does your uncle use the computer for? It seems he can't do anything (read numbers, double click).

Anyways, it's always fun to experiment!

Link to comment
Share on other sites

Only need to remember the login once. And the password you can set too.

Like I said: I don't like logins.

 

 

I can't be the only one thinking about this. What does your uncle use the computer for? It seems he can't do anything (read numbers, double click).

Excuse me?  You need to mind your manners.  Yes, you probably are the only one thinking about this as I never said he couldn't read numbers.  I said he was dyslexic.  I never said he couldn't double-click.  I said he didn't know what a right-click was for.  Perhaps I could pardon my manners as you have, and jump to the conclusion that you are illiterate as you couldn't read what I wrote in the aforementioned comments.  But I wouldn't do that.  That would be rude.

Link to comment
Share on other sites

I can't be the only one thinking about this. What does your uncle use the computer for? It seems he can't do anything (read numbers, double click).

Excuse me?  You need to mind your manners.  Yes, you probably are the only one thinking about this as I never said he couldn't read numbers.  I said he was dyslexic.  I never said he couldn't double-click.  I said he didn't know what a right-click was for.  Perhaps I could pardon my manners as you have, and jump to the conclusion that you are illiterate as you couldn't read what I wrote in the aforementioned comments.  But I wouldn't do that.  That would be rude.

Gents, let's keep things friendly, civil and on-topic please!

Link to comment
Share on other sites

  • 1 month later...

Chill it, ladies ;)

 

@topic: This sure will work, but i think it is a little... uh... oversized for just gettign the external ip.

You could use Dyndns (one host is free to my knowlegde), but you also could write a small script, that your uncle just has to start from desktop. This script then will get the external IP and send id via mail to you.

 

This will surely only work, if he is on the PC. If we are talking about you taking control via VNC regardless of him being there, i refer to my DynDNS-Solution ;)

 

Though i dont think, your solution is the easiest way, i still appreciate your way of solving this with btsync :)

 

Best wishes

spYro

Link to comment
Share on other sites

Well when someone insults me or my family, I'm going to have a bit of a backbone.  Even if that means getting a few remarks or getting booted from the forum.  It's important to stand up for yourself.

 

Chill it, ladies ;)

 

@topic: This sure will work, but i think it is a little... uh... oversized for just gettign the external ip.

You could use Dyndns (one host is free to my knowlegde), but you also could write a small script, that your uncle just has to start from desktop. This script then will get the external IP and send id via mail to you.

 

This will surely only work, if he is on the PC. If we are talking about you taking control via VNC regardless of him being there, i refer to my DynDNS-Solution ;)

As far as DynDns goes, yeah, I looked into it.  I think they stopped doing their one-free-host back in...April?  But even before that, they had a 30-day limit where you had to renew your domain name because it expires or something.  Your comments about the one-click solution for emailing it has me thinking though.  Hmmm...

 

It's funny how this is called syncHacks, but people have been trying to swing me away from using BTSync since I posted this!

Link to comment
Share on other sites

i think it' a good think that we dont make you use "our" software, no mattet the benefit ;)

using a torrent-based decentral file-synchronisation tool for getting network-information like IP from a remote server over the internet..... that's not quiet the scenario i would use btsync for. That said, there are easier ways like my mail-scenario. But we do our best to help you anyway :)

Link to comment
Share on other sites

  • 7 months later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.