Author: russt

  • Monitoring a Web Page for Changes

    Bash Script

    Today, I found myself needing a way to monitor a page. I didn’t need anything fancy, just something that would alert me if a page changed in any way. So, I set up a simple bash script and cron job to monitor the page. For me, this was a perfect solution. Since I’ve got a server running 24/7, it’s always able to monitor the page. This wouldn’t work quite as well from, say, a laptop, but a server or always-on desktop work perfectly. But in truth, all you really need is a system capable of running cron jobs. So, without further ado, whip open your favorite text editor and plug this in there:

    #!/bin/bash
    pageAddress="http://example.com/index.html"
    pageHashFile=/path/to/pageHash.txt
    
    newhash=$(curl "${pageAddress}" | md5sum | awk '{ print $1 }')
    oldhash=$(cat $pageHashFile)
    
    # Check the hashes, send an email if it's changed
    if [ $newhash != $oldhash ]; then
        echo "${pageAddress}" | mail -s "Page changed!" [email protected]
    
        # Only update the hash if the email was successfully sent.
        returnCode=$?
        if [[ $returnCode == 0 ]] ; then
            echo "${newhash}" > $pageHashFile
        fi
    fi
    

    Of course, you’ll need to change the page address, the path to where you want the hash put, and the email so that they meet your situation. Finally, just add the script to your crontab, and you’re good to go! I’ve got mine set to run every 10 minutes. To put it in your crontab, run crontab -e, and insert the following (adapt it as needed):

    */10 * * * * bash /path/to/script.sh
    

    It could be adapted to be more versatile and enable monitoring multiple pages, but since I just needed one (at least for now), this does the trick nicely.

  • Yet Another Site Redesign

    Hey there! So, I know that I don’t really have any readers. However, I’m going to be increasing the frequency of my writing on the blog. Most of the information here will be related to my work and school, so it’ll be rather, well, technological in nature. I’ve got a couple of planned posts coming up that will relate specifically to site development and version control.

    I’m also working (albeit slowly) on a new site design. I’ll be launching that in awhile, though that might take some time. Either way, there will be some changes coming. For those of you interested less in technology and more in what’s going on in my life, I’ve got some other news coming in regard to that, hopefully this weekend.

  • Custom Keyboard Layouts in Windows 8 Consumer Preview

    Windows 8 Consumer Preview

    So, a few days ago, I sporadically decided to install the Windows 8 Consumer Preview on my laptop. I just wanted to get a good look at what’s coming in the next version of Windows. Now, all commenting about Windows 8 aside, I had one pretty serious issue. You see, I’ve become incredibly reliant on the Programmer Dvorak Keyboard Layout. I switched layouts just over a year ago, but it’s put me in a relatively small group of people. While Windows includes three versions of Dvorak by default, Programmer Dvorak isn’t one of them. (more…)

  • Google’s Zeitgeist – 2010 In Review

    Zeitgeist

    My second post of the day – and month – is all about Google. This may seem familiar, because it just so happens that my previous post also dealt with Google.

    Google recently released, as is their custom, their Zeitgeist (which, defined, is the spirit characteristic of an age or generation). (more…)

  • Android Honeycomb Tablet

    Honeycomb Tablet

    A video of an Android tablet running Android version 3 (otherwise known as Honeycomb) is out. It’s incredible! First, Google has updated Google Maps to be totally vector-based (meaning it uses mathematical formulas to create the graphics, rather than downloading pictures), which makes downloading map information much faster. Second, it’s a tablet… Running a version of Android made for tablets… (more…)

  • Quick Site Searches in Chrome

    I’ve been exclusively using Google’s Chrome web browser for a while now, (for several reasons, about which I will post later) but I just recently discovered an amazing feature. And when I say amazing, I really do mean it.

    How often do you want to specifically look something up on Wikipedia? Youtube? CNN? For me, it happens quite often. (more…)

  • A Steady Pattern

    Over the past two years, I’ve been able to enjoy a steady pattern of weight loss. It’s been amazing. I’ve never been (at least that I can remember) very skinny, and for a long time had simply given up hope that I’d be able to be what I considered to be skinny. However, I’ve finally been able to conquer that. And let me tell you, it’s pretty stellar. (more…)

  • Secure Your Electronic Devices

    Prey - Open Source Security for your Phone & LaptopAs I’m sure I don’t need to tell you, the modern world, with our dependence on fancy-schmancy gadgets (with which I have an undying obsession, I might add), and the vulnerabilities that come along with such gadgets, it is essential that we care for our expensive gadgets. For that reason, I suggest you install some security to assist in protecting your beloved gadgets and sensitive information that you put on those gadgets. (more…)

  • Simple Email Tweak = Better Email

    I recently found a super awesome trick for e-mail. All you do is add a + to your email address with some term after it. Like this:

    [email protected]

    (more…)

  • A Proper Workspace

    I’ve been at college, I mean, officially at college, for a whole two weeks now, and if there’s one thing I’ve learned, it’s that having a proper place to work makes all the difference. (more…)