Stories
Slash Boxes
Comments
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

use Perl Log In

Log In

[ Create a new account ]

dagolden (6584)

dagolden
  (email not shown publicly)
AOL IM: xdaveg (Add Buddy, Send Message)

Journal of dagolden (6584)

Thursday November 20, 2008
10:46 PM

Fun with Perl: rdesktop launcher

[ #37916 ]

I've started experimenting with using rdesktop to remotely access my (Windows) laptop from my Ubuntu desktop. The annoying part was figuring out what DHCP address was assigned to the laptop each time.

Then, of course, I realized this was a job for Perl! (Plus some system tools)

So I wrote a "laptop-launcher" program and here's what it does:

  • run 'nmap' to scan for hosts with open remote desktop ports
  • parse the nmap output to map MAC addresses to IP addresses (thank you Regexp::Common qw/net/)
  • run 'rdesktop' with the IP address corresponding to my laptop's MAC address

Just a couple minutes work and now launching a remote desktop session to my laptop is a snap.

Thank you, Perl!

-- dagolden

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
 Full
 Abbreviated
 Hidden
More | Login | Reply
Loading... please wait.
  • will get you multicast DNS for free, so instead of nmapping your network, you can use a hostname of laptop.local, for example. MacOS supports this out of the box, too.
    • It's a Windows laptop. From what I can tell, the Apple Bonjour for Windows program lets the Windows laptop resolve *.local but doesn't automatically advertise anything, and I don't regularly have any Bonjour services running.

      So unless I want to download the Windows Bonjour SDK and write a taskbar program to just advertise "_workstation" for identity, nmap seems like an easier approach.

      Thanks for the suggestion, though. I wish Bonjour on Windows was more usable -- it would have been easier.

      -- dagolden