Posts Tagged ‘Ubuntu’

Upgrading Ubuntu Remotely (not a HowTo)

Thursday, April 19th, 2007

At the moment I’m connected to my terminal server with FreeNX and then to my laptop via VNC just so I can monitor the upgrade from Edgy to Feisty. Nerd? Yeah…

Upgrading Ubuntu Remotely

Downloading the package upgrades, some 1100 of them, took about an hour and a half which is pretty good considering the servers are getting pummeled. Right now, I’m halfway through installing the newer packages and looking forward to seeing the enhancements and improvements.

My Conky

Sunday, December 24th, 2006

Tonight I was fairly bored, especially while we watched the season finale of Dexter–the ending felt too rushed–so I was looking around for a little something to keep me occupied and maybe trick out my desktop. Enter Conky, a nifty lightweight system monitor application. After scanning this thread and this one for inspiration I ended up with the following setup.

Conky on the Desktop

Here’s my .conkyrc.

Sendmail, Ubuntu, Yahoo, and You!

Wednesday, December 13th, 2006

One of the main benefits of sympathetic pregnancy insomnia is that I am able to get a jump on all these little projects that I had been meaning to take care of but never had the motivation. Configuring sendmail to use Yahoo Mail as a relay to handle outbound mail from Apache is one of those projects I’ve put off for far to long. Thanks to two HowTos I managed to knock this out in a couple of minutes.

sudo apt-get install sendmail

sudo /etc/init.d/sendmail stop

sudo nano /etc/mail/authinfo and add the following:

AuthInfo:yahoo.com “U:babydaddy@your_ATT_Domain” “I:babydaddy@your_ATT_Domain” “P:password_here” “M:PLAIN”
AuthInfo: “U:babydaddy@your_ATT_Domain” “I:babydaddy@your_ATT_Domain” “P:password_here” “M:PLAIN”

sudo chmod 660 /etc/mail/authinfo to lock it down.
sudo makemap hash /etc/mail/authinfo < /etc/mail/authinfo to make the map file.
sudo nano /etc/mail/sendmail.mc and look for or add the following lines:

define(`confAUTH_OPTIONS’, `A’)dnl
define(`confAUTH_MECHANISMS’, `LOGIN PLAIN DIGEST-MD5 CRAM-MD5′)dnl
TRUST_AUTH_MECH(`LOGIN PLAIN DIGEST-MD5 CRAM-MD5′)dnl
FEATURE(`authinfo’,`hash -o /etc/mail/authinfo.db’)dnl
define(`SMART_HOST’, `esmtp:[smtp.sbcglobal.yahoo.com]‘)dnl

sudo cp /etc/mail/sendmail.cf /etc/mail/sendmail.cf.bak because you can never to too sure.

sudo make /etc/mail/sendmail.cf -C /etc/mail to rebuild your sendmail.cf.
sudo /etc/init.d/sendmail start

To test your set up create a text file that at least includes a To and a Subject:To:ServerMonkey@foo
Subject:Linux Rules Windows Drools

sudo sendmail -Am -v -t < your_text_file to shoot a copy out to yourself.

You should see something like this:

babydaddy@your_ATT_Domain… Connecting to smtp.sbc.mail.yahoo4.akadns.net. via esmtp…
220 smtp110.sbc.mail.re2.yahoo.com ESMTP
>>> EHLO your_domain
250-smtp110.sbc.mail.re2.yahoo.com
250-AUTH LOGIN PLAIN XYMCOOKIE
250-PIPELINING
250 8BITMIME
>>> AUTH PLAIN xxxxxxxxxxxxxxxxxxxxxxxx
235 ok, go ahead (#2.0.0)
>>> MAIL From: AUTH=root@your_domain
250 ok
>>> RCPT To:
>>> DATA
250 ok
354 go ahead
>>> .
250 ok 1166057377 qp 49511
babydaddy@your_ATT_Domain… Sent (ok 1166057377 qp 49511)
Closing connection to smtp.sbc.mail.yahoo4.akadns.net.
>>> QUIT
221 smtp110.sbc.mail.re2.yahoo.com

sudo nano /etc/php5/apache2/php.ini so that it knows where sendmail hangs out.

Find the line with sendmail_path, delete the ; and edit it to read:

sendmail_path = /usr/sbin/sendmail -i -t

sudo /etc/init.d/apache2 reload to make the changes stick.

Sendmail is now configured to use Yahoo as a relay! Now, ideally you should be able to massage this to use any external SMTP server that allows plain text authentication.

Gratefully cribbed from here and here.

mt-daapd, SSH, iTunes or Winamp, and You!

Wednesday, December 6th, 2006

Today was a bit of a slow day–I still cannot get Media Center 11 to run under Wine–so I thought I might give a shot to get mt-daapd to serve up files to a daap enabled client on Windows. iTunes is the obvious choice for a client but the UI sucks so bad that I want to slam my hands in a drawer and staple my eyes shut but luckily a kind soul has made a plugin for Winamp which makes me happy.
Here’s how it went down:

Server Side:

  • Make sure you are running SSH and if your not ask yourself why.
  • Grab mt-daapd and take care of any dependencies:

    libsqlite0
    libsqlite0-dev
    gawk
    gcc (this will install gcc-4.0)
    libid3tag0-dev
    libgdbm-dev

  • Edit /etc/mt-daapd.conf to your liking such as mp3_dir and servername
  • Grab Avahi and take care of any dependencies:

    avahi-daemon
    avahi-utils
    libnss-mdns

  • Edit /etc/nsswitch.conf to ensure that mdns is on the hosts line:

    hosts: files dns mdns

  • Give dbus a kick: sudo invoke-rc.d dbus restart
  • Get your avahi-daemon running: sudo invoke-rc.d avahi-daemon start
  • Fire up mt-daapd: sudo mt-daapd

Client Side

  • Get yourself a copy of iTunes, only if you are a masochist, or snag Winamp with the DAAP plugin if you love yourself.
  • Install Rendezvous Proxy and configure it (you need this to fool the client into thinking that the mt-daap server is on the same subnet):

    IP Address – 127.0.0.1
    Port – 3689
    Host Label – Your_DAAP_Server_Name_Here
    Service Type – daap

  • Set up a tunnel with Putty for port 3689, which is just like doing it for TightVNC.
  • Fire up iTunes or Winamp and wait for it to stumble onto your DAAP shares.

Well, that’s it in a nutshell.

Cribbed from James Henstridge’s write up about Avahi on Breezy, this thread, and this one.

**Update**

If Avahi seemingly won’t start check /etc/default/avahi-daemon and make sure it reads: AVAHI_DAEMON_START=1

ddclient, Ubuntu, EasyDNS, and You!

Tuesday, December 5th, 2006

So yes, this is stupid simple and I’ve put it off far to long–world renown for my sloth–but here’s the quick lowdown for ddclient.

  1. Grab and install either from Synaptic or apt-get.
  2. Walk through the little install wizard then do it all over again: dpkg-reconfigure ddclient. You want to make sure it runs as a service and monitors changes in ppp–something that the install wizard doesn’t cover.
  3. Then tweak /etc/ddclient.conf:

    # Configuration file for ddclient generated by debconf
    #
    # /etc/ddclient.conf
    pid=/var/run/ddclient.pid
    protocol=easydns
    use=web
    server=members.easydns.com
    login=yournamehere
    password=’password’
    *.your.domain

  4. Restart the service: sudo /etc/init.d/ddclient reload

One of the things I noticed when fiddling with ddclient was that it doesn’t work so well with wireless cards.  Sounds stupid, but I was testing in on my laptop and never got very far because it wouldn’t update the IP address so my sloth settled in and I never took the initiative to test it on a box with a wired connection.

Backup and Restore In Ubuntu

Friday, November 24th, 2006

So I finally got around to installing 6.10 on Management’s laptop and it was a dream now that I finally took the time to hammer out backup and restore scripts (Ted Ruegsegger has a great write up that I cribbed from to do this). Now, some people might be asking, “Why not just do an in place upgrade?” Good question, and my answer is cruft.

One of the things that I have noticed is that in place upgrades greatly increase the amount of depreciated config files and general cruft with the system and while performing one is pretty damn convenient it takes just about the same amount of time as installing the latest version, particularly since I go through the process of backing up the user directories.

Here’s the backup script I run:

cd /home
rsync -e ssh -av –delete –delete-excluded \
–exclude “tmp” \
–exclude “[cC]ache” \
–exclude “.Trash” \
me me@my.SSH-server.name:/home/me/backups

It would be nice to add this script to my Cron jobs but since this is a laptop I made a menu item so it can be run whenever I remember. Also, I have it run in a terminal and added the verbose switch so I can have the warm and fuzzies of a visual indication that something is happening.

To restore files, it is as simple as running the backup in reverse from /home:

rsync -e ssh -av me@my.SSH-server.name:/home/me/backups/me .

With Management’s laptop, I ran the restore right after I logged in and setup SSH with a pre-shared key. The catch was after the restore was done I needed to log out and back in for all the settings to work (killall gnome-panel just sort of made things wonky). All in all, the upgrade took about 2 hours from start to finish with no hiccups.