kdmurray.blog

The crossroads of life and tech

Ubuntu School – GUI (xubuntu-desktop) for Ubuntu Server

Whether it’s because you’re not fully versed in the power of the command line, or you just want to use a tool that will speed things along like gparted, the command-line isn’t always the best tool for the job. Sometimes you just need a GUI, even if it’s just for a few minutes. I’m going to walk through how to do the installation on Ubuntu 11.10 with the assumption that you only want the GUI occasionally, and don’t want it consuming server resources all the time.

The first step is to get the GUI tools installed. sudo apt-get update
sudo apt-get upgrade
sudo apt-get install xubuntu-desktop

That was the simple part. At this point you now have the GUI installed, but it will start the GUI every time the system boots, loading all of that extra cruft into memory. The next steps that I followed from a post on Techinote shows the steps to disable the automatic startup of the GUI environment.

sudo apt-get install lightdm
sudo nano /etc/default/grub

find the line GRUB_CMDLINE_LINUX_DEFAULT and set it to GRUB_CMDLINE_LINUX_DEFAULT="text"

sudo update-grub
sudo update-rc.d -f lightdm remove
sudo shutdown -r now

Done!

Your system will now be at the text-based login screen (as it was before this all started). When you need to use the graphical environment, simply type startx and it will move you into an already authenticated GUI desktop environment. This will allow you to setup and configure tools with a GUI (like CrashPlan) without having to rely the UI being constantly loaded and running in the background.

Ubuntu School – Get Rolling with Webmin on Ubuntu Server 11.10

Even if some Linux purists would have you believe the command-line is the only way to go, the pragmatist in me will always take an appropriate GUI over a complicated command-line any day. You can run a lot of powerful services for your home network using one or more Ubuntu server machines. With the right tools you don’t need to be a Linux expert to make that happen.

The tool of choice is Webmin. This is a set of web-based tools which allow you to control virtually every piece of server-side software on you Ubuntu server. The GUI is intuitive and straight-forward, the documentation is excellent, and the project is under active development.

Because Webmin isn’t in the standard repositories you will have to do a couple of quick command-line changes to configure your system to be able to find and download the apt package.

sudo nano /etc/apt/sources.list

Once the file is open, add these lines to the bottom of the file

#########################

Package Sources for Webmin

deb http://download.webmin.com/download/repository sarge contrib deb http://webmin.mirror.somersettechsolutions.co.uk/repository sarge contrib

Those lines will add the necessary sources to apt for it to find the Webmin package. The Webmin package has also been digitally signed by its author. By default you will need to download the author’s key so that apt can use it to verify the Webmin package at install time. Fortunately, this is really easy to do.

wget http://webmin.com/jcameron-key.asc sudo apt-key add jcameron-key.asc

Now that all the prep work is done, it’s time to install Webmin.

sudo apt-get update sudo apt-get install webmin

All done! Now you can access administrative functions of your server’s services from the Webmin console: https://yourservername:10000/. This URL is also shown in the last few lines of the apt install details that are ouput to the command-line.

Ubuntu School – Add an Existing User to a Group

Occasionally you need to grant an existing user some additional permissions to files, directories or applications. This typically means some kind of change in your permissions settings for the object in question. But because you can only have a single owner for a given object you need to be careful making these changes.

Something you can do, though, is extend the permissions on the object to a set of users by way of a group. Logically, a group is nothing more than a named collection of users who all have the same access (by way of that group) to some resource. Users in Ubuntu typically carry one primary, and one or more secondary groups (I won’t get into the differences here).

By adding group permissions to your resources (ie give the ‘payroll’ group read/write access to the ‘HR’ folder) you can simply add users to and remove users from the appropriate groups and be confident that their level of access to the resources on your machine is set correctly.

To add an existing user to an existing group:

sudo usermod -a -G payroll graymond

To remove a user from a group you use the same command. The catch is, you remove a user from a group by re-adding all of their groups and simply omitting the group you wish to remove them from.

sudo usermod -nG mkirkpatrick

The system will show you a list of the user’s groups.

marketing sales vanprinters torprinters

Then you simply run the usermod command as above, removing the group in question (in this case vanprinters)

usermod -G marketing,sales,torprinters mkirkpatrick

Ubuntu School – sudo Your Last Command

Sometimes we just forget that we need to specify elevated privileges on our Ubuntu machines. I do it all the time, particularly when I’m setting up a new machine.

Thankfully there’s a shortcut for those of us who are forgetful. If I want to restart the box I can use a command like:

shutdown -r now

But of course that command requires elevated privileges:

shutdown: Need to be root

With the fantastic !! argument for sudo you can repeat your last terminal command:

sudo !!

Now you can quickly and efficiently re-run that last command you forgot to sudo!!

Ubuntu School – DHCP Release and Renew

It’s not uncommon to need to release/renew the IP address for a given machine. This is particularly true if you’re doing any kind of maintenance on your network, or are troubleshooting pretty much any kind of Internet problem. I never seem to remember how to do this, so I’m including this post as much for my own benefit as anything.

What I’m talking about is the Ubuntu equivalent of these windows commands ipconfig /release ipconfig /renew

From an Ubuntu terminal type: sudo dhclient -r sudo dhclient

Much like the Windows equivalents you can also specify these actions for a specific interface if your situation requires.

sudo dhclient eth0

Ubuntu School – Creating a New User

There are two built-in commands for creating a user from the command-line in Ubuntu: useradd and adduser. useradd is the older command which has, for the most part, been deprecated in favour of the more user-friendly adduser command. Both will allow you to create new user accounts, set up home directories and generally move in the right direction, but adduser will prompt you for information you didn’t include whereas useradd will assume you didn’t want those things (ie create the home directory).

sudo adduser theboss

will produce an output similar to

Adding user theboss' ... Adding new grouptheboss' (1001) ... Adding new user theboss' (1001) with grouptheboss' ... Creating home directory /home/theboss' ... Copying files from/etc/skel' ... Enter new UNIX password: Retype new UNIX password: passwd: password updated successfully Changing the user information for theboss Enter the new value, or press ENTER for the default Full Name []: Joe Bossman Room Number []: Work Phone []: Home Phone []: Other []: Is the information correct? [Y/n] y

And there you are! Happy user-creating!

Guest Spot – Knightcast 0056 “The Best of KWTV Live”

I recently had the honour of being asked to be a guest on Knightwise’s podcast during his KWTV Live event in September. He took the opportunity to interview three different people about the current state of the three major operating systems, Linux, OS X and Windows. The three guests for the evening were:

Larry spoke on the state of Linux and what drives Linux adoption; Bart covered the highlights and lowlights of OS X Lion in some detail; and I talked about the Windows 8 developer preview and the state of Windows tablet PCs.

Give it a listen!

Three-week Ubuntu Experiment – Migrating to Open-Source

This past spring I made an attempt to move myself out of the shackles of the commercial software world and truly embrace open-source. I tried to move my primary machine off Windows 7, and onto Ubuntu Linux. I knew the transition wouldn’t be seamless but I’d heard so many good things about living in a Linux universe that I decided it was time.

The experiment did not go as well as I might have hoped, and despite my efforts to stick with it for some time, I eventually had to cut the experiment short. As I was preparing to re-image my system I started a blog post which I decided not to post at the time. I’ve included a short excerpt which shows my state of mind back in May, just after the experiment concluded.

I told myself I was going to stick it out for at least 3 months. But here I sit, not 3 weeks after making the decision to migrate my primary machine to Ubuntu, with the Windows 7 installation disk in hand. What could possibly have brought me to this point? Primarily, time. It’s going to take me about 8 hours of work to prep all the data on my system for the transition, wipe the linux partition, re-install windows, re-install the applications, re-install VMWare, re-install my Linux VMs (I do still have a use for them!). The problem is, things on linux generally have taken longer than they should. Some of this is due to the fact that I’m learning, and I’ve tried to ignore those. Others are generally due to the fit and finish of Ubuntu.

So what went wrong?

Problem #1 – 10.10 or 11.04?

I generally resist the temptation to move to the latest OS release, but when I tried setting up a Windows VM under VirtualBox in Ubuntu 10.10 the audio was mucked up. It seemed a bit slow too, but that may have been my imagination. So I tried installing the newly minted 11.04. The VM now worked like a charm, but that was a long multi-step process.

Problem #2 – Virtualization

Trying to set up a virtual machine that would start up at boot time (like a Windows service or any number of linux daemons) proved a nearly impossible task. After several hours of searching, tweaking, testing, and ultimately failing, I decided to abandon the effort and live with manually starting my VMs.

Problem #3 – File Sharing

Setting up network shares was probably one of the better experiences I had. I was able to set up a “public” share on the linux machine and access it from anywhere on the network… as long as I didn’t want to protect it with a username and password. That was going to require more voodoo and black magic than I was prepared to endure for such a simple task. Overall, not a bad experience.

Problem #4 – Flash in Browsers

Like it or not Flash is still an integral part of the web, and Flash in the browser was just one of those things that never quite worked right. When I talk about fit and finish of a product, this is what I mean. Blocky artifacts showing up on video players was the most common issue, though there were other things like playback and audio problems as well.

Problem #5 – Lack of Air Support

The fact that I felt compelled to write a blog post calling attention to a tutorial for getting Adobe Air installed under Ubuntu 11.04 speaks to just how difficult this didn’t need to be. On any other major platform, you can go to a website and simply click the install button. The rest is automatic. Not here though.

Problem #6 – Button Clicks

I constantly had problems just clicking on buttons. Sometimes in an application (Chromium comes to mind) but sometimes just within the Ubuntu environment itself. This kind of thing makes you start to question the faith you have in your OS.

Problem #7 – Learning Curve

I suppose it’s a bit unfair to put this here as it’s undoubtedly the same issue that would come up moving between any two major operating systems. The bottom line is that I have a young family with whom I like to spend the majority of my day. That means that when I decide to sit down at the computer to do something, I don’t really have the time to spend learning how to do things all over again.

There were a few things that were also pleasant surprises during this whole thing. Mostly to do with 3rd party applications.

CrashPlan support

CrashPlan was able to seamlessly match up my Windows backup to the Linux file system. This made it very easy to move everything over. I just hope it works as well in reverse.

AcidRip

Digitizing DVDs has never been easier. It took a couple of tries to get the quality settings just where I wanted them, but the process worked out really well.

Shell

I love the *nix shell, Bash in particular. This is the one thing I will truly miss when I move back to Windows. Having commands like rsync at my disposal, and built in SSH support are also fantastic. While this is something that has to be hacked into a Windows installation, it is available by default on OS X.

In summary…

The availability of good software to do most tasks is one of the key benefits of moving to an open source experience, but the truth is that the experience really didn’t live up to my hopes or my expectations. I’m getting to the point where I want my computing time to be spent creating, not just experimenting with different ways that I could set up my tool sets. And as time moves on, the number of free or open-source applications available on the major commercial platforms like Windows and OS X is growing. Once either of those operating systems is installed I can do everything I want to do without having to pay a license for another piece of software — and in many cases the applications are as good or better than the open-source tools available for the Linux platforms. Add to that the growing number of applications which reside in the cloud and are completely browser and platform agnostic and it starts to become a simple equation for me.

Is it worth the $150 or so that it costs to get my new computer preloaded with a commercial OS? Yes.

Adobe Air on Ubuntu 11.04 x64

I was having a devil of a time trying to get TweetDeck to even install under Ubuntu 11.04 until I came across this fantastic tutorial by deepok1968 on YouTube. The problem boils down to the Adobe Air installer not being all that happy with x64 systems in its native state.

If you visit the video page you can get a copy of the commands that he uses. I stuck them in a bash script so that I can re-use them if I need to do the install again.

Now I just need to figure out how he got that wicked looking OSX style dock…

Five Step Guide to Restoring Your Computer

broken_computerThere are lots of reasons that we fall out of love with our computers.  Slow performance, viruses. spyware and just plain too-much-crap-all-over-the-place syndrome.  The only way you can be sure to solve these issues is to wipe and re-load your system.  If you have all the install disks for Windows (or your OS of choice) and your software, the process is fairly straightforward.  Mac/Linux fanboy warning: I’m going to use Windows examples and software in most cases… deal with it.

After the tutorial, I’ve included a list of applications that you can use to make your computing life better.  The list contains free and open-source software from the original developers that you can trust on your newly cleaned system.  I highly recommend reading over the list, and even trying a few of them out on your current system before installing any of your old apps and tools.

Things you’ll need

  • Infected (or otherwise underperforming computer)
  • OS re-install disks (and product keys!!)
  • External hard drive (strongly recommended) -or-
  • Backup media (CDs, DVDs)

Step 1: Backup your data

backupYou should already have a backup process in place to keep all of your data secure.  If you do, good for you but that doesn’t mean you can skip this step.  If you have, or have been able to purchase an external hard drive use that to backup the data. It’s much faster, and far more convenient than trying to backup to external media like CDs and DVDs.  Make sure that you take everything you want to have on your new system. Often overlooked folders include your bookmarks (favourites) and desktop.  These won’t be captured in your Documents folder by default.

Step 2: Reinstall your system

This is the part that makes everyone queasy. The “delete everything and re-install” part.  But fear not, it isn’t as daunting as it sounds.  Once all the data has been backed up, put the Windows (or other OS) disk in the drive and reboot the computer.  Once the system comes back up, follow the prompts.

Select the partition to install Windows on.  In most cases, if you want to restore the system the way that it was, you can select the C: drive where the old Windows  install was located.  If you want to get into partitioning strategies that’s for another post.

If you’re in doubt format the drive using the NTFS system. It’s the default for most contemporary Windows systems and will work for 99% of people.  Yes, Mac/Linux fanboys, I realize that it’s a Windows specific file format.  You guys can use HFS+ (Mac) or ext3 (Linux).

Believe it or not that’s the “tricky” part.  Follow the remaining prompts through the text portion, and GUI portion of the setup to choose your username, password, time-zone settings, network settings etc.  These are pretty well all common sense.

Step 3: Patching and Packing

Unless you’ve learned the secrets to Slipstreaming prior to this re-install (in which case you probably don’t need this tutorial) you’ll need to install all the latest updates, patches and service packs for your system.

The majority of these can be installed through the Microsoft Update (Windows Update) site.  The updater can be run from your Start menu, or by pointing a browser at http://update.microsoft.com/.

It’s really important to get these updates in as quickly as possible because typically the CD you’re using to install the system is a couple of years old (particularly with Windows XP disks) and will be missing a ton of important security updates.  You may need to run this process a number of times before it catches everything.  Just continue the process until the update program tells you that there are no further updates available for your system.

Step 4: Re-install your applications

Here we go. Putting back all that was lost.  The first step is to install your heavy hitters installed.  Office, Visual Studio, Adobe Creative Suite — the things that take up Gigabytes of space on the disk.  After that, the smaller things, utilities, tools, games.  Check out the software list at the bottom of this post.

Once everything else is done, install your anti-virus or security software. This may be a controversial decision for most but I base the logic on the following: AV programs make software installation painfully slow.  The chances you’ll be infected while you’re doing the updates are minimal, so save yourself a bunch of time and do this last.

Step 5: Restore your data

Copy back all of the data you backed up in step 1.  This includes your bookmarks (you did back those up, right?), and anything you wanted to keep on your desktop.  Putting these pieces back is the last step to making the system your own again.

Realistically you’re looking at killing a full day with the whole process, depending how much data you have the backup/restore can take a few hours, but the process is pretty straightforward if you stay organized.  :)

Free software to help you out

Once you’re in the application re-install stage, there are lots of free tools that you can use to get your system working the same, or better than it was before.  The other reason is that these applications are great alternatives to trying to find pirated applications off the Internet.  Here they are, in no particular order:

  • 7Zip – an archiving / compression utility supporting a wide range of formats
  • ISO Recorder – Write ISO images directly from Windows explorer
  • Avast – Free anti-virus application with regular updates
  • Paint.NET – Photoshop-like image & graphic editing program
  • Firefox – Alternative (?) web browser
  • Thuderbird – Email client
  • Feed Demon – Powerful full-featured RSS reader & aggregator
  • FileZilla – FTP/SFTP/SCP client
  • Open Office – Alternative word processor, spreadsheet, presentation & database
  • VLC – Media player that supports nearly every format known to mankind
  • Evernote – Note taking/keeping application that sync’s with the web
  • Notepad++ – Tabbed notepad application
  • Visual Studio Express – Free versions of the Microsoft development tools

I hope this guide has proven informative, and will help you to move forward with your computing life.  Bring back that computer that has lost its lustre and make it uber-useful again.

Photo credits: wysz, S Baker on Flickr.