+ Post New Thread
Page 1 of 3 123 LastLast
Results 1 to 15 of 36
General Chat Thread, Progam/Scripting Challenge - where am I in General; I'd like my schools to be able to track where I am (as I quite often deviate from the weekly ...
  1. #1

    SimpleSi's Avatar
    Join Date
    Jun 2005
    Location
    Lancashire
    Posts
    5,824
    Thank Post
    1,476
    Thanked 593 Times in 445 Posts
    Rep Power
    168

    Progam/Scripting Challenge - where am I

    I'd like my schools to be able to track where I am (as I quite often deviate from the weekly plan!) and I'm looking for a script/prog to do this

    I've a laptop that I normally switch on in each school and login.

    Each school has a different IP range (10.xxx.yyy.) so my laptop knows which school I'm in.

    Looking for the best/most elegant/cleverest way of getting this info onto a website.

    I have a simple php/mysql help desk prog on one of my schools webservers that I'll use to show my location.

    Ideas?

    regards
    Simon
    PS I was going to use my Omnia with GPS to do this but can't find a free prog for WinMob to do the job (that actually works )

  2. #2

    sparkeh's Avatar
    Join Date
    May 2007
    Posts
    6,861
    Thank Post
    1,318
    Thanked 1,683 Times in 1,128 Posts
    Blog Entries
    22
    Rep Power
    511
    I have the same problem. My solution is to simply have a google calendar that is published on one of the school websites, this has my timetable on it, if it changes I alter the calendar.

    Anyone who needs to know where I am has it in their browser favourites so can easily check where I am.

  3. #3

    SimpleSi's Avatar
    Join Date
    Jun 2005
    Location
    Lancashire
    Posts
    5,824
    Thank Post
    1,476
    Thanked 593 Times in 445 Posts
    Rep Power
    168
    Yep - that's why I'd like a dynamic one

    They all know where I'm supposed to be - but where am I actually ?

    If they knew I was at the school next door, they might contact me straight away to tell me the main server has failed instead of muddling through till tommorrow pm when they think I'll be in

    Its part of my attempt to lead the horses to the water AND make them drink it

    regards
    Simon

  4. #4
    SteveBentley's Avatar
    Join Date
    Jun 2007
    Location
    Yorkshire
    Posts
    1,444
    Thank Post
    120
    Thanked 263 Times in 189 Posts
    Rep Power
    72
    How about a web page that contains a PHP script which grabs $_SERVER(REMOTE_ADDR) - this is the client IP address - and writes it to a file on the server. This script needs to have a really random name so that nobody else will find it. There may be better ways to do the security on this if you feel it's necessary. Put a shortcut to it in your startup folder, and maybe have the script redirect to your normal homepage.

    Then have a public page that will read the file, work out where you are based on the IP address - the explode() function is good for this, using . as the delimiter - and display something appropriate.

    You could also have a version of the first script which you manually run when you are leaving site which clears the file, so that the second script can show that you're off-site/travelling/at home with your feet up.

  5. Thanks to SteveBentley from:

    SimpleSi (4th March 2009)

  6. #5

    SimpleSi's Avatar
    Join Date
    Jun 2005
    Location
    Lancashire
    Posts
    5,824
    Thank Post
    1,476
    Thanked 593 Times in 445 Posts
    Rep Power
    168
    Would that $_SERVER(REMOTE_ADDR) call pick up my actual LAN ip address (10.xx.yyy.zz) or an LEA real ip?

    regars

    Smion

  7. #6

    powdarrmonkey's Avatar
    Join Date
    Feb 2008
    Location
    Alcester, Warwickshire
    Posts
    4,859
    Thank Post
    412
    Thanked 777 Times in 650 Posts
    Rep Power
    182
    Quote Originally Posted by SimpleSi View Post
    Would that $_SERVER(REMOTE_ADDR) call pick up my actual LAN ip address (10.xx.yyy.zz) or an LEA real ip?

    regars

    Smion
    It will be your NATted or proxied IP, whichever applies (so no, it won't be your private 10... address).

    I'm having a think about this, if I come up with something I'll let you know.

  8. #7

    matt40k's Avatar
    Join Date
    Jun 2008
    Location
    Ipswich
    Posts
    4,439
    Thank Post
    368
    Thanked 649 Times in 530 Posts
    Rep Power
    160
    You want something like DynDNS... only... different.

    Would you want it to automatically update? Or when you click a button? What device is this going to be run on?

  9. #8
    SteveBentley's Avatar
    Join Date
    Jun 2007
    Location
    Yorkshire
    Posts
    1,444
    Thank Post
    120
    Thanked 263 Times in 189 Posts
    Rep Power
    72
    Quote Originally Posted by SimpleSi View Post
    Would that $_SERVER(REMOTE_ADDR) call pick up my actual LAN ip address (10.xx.yyy.zz) or an LEA real ip?
    Depends where the server is - if it's within the LEA it should pick up the 10. address, if you go via a proxy to get to it then it'll show you as having the proxy's IP which will screw things up.

  10. Thanks to SteveBentley from:

    SimpleSi (4th March 2009)

  11. #9
    SteveBentley's Avatar
    Join Date
    Jun 2007
    Location
    Yorkshire
    Posts
    1,444
    Thank Post
    120
    Thanked 263 Times in 189 Posts
    Rep Power
    72
    How about this:

    Batch file which pipes ipconfig to a file and then uses command line FTP to upload that to the web server, and then the public page parses the file to get at the IP address.

  12. #10

    sparkeh's Avatar
    Join Date
    May 2007
    Posts
    6,861
    Thank Post
    1,318
    Thanked 1,683 Times in 1,128 Posts
    Blog Entries
    22
    Rep Power
    511
    Quote Originally Posted by SimpleSi View Post
    They all know where I'm supposed to be - but where am I actually ?

    If they knew I was at the school next door, they might contact me straight away to tell me the main server has failed instead of muddling through till tommorrow pm when they think I'll be in
    Perhaps I am not understanding, but I can't see why a complicated scripted solution is better than the way I do it?

    Using your scenario above, If I go into a different school than my calendar says, I simply alter my google calendar from 'school A' to 'school B' which is automatically reflected on the school website.If the server goes down, the school checks the calendar on the website, if I am at the school next door then they call.

    Again perhaps I don't understand the problem.

  13. #11

    powdarrmonkey's Avatar
    Join Date
    Feb 2008
    Location
    Alcester, Warwickshire
    Posts
    4,859
    Thank Post
    412
    Thanked 777 Times in 650 Posts
    Rep Power
    182
    Of course, your choice of OS is probably going to be a big factor in how elegant this is.. any preference?

  14. #12

    dhicks's Avatar
    Join Date
    Aug 2005
    Location
    Knightsbridge
    Posts
    5,663
    Thank Post
    1,263
    Thanked 786 Times in 683 Posts
    Rep Power
    237
    Quote Originally Posted by SteveBentley View Post
    Batch file which pipes ipconfig to a file and then uses command line FTP to upload that to the web server
    That's what I was thinking, but instead of FTP just have a script on the web server. Then you just need a startup script of some sort on the laptop that gets the ip address of the machine (probably via ipconfig) and does a "wget addressOfWebServer/updateLocation.py?ipAddress=10.0.yyy.xxx".

    --
    David Hicks

  15. #13

    Join Date
    Mar 2008
    Location
    Surrey
    Posts
    2,168
    Thank Post
    98
    Thanked 319 Times in 261 Posts
    Blog Entries
    4
    Rep Power
    113
    Quote Originally Posted by SimpleSi View Post
    PS I was going to use my Omnia with GPS to do this but can't find a free prog for WinMob to do the job (that actually works )
    Google Latitude?

  16. Thanks to jamesb from:

    SimpleSi (4th March 2009)

  17. #14

    tech_guy's Avatar
    Join Date
    May 2007
    Location
    That little bit in the middle of Little Old England
    Posts
    8,136
    Thank Post
    1,913
    Thanked 1,345 Times in 743 Posts
    Blog Entries
    3
    Rep Power
    395
    Yeah I use Google Latitude on my G1 and have a dedicated page on my website. My wife uses it to check where I am!


  18. #15

    mac_shinobi's Avatar
    Join Date
    Aug 2005
    Posts
    9,848
    Thank Post
    3,361
    Thanked 1,061 Times in 981 Posts
    Rep Power
    366
    Code:
    strComputer = "."
    
    Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")
    Set colItems = objWMIService.ExecQuery _
        ("Select * From Win32_NetworkAdapterConfiguration Where IPEnabled = True")
    
    For Each objItem in colItems
        Wscript.Echo objItem.MACAddress
        For Each strAddress in objItem.IPAddress
            Wscript.Echo strAddress
        Next
    Next
    You can easily use the FSO in the above example to write it to the text file and underneath the above code use whichever FTP method to upload it to the server then it would just be a case of getting one webpage to read the uploaded text file and also making the script a startup / login script on the laptop you use

  19. Thanks to mac_shinobi from:

    SimpleSi (5th March 2009)

SHARE:
+ Post New Thread
Page 1 of 3 123 LastLast

Similar Threads

  1. Anyone care for a challenge
    By contink in forum Hardware
    Replies: 0
    Last Post: 25th January 2008, 01:53 PM
  2. Replies: 10
    Last Post: 14th September 2007, 07:59 PM
  3. A Challenge
    By sqdge in forum How do you do....it?
    Replies: 7
    Last Post: 6th August 2007, 11:35 AM
  4. A challenge!
    By Halfmad in forum General Chat
    Replies: 12
    Last Post: 31st July 2007, 01:40 PM
  5. Challenge
    By SteveT in forum General Chat
    Replies: 12
    Last Post: 30th April 2006, 08:27 PM

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •