TOPIC: LINUX DISTRIBUTIONS
Creating a test web server using Ubuntu Server 13.04 and VirtualBox
1st September 2013Having seen Linux Format cover tools like Vagrant and Puppet that manage virtual machines, I have been attracted by the prospect of a virtual web server running on my own PC. Certainly, having the LAMP software stack in a VM means that the corresponding tools don't need to be added to a host system should its operating system need a fresh installation.
As intriguing as tools like Vagrant may be, I decided that I needed to learn a bit more about getting server instances set up in VirtualBox anyway. Thus, I went and downloaded the latest version of Ubuntu Server and gave that a go. One lesson that I learned was that Bridged Networking needs to be added to the VM before installation of the operating system, unless you fancy overcoming the challenge of getting Ubuntu Server to recognise an altered or additional network interface. In my case, I added an extra adapter for the Bridged Networking and left the original in place as NAT. The reason for having Bridged Networking set up is that it allows access to the virtual web server from the host once you know the IP address and that information can be obtained by executing the ifconfig
command on the virtual machine.
With the networking sorted, the next step was to install the 64-bit edition of Ubuntu Server. Unlike its desktop counterpart, this is all driven by text menus but remains fairly intuitive and there is hardly anything there that you wouldn't see with another Linux distribution. A useful addition is the addition of a menu to select the types of server services that you'd like to see installed. From this, I chose the web server and SSH options, and I seem to remember that there was a database server option too. If there was an FTP server option, I would have chosen that too, but it was no ordeal to add Proftpd later on anyway.
All of this set was done through the VirtualBox GUI, just to keep life more straightforward. Even so, I only selected 12 MB of video memory and was tempted to cut the overall memory back from 512 MB but leaving things be for now. However, what I have begun to do is start and stop the virtual machine from the command line, since servers are headless operations anyway. With SSH enabled, there is little need to have the VirtualBox GUI going. The command for starting the server is below:
VBoxManage startvm "Ubuntu Server" --type=headless
There is a VBoxHeadless
command for the same end too, but VBoxManage
does what I need. The startvm
option is what tells VBoxManage
to start the server, and the virtual machine's name is enclosed in quotes. The --type=headless ensures that no window pops up. To stop the virtual web server cleanly, a command like the following is needed:
VBoxManage controlvm "Ubuntu Server" acpipowerbutton
Again, the VBoxManage
command gets used and the acpipowerbutton
option ensures that a clean shutdown is performed. Not doing so results in the server not fully starting up, according to my experiences thus far. Getting the virtual web server to start and stop with the host machine itself starting and stopping, but this looks more complex, so I plan to leave things a while before trying that experiment.
Restoring GNU Parallel Functionality in Ubuntu GNOME 13.04
31st July 2013There is a handy command line utility called GNU Parallel that allows you to run Linux commands on more than one CPU core at a time to perform parallel processing of the task at hand. Here is a form of the command that is similar to one that I often use:
ls *.* | parallel gm convert -sharpen 1x3 {} sharpened_images/{}
What it does is pipe a list of files in a folder to GraphicsMagick for sharpening and outputting to a sharpened_images directory. The {} in the command is where the filenames go in the sharpening command.
This worked fine in Ubuntu GNOME 12.10 but stopped doing so after I upgraded to the next version. A look on the web set me to running the following command:
parallel --version
That produced output that included the following line:
WARNING: YOU ARE USING --tollef. IF THINGS ARE ACTING WEIRD USE --gnu.
Rerunning the original command with the --gnu
option worked, but there was a more permanent solution than using something like this:
ls *.* | parallel --gnu gm convert -sharpen 1x3 {} sharpened_images/{}
That was editing /etc/parallel/config
with root privileges to delete the --tollef
option from there. With that completed, all was as it should again, and it makes me wonder why the change was made in the first place. Perhaps because of it, there even is a discussion about the possibility of removing the --tollef
option altogether, since it raises more questions than it answers.
Adding Microsoft Core Fonts to Fedora 19
6th July 2013While I have a previous posting from 2009 that discusses adding Microsoft's Core Fonts to the then current version of Fedora, it did strike me that I hadn't laid out the series of commands that were used. Instead, I referred to an external and unofficial Fedora FAQ. That's still there, yet I also felt that I was leaving things a little to chance, given how websites can disappear quite suddenly.
Even after next to four years, it still amazes me that you cannot install Microsoft's Core Fonts in Fedora as you would on Ubuntu, Linux Mint or even Debian. Therefore, the following series of steps is as necessary now as it was then.
The first step is to add in a number of precursor applications such as wget
for command line file downloading from websites, cabextract
for extracting the contents of Windows CAB files, rpmbuild
for creating RPM installers and utilities for the XFS file system that chkfontpath
needs:
sudo yum -y install rpm-build cabextract ttmkfdir wget xfs
Here, I have gone with terminal commands that use sudo
, but you could become the superuser (root) for all of this and there are those who believe you should. The -y switch tells yum to go ahead with prompting you for permission before it does any installations. The next step is to download the Microsoft fonts package with wget
:
sudo wget http://corefonts.sourceforge.net/msttcorefonts-2.0-1.spec
Once that is done, you need to install the chkfontpath
package because the RPM for the fonts cannot be built without it:
sudo rpm -ivh http://dl.atrpms.net/all/chkfontpath
Once that is in place, you are ready to create the RPM file using this command:
sudo rpmbuild -ba msttcorefonts-2.0-1.spec
After the RPM has been created, it is time to install it:
sudo yum install --nogpgcheck ~/rpmbuild/RPMS/noarch/msttcorefonts-2.0-1.noarch.rpm
When installation has completed, the process is done. Because I used sudo
, all of this happened in my own home area, so there was a need for some housekeeping afterwards. If you did it by becoming the root user, then the files would be there instead, and that's the scenario in the online FAQ.
Turning on autocompletion for the bash shell in terminal sessions
26th June 2013At some point, I managed to lose the ability to have tab-key-based autocompletion on terminal sessions on my Ubuntu GNOME machine. Wanting it caused had me to turn to the web for an answer, and I found it on a Linux Mint forum; the bash shell is so pervasive in the UNIX and Linux worlds that you can look anywhere for a fix like this.
The problem centred around the .bashrc
file in my home area. It does have quite a few handy custom aliases, and I must have done a foolish spring-clean on the file sometime. That is the only way that I can explain how the following lines got removed:
if [ -f /etc/bash_completion ]; then
. /etc/bash_completion
fi
What they do is look to see if /etc/bash_completion can be found on your system and to use it for tab-based autocompletion. With the lines not in .bashrc
, it couldn't happen. Others may replace bash_completion with bash.bashrc
to get a fuller complement of features, but I'll stick with what I have for now.
Installing Nightingale music player on Ubuntu 13.04
25th June 2013Ever since the Songbird project concentrated its efforts to support only Windows and OS X, the Firefox-based music player has been absent from a Linux user's world. However, the project is open source and a fork called Nightingale now fulfils the same needs. Intriguingly, it too is available for Windows and OS X users, which leaves me wondering why that overlap has happened. However, Songbird also is available as a web app and as an app on both Android and iOS, while Nightingale sticks to being a desktop application.
To add it to Ubuntu, you need to set up a new repository. That can be done using the Software Centre but issuing a command in a terminal can be so much quicker and cleaner, so here it is:
sudo add-apt-repository ppa:nightingaleteam/nightingale-release
Apart from entering your password, there will be a prompt to continue by pressing the carriage return key or cancelling with CTRL + C. For our purposes, it is the first action that's needed and once that's done the needful, you can execute the following command:
sudo apt-get update && sudo apt-get install nightingale
This is in two parts: the first updates the repositories on your system, while the second actually installs the software. When that is complete, you are ready to run Nightingale and, with the repository, staying up to date is not a chore either. In fact, using the above commands brings another advantage: it is that they should work in any Ubuntu derivatives, such as Linux Mint.
A need to update graphics hardware
16th June 2013As someone who doesn't play computer games, I rarely prioritise graphics card upgrades. Yet, I recently upgraded graphics cards in two of my PCs despite nothing being broken. My backup machine, built nearly four years ago, has run multiple Linux distributions. It uses an ASRock K10N78 motherboard from MicroDirect with an integrated NVIDIA graphics chip that performs adequately, if not exceptionally. The only issue was slightly poor text rendering in web browsers, but this alone wasn't enough to justify adding a dedicated graphics card.
More recently, I ran into trouble with Sabayon 13.04 with only the 2D variant of the Cinnamon desktop environment working on it and things getting totally non-functional when a full re-installation of the GNOME edition was attempted. Everything went fine until I added the latest updates to the system, when a reboot revealed that it was impossible to boot into a desktop environment. Some will relish this as a challenge, but I need to admit that I am not one of those. In fact, I tried out two Arch-based distros on the same PC and got the same results following a system update on each. So, my explorations of Antergos and Manjaro have to continue in virtual machines instead.
When I tried Linux Mint 15 Cinnamon, it worked perfectly. However, newer distributions with systemd didn't work with my onboard NVIDIA graphics. Since systemd will likely come to Linux Mint eventually, I decided to add a dedicated graphics card. Based on good past experiences with Radeon, I chose an AMD Radeon HD 6450 from PC World, confirming it had Linux driver support. Installation was simple: power off, insert card, close case, power on. Later, I configured the BIOS to prioritise PCI Express graphics, though this step wasn't necessary. I then used Linux Mint's Additional Driver applet to install the proprietary driver and restarted. To improve web browser font rendering, I selected full RGBA hinting in the Fonts applet. The improvement was obvious, though still not as good as on my main machine. Overall, the upgrade improved performance and future-proofed my system.
After upgrading my standby machine, I examined my main PC. It has both onboard Radeon graphics and an added Radeon 4650 card. Ubuntu GNOME 12.10 and 13.04 weren't providing 3D support to VMware Player, which complained when virtual machines were configured for 3D. Installing the latest fglrx
driver only made things worse, leaving me with just a command line instead of a graphical interface. The only fix was to run one of the following commands and reboot:
sudo apt-get remove fglrx
sudo apt-get remove fglrx-updates
Looking at the AMD website revealed that they no longer support 2000, 3000 or 4000 series Radeon cards with their latest Catalyst driver, the last version that did not install on my machine since it was built for version 3.4.x of the Linux kernel. A new graphics card then was in order if I wanted 3D graphics in VMware VM's and both GNOME and Cinnamon appear to need this capability. Another ASUS card, a Radeon HD 6670, duly was acquired and installed in a manner similar to the Radeon HD 6450 on the standby PC. Apart from not needing to alter the font rendering (there is a Font tab on the Gnome Tweak Tool where this can be set), the only real exception was to add the Jockey software to my main PC for installation of the proprietary Radeon driver. The following command does this:
sudo apt-get install jockey-kde
After completing installation, I ran the jockey-kde
command and selected the first driver option. Upon restart, the system worked properly except for an AMD message in the bottom-right corner warning about unrecognised hardware. Since there were two identical entries in the Jockey list, I tried the second option. After restarting, the incompatibility message disappeared and everything functioned correctly. VMware even ran virtual machines with 3D support without any errors, confirming the upgrade had solved my problem.
Hearing of someone doing two PC graphics card upgrades during a single weekend may make you see them as an enthusiast, but my disinterest in computer gaming belies this. Maybe it highlights that Linux operating systems need 3D more than might be expected. The Cinnamon desktop environment now issues messages if it is operating in 2D mode with software 3D rendering and GNOME always had the tendency to fall back to classic mode, as it had been doing when Sabayon was installed on my standby PC. However, there remain cases where Linux can rejuvenate older hardware and I installed Lubuntu onto a machine with 10-year-old technology on there (an 1100 MHz Athlon CPU, 1GB of RAM and 60GB of hard drive space in a case dating from 1998) and it works surprisingly well too.
It appears that having fancier desktop environments like GNOME Shell and Cinnamon means having the hardware on which it could run. For a while, I have been tempted by the possibility of a new PC, since even my main machine is not far from four years old either. However, I also spied a CPU, motherboard and RAM bundle featuring an Intel Core i5-4670 CPU, 8GB of Corsair Vengeance Pro Blue memory and a Gigabyte Z87-HD3 ATX motherboard included as part of a pre-built bundle (with a heat sink and fan for the CPU) for around £420. Even for someone who has used AMD CPU's since 1998, that does look tempting, but I'll hold off before making any such upgrade decisions. Apart from exercising sensible spending restraint, waiting for Linux UEFI support to mature a little more may be no bad idea either.
Update 2013-06-23: The new graphics card in my main machine works well and has reduced system error messages; Ubuntu GNOME 13.04 likely had issues with my old card. On my standby machine, I found and removed a rogue .fonts.conf
file in my home directory, which dramatically improved font display. If you find this file on your system, consider removing or renaming it to see if it helps. Alternatively, adjusting font rendering settings can improve display quality, even on older systems like Debian 6 with GNOME 2. I may test these improvements on Debian 7.1 in the future.
A little look at Debian 7.0
12th May 2013Having a virtual machine with Debian 6 on there, I was interested to hear that Debian 7.0 is out. In another VM, I decided to give it a go. Installing it on there using the Net Install CD image took a little while but proved fairly standard with my choice of the GUI-based option. GNOME was the desktop environment with which I went and all started up without any real fuss after the installation was complete; it even disconnected the CD image from the VM before rebooting, a common failing in many Linux operating installations that lands into the installation cycle again unless you kill the virtual machine.
Though the GNOME desktop looked familiar, a certain amount of conservatism reigned too, since the version was 3.4.2. That was no bad thing, since raiding the GNOME Extension site for a set of mature extensions was made easier. In fact, a certain number of these were included in the standard installation anyway and the omission of a power off entry on the user menu was corrected as a matter of course without needing any intervention from this user. Adding to what already was there made for a more friendly desktop experience in a short period of time.
Debian's variant of Firefox, IceWeasel, is version 10 so a bit of tweaking is needed to get the latest version. LibreOffice is there now too, and it's version 3.5 rather than 4. Shotwell too is the older 0.12 and not the 0.14 that is found in the likes of Ubuntu 13.04. As it happens, GIMP is about the only software with a current version and that is 2.8; a slower release cycle may be the cause of that, though. All in all, the general sense is that older versions of current software are being included for the sake of stability and that is sensible too, so I am not complaining very much about this at all.
The reason for not complaining is that the very reason for having a virtual machine with Debian 6 on there is to have Zinio and Dropbox available too. Adobe's curtailment of support for Linux means that any application needing Adobe Air may not work on a more current Linux distribution. That affects Zinio, so I'll be retaining a Debian 6 instance for a while yet, unless a bout of testing reveals that a move to the newer version is possible. As for Dropbox, I am sure that I can recall why I moved it onto Debian, but it's working well on there so I am in no hurry to move it over either. There are times when slower software development cycles are better...
Using a variant of Debian's Iceweasel that keeps pace with Firefox
5th February 2013Left to its own devices, Debian will leave you with an ever ageing re-branded version of Firefox that was installed at the same time as the rest of the operating system. From what I have found, the main cause of this was that Mozilla's wanting to retain control of its branding and trademarks in a manner not in keeping with Debian's Free Software rules. This didn't affect just Firefox but also Thunderbird, Sunbird and Seamonkey with Debian's equivalents for these being IceDove, IceOwl and IceApe, respectively.
While you can download a tarball of Firefox from the web and use that, it'd be nice to get a variant that updated through Debian's normal apt-get channels. In fact, IceWeasel does get updated whenever there is a new release of Firefox, even if these updates never find their way into the usual repositories. While I have been known to take advantage of the more frozen state of Debian compared with other Linux distributions, I don't mind getting IceWeasel updated so it isn't a security worry.
The first step in so doing is to add the following lines to /etc/apt/sources.list
using root access (using one of sudo
, gksu
or su
to assume root privileges) since the file normally cannot be edited by normal users:
deb http://backports.debian.org/debian-backports squeeze-backports main
deb http://mozilla.debian.net/ squeeze-backports iceweasel-release
With the file updated and saved, the next step is to update the repositories on your machine using the following command:
sudo apt-get update
With the above complete, it is time to overwrite the existing IceWeasel installation with the latest one using an apt-get command that specifies the squeeze-backports repository as its source using the -t
switch. While IceWeasel is installed from the iceweasel-release
squeeze-backports repository, there are dependencies that need to be satisfied and these come from the main squeeze-backports one. The actual command used is below:
sudo apt-get install -t squeeze-backports iceweasel
While that was all that I needed to do to get IceWeasel 18.0.1 in place, some may need the pkg-mozilla-archive-keyring
package installed too. For those needing extra information beyond what's here, there's always the Debian Mozilla team.
Installing the Cinnamon Desktop Environment on Sabayon Linux
26th January 2013During the week, I did an update on my Sabayon system and GNOME 3.6 came on board without too much of a bother. There was no system meltdown or need for an operating system re-installation. However, there was one matter that rankled: adding and updating extensions from extensions. gnome.org was impossible. The process would create a new folder in ~/.local/share/gnome-shell/extensions/ but not fill it with anything at all. Populating from another Ubuntu GNOME Remix 12.10 machine didn't seem to achieve the needful, and I am left wondering if it is down to the version of GNOME Shell being 3.6.2. However, even adding an entry for the current version of GNOME Shell to metadata.json for one plugin didn't appear to do what I wanted, so resolving this issue needs further enquiry.
Meanwhile, I added the Cinnamon desktop environment using the following command and will be using that from now on. If the GNOME Shell extension issue ever gets sorted, I may move back, but there is no rush. GNOME 3.8 sounds like it's bringing an interesting option that makes use of the approach Linux Mint took for version 12 of that distribution, and I can await that, especially if it avoids the need for adding extensions on a personal basis like now.
sudo equo update && sudo equo install cinnamon
With the installation completed by the above command, it was a matter of logging out and choosing the Cinnamon entry (there is a 2D version too) from the session dropdown menu on the login screen to get it going. Then, it was a matter of tweaking Cinnamon to my heart’s content. Getting a two panel layout required logging out and in again as well as choosing the appropriate setting in the Cinnamon Panel options tab. Next, I decided to check on what themes are available at cinnamon.linuxmint.org before settling on Cinnamint 1.6. It all feels very comfortable, apart from not having an automatically growing list of workspaces that are a default offering in GNOME Shell. That goes against the design principles of Cinnamon though, so only hopes of someone making an extension that does that are left.
Adding Quicktime movie support to Firefox running on Linux
24th January 2013For whatever reason, my installation of Ubuntu GNOME Remix 12.10, didn't have QuickTime support added to Firefox by default. To make a website work near enough as it was intended, this needed to be remedied. The solution was to issue a command to install the missing software:
sudo apt-get install mplayer gnome-mplayer gecko-mediaplayer
Mplayer is the main component here but running the above command adds all the required supporting packages too, so that a Firefox restart was all that needed to get things going.