Re: dynamic IP questions?

From: charlie derr (cderr_at_simons-rock.edu)
Date: 01/20/04

  • Next message: Katipo: "Re: Debian dedicated hosting"
    Date: Tue, 20 Jan 2004 14:22:42 -0500
    To: debian-user@lists.debian.org
    
    

    Vikki Roemer wrote:
    > On Sat, Jan 10, 2004 at 09:13:55AM -0500, 0debian user wrote:
    >
    >>Also I wanted to run my own web server and mail server but my machine is
    >>not always online so how can I do it?
    >
    >
    > Go to http://www.dyndns.org/ and sign up there. They give you up to 5
    > hostnames for free, you just have to update the IP address every time you
    > redial. That's who I get my 3 hostnames through, and I'm happy with them. :)
    > I recommend ipcheck.py (apt-get install ipcheck) to update the addy.
    > However, don't ask me how to *automate* the update script, because I'm still
    > trying to figure that out myself.
    >
    > HTH.
    >

    Here's the entry in /etc/crontab on my gateway/router machine (that
    connects via pppoe to my adsl provider) for those interested in
    automating this sort of thing.

    0-55/5 * * * * root /root/radscripz/reconnector.py

    And the contents of reconnector.py (with my personal details replaced
    with <something>).

    <file>

    #!/usr/bin/env python

    import os, string, sys, time, smtplib

    fi,fo = os.popen2('/sbin/ifconfig','t')

    sss = fo.read()

    fi.close()
    fo.close()

    if string.find(sss,"ppp0") > -1:
             sys.exit(0)

    ei, eo = os.popen2('/usr/local/bin/start-pppoe', 't')

    ei.close()
    eo.close()
    time.sleep(10)

    os.chdir('/root/dyndns')

    gi, go = os.popen2('/usr/bin/python /root/dyndns/ipcheck.py -l -i ppp0
    <dyndns-username> <dyndns-password> <dyndns-hostname>','t')

    gi.close()

    res = go.read()
    go.close()
    mailcon = smtplib.SMTP('<mailserver>', port=25)

    recips = ['<address1>', '<address2>']

    mailcon.sendmail('connexor@<machine-name>', recips, res)

    mailcon.quit()
    sys.exit(0)

    </file>

    Basically, it runs every five minutes and if the connection has died, it
    reconnects, then updates the dyndns stuff and also emails me at several
    addresses with the new IP (which is probably redundant, but it does have
    the added benefit of providing me with a record of how often I've been
    disconnected).

            good luck,
                    ~c

    -- 
    This is not a democracy; it's a cheerocracy.
       -Torrance Shipman
    -- 
    To UNSUBSCRIBE, email to debian-user-request@lists.debian.org 
    with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
    

  • Next message: Katipo: "Re: Debian dedicated hosting"

    Relevant Pages

    • Re: Receiving spam from my own server
      ... First, you didn't sanitize very well, but that actually helps answer your question a bit better. ... I really suspect you've just been receiving spoofed emails. ... You mention this came from a web server, and if someone is abusing a page on your site to send you emails, you might want to check your web server logs as well. ...
      (Security-Basics)
    • Re: Custom Web Server
      ... Then WTF are you asking about a web server for then? ... > just monitors a database and sends out emails based on certain critera in ... this is why I wanted to avoid using IIS so ... >> webserver on the local computer, therefore you need something as IIS on ...
      (microsoft.public.dotnet.languages.vb)
    • PHP mail() max outgoing e-mails limit workaround?
      ... I've recently switched some of my websites to a web server that limits ... the amount of e-mails you can send from a particular domain to maximum ... emails in the database and then called the mailfunction for each ... Since the hourly limitation is necessary to limit e-mail spam, ...
      (php.general)
    • Re: Setting up a simple Web Server
      ... I wold like to make a few pictures available to my family overseas. ... In that case I actually strongly suggest you just use an online ... gallery / photoblog site. ... To run your own web server ...
      (Ubuntu)
    • RE: Problem with .net
      ... I'm using my devp machine as the web server. ... To be online, I need to connect to the internet. ...
      (microsoft.public.dotnet.framework)