Twitter status:

    follow me on Twitter →

    Archive for Computers & Technology

    Ubuntu Landscape MOTD without Landscape

    SSH into a machine running Ubuntu Server 9.10 and witness a pretty slick new message of the day (MOTD).

    Linux anesti 2.6.31-16-generic-pae #53-Ubuntu SMP Tue Dec 8 05:20:21 UTC 2009 i686

    To access official Ubuntu documentation, please visit:

    http://help.ubuntu.com/

    System information as of Tue Dec 29 10:18:31 MST 2009

    System load: 1.46               Memory usage: 50%   Processes:       93
    Usage of /:  6.5% of 184.12GB   Swap usage:   0%    Users logged in: 0

    Graph this data and manage this system at https://landscape.canonical.com/

    The message at the bottom refers to Canonical‘s newest commercial offering for Ubuntu servers. Essentially, Landscape is a web-based system monitoring interface hosted by Canonical. While the product/service itself is pretty useful, the cost of it could be prohibitive for many Ubuntu Server users. I had installed Landscape initially to play with it, but after seeing the screenshots and information about the product, decided not to bother. I did, however, like the MOTD displayed on login with the Landscape data and wanted to keep that while not wasting CPU cycles running the landscape-client. Here’s how I kept the informational MOTD, but removed Landscape from my box.

    1. Remove Landscape from the machine
      sudo apt-get remove landscape-client

      Note: apt will inform you that packages are ready to be auto-removed.To ensure that the landscape-common package we need doesn’t get removed, force the package to install.

      sudo apt-get install landscape-common

      You can then auto-remove the remaining packages.

      sudo apt-get autoremove
    2. At this point, you’ll notice that the “Graph this data and manage this system at https://landscape.canonical.com/” message still shows. If it doesn’t bother you, you can stop here. If you want to get rid of it, you’ll need to edit the Python file that outputs this text.
      sudo nano /usr/share/pyshared/landscape/sysinfo/landscapelink.py

      Comment out the two three lines:

          def run(self):
              #self._sysinfo.add_footnote(
                  #"Graph this data and manage this system at "
                  #"https://landscape.canonical.com/")
              return succeed(None)
      
    3. Log out and log back in to see the changes!

    Edit: It appears the location of this file has changed, as it’s actually a symlink to

    /usr/share/pyshared/landscape/sysinfo/landscapelink.py

    . I’ve updated the instructions to fit this. On my system, there are symlinks in both /usr/lib/python2.5 and /usr/lib/python2.6 for this, so it’s easier just to edit the main file.

    1 Comment

    Twitter

    twitter-iconBeing the geek that I am and being on Twitter, many of you may have noticed I have setup a Twitter account for my server to “Tweet” information that could be useful to me. @anestidotorg tweets uptime, CPU usage, and users every hour thanks to a CRON job and a Python script I’ve written. I originally started out with BASH script, moving to Python because of the flexibility in string handling. Most *nix servers should have Python installed. The script uses CURL to hit Twitter’s API. My server now “tweets” on reboot, and every hour, giving me a status update. I’m providing this script for free, do as you wish with it. Download Here

    Comments

      Aside:

    • Well, in case anyone manages to find my site via Google, I’ve just bricked my iPhone by installing SwirlyMMS and the MMS Enabler for the iPhone 2G. Or at least that’s what I’m thinking the problem is. My phone wouldn’t boot at all, so I managed to put the phone into DFU mode by holding down the power and home buttons for 10 seconds, then releasing the power button, leaving you with whatever recovery screen you have by default. Then restore with iTunes and you should be set. (0)