Ubuntu / Linux Mint: Adding the LibreOffice PPA

If you’re using a previous version of Ubuntu or Linux Mint, such as 12.04 or 13 (the last LTS releases), then you’re probably using an old LibreOffice suite – at least if you choose to use LibreOffice. I believe version 3.6 is in the 12.04 repositories – which I also believe is what is used by Linux Mint 13. There’s nothing wrong with LibreOffice 3.6, but there’s also nothing wrong with wanting the latest and greatest, and 3.6 is quite a few releases behind the current LibreOffice update.

Luckily, whether you wish to re-install LibreOffice or simply update the installation that comes pre-packaged with Ubuntu / Linux Mint, getting the latest version is easy as one command line in terminal.

Simply add the LibreOffice PPA:

sudo add-apt-repository ppa:libreoffice/ppa

You will also want to update the package index:

sudo apt-get update

After this is done, simply load up the Update Manager for whichever OS you’re running, click Check and you’ll find updates listed for LibreOffice. Ubuntu typically prompts to run a partial upgrade, which is fine. I didn’t see this in Linux Mint.

If you’ve removed LibreOffice and need to install from the PPA after you’ve added it, simply submit the following command:

sudo apt-get install libreoffice

That’s it. Whether you upgrading or doing a fresh install, you’ll have the latest release of LibreOffice, along with continuous updates to the application through your Update Manager.

Linux Mint MATE: Default Num Lock, Keyboard Shortcuts and System Monitor

This post is in reference to an earlier one, which can be found here.

The difference is that this example refers to Linux Mint using the MATE desktop environment. The reason I’m posting this is because I’ve recently installed Linux Mint with MATE, and was shocked to not only find no keyboard shortcut for System Monitor (which is missing by default in Ubuntu as well) but also no shortcut to terminal. So, I will explain how to add these. The steps are actually just as simple as the ones used for adding shortcuts to Ubuntu.

Personally, I find the layout of the configuration GUI for keyboard settings a little less convenient in Linux Mint from Ubuntu’s Unity, but it’s still usable and I was able to get the job done just fine without referring to any help online. The place where I found myself stuck for a second was the command used for launching these applications. In Ubuntu, System Monitor is accessed by the command gnome-system-monitor. However, in Linux Mint with MATE, it is mate-system-monitor. Not really all that shocking once you realize it, but it took me a minute to realize that I wasn’t using Gnome or a relative desktop.

But anyway. To configure keyboard shortcuts in Linux Mint with MATE, simply go to the Menu on the taskbar and click Control Center, which is about five options up from the bottom. Under the Personal category, which is at the top of the window, you’ll see Keyboard Shortcuts, which is likely the second option down from the top at the far right. One this window is opened, you can just stop. Don’t bother looking for a shortcut for either Terminal or System Monitor – just in case you’re thinking one may exist. It doesn’t, at least not if you’re using Maya. When you’re ready to create a shortcut, just click the + Add button at the bottom. The new window that pops up is exactly like what is seen in Ubuntu. Two lines: one for the title and one for the command that is called. If you wish to create a shortcut for Terminal, the command should be mate-terminal . If you wish to create one for System Monitor, the command should be mate-system-monitor , as mentioned earlier in the post. Then assigning the key combination for the shortcuts is also exactly as in Ubuntu: you simply click the shortcut you created in the list and then when it says New shortcut to the right, you hit the key combination you wish to use on your keyboard. Done.

Lastly, if you wish to have Num Lock turned on by default when you log into Linux Mint, simply open up Control Center from the Menu (as explained above), click Keyboard under the Hardware category, click the Layouts tab at the top, click the Options… button near the bottom, expand the Miscellaneous compatibility options branch and check the box next to Default numeric keypad keys. If you’ve done this in Ubuntu, you’ll also see that this is very similar.

Q&A Added

I’ve added a simple Q&A section to the site, which can be accessed by the link in the nav-menu. The software should use the same user database as WP, so anyone who is registered and logged in on the blog should be logged in on the Q&A section, but if anyone notices any problems let me know.

Ubuntu Server 12.04 – Changing Network Interface from DHCP to Static

I suppose this can be followed to set a static IP on your local network in Ubuntu Desktop as well, but this is explained with the expectation that you’re using terminal on an Ubuntu Server setup.

There are plenty of explanations of how to configure the server to use a set static IP instead of getting assigned one automatically by a DHCP server, but it seems that most tend to be incomplete. For example, it’s easy to find an explanation of editing the /etc/network/interfaces configuration to change a particular interface from using DHCP to a static address, but that seems to be where most end – which many will find leaves them unable to resolve any addresses outside the LAN after a system reboot. So I’m going to explain what I do that gets around this problem.

For every command you see here, I am executing them as root – which in some cases may require you to have sudo preceding it if you’re not. You can use the following command to login as root.

sudo su

First off, you need to open /etc/resolv.conf and note the listed IP addresses for the nameservers your server is automatically using with the DHCP settings. The reason you need to record these values is because when the machine is rebooted, the /etc/resolv.conf configuration gets overwritten – and the overwritten values will be empty since there is going to be no DHCP server providing them anymore. This is done by the DHCP client that is running on the server. Another workaround is to disable or remove the DHCP client, which will then stop the configuration from being overwritten – allowing the sustained values in /etc/resolv.conf to do the job. But I didn’t want to do that just in case I ever want to resume using the DHCP client later on, or in case I wanted to still use it for a different interface. I used nano to open the configuration.

nano /etc/resovl.conf

I simply copied the values for each nameserver in an open text editor, but you could write them down by hand on a notepad if that’s what you prefer.

The next step is the same as most other explanations: opening the network configuration and setting the static IP address.

nano /etc/network/interfaces

You’ll typically see configurations for just two interfaces here: the lo (or loopback interface) and eth0 (or the primary network interface). The settings for the primary network interface are the ones we want to edit. If your machine has multiple ethernet ports, you may see more than one, but in most cases you will just see the one. By default, it should look something like this.

# The primary network interface
auto eth0
iface eth0 inet dhcp

Instead of deleting the settings, I prefer to simply comment them out by placing a hash in front of them.

# The primary network interface
#auto eth0
#iface eth0 inet dhcp

The only reason I do this is so that if I decide to revert back to using DHCP for that interface, I only have to uncomment the lines and either remove or comment out the lines that I added to configure it for a static address.

The next step varies depending on the network. If you’re doing this for a home network running on a common residential router, it’s likely that the values for netmask should be the same ( However, the other values could be slightly different, but hopefully you are aware of what they are if you are configuring any network settings in your home. For me, the network used the address range of to (including the network and broadcast addresses). The gateway address is almost always the first address in the network and assigned to the router itself, which for me is I chose to assign the address of to the Ubuntu server (similar to most other examples). Lastly, I included the values for the dns-nameservers since we will not be able to get them from the /etc/resolv.conf location after the network service has been restarted with our changes.

# The primary network interface
auto eth0
iface eth0 inet static

You should replace with the values you see in my example on the line for dns-nameservers with those you recorded from your /etc/resolv.conf configuration. Each entry for the dns-nameservers should be separated by a space as shown. Do not create a new line with dns-nameservers <address> for each entry or else the network service will not accept it.

After doing this, you can simply restart the network service to apply the new settings, which apparently must be done as root – gives permission errors for me when trying to do it using sudo.

/etc/init.d/networking restart

Once this is done, you can check the active network settings to make sure the server is using the new address for the interface.


If everything looks good now, you should restart the server – place sudo in front of the command if not executing as root.


After the server has rebooted, test that the nameserver configuration did work and you can resolve outside addresses by pinging an address such as Google.

ping www.google.com

If you do not get an error, everything should be good to go. ūüôā

Terry Brooks’ Shannara Series

I just finished reading The Scions of Shannara and figured I’ write about Terry Brooks’ expansive fantasy series. I’ve written about Terry Brooks before, a couple of times via reviews on sites like GoodReads.com, and I believe once in an old blog that may be in existence somewhere on the net – though possibly not.

Either way, my coming across Terry’s work was an accident (or perhaps another stroke of fate, if that’s how you look at it) from picking a random book in the library, which happened to be Bearers of the Black Staff. I read the book and was pretty impressed, looking for The Measure of the Magic and being disappointed that it wasn’t available at the library. It was then surprising to me to find out, after some searching, that Terry had been writing for years and that Bearers of the Black Staff was preceded by a substantially large number of books within the same series. So I decided to start from the beginning with The Sword of Shannara and have been steadily reading the books since, at the moment finishing up the last book in The Heritage of Shannara, The Scions of Shannara.

Suffice to say, Brooks’ Shannara series isn’t the best fantasy work ever – or even to me personally when compared to some of the other works I have read, but it has been an enjoyable read and was a surprise to see that so many books had been written in the series before I even knew it existed. I look forward to reading it in its entirety.

If you haven’t read anything by Terry Brooks before, I personally recommend starting off with The Sword of Shannara. Mainly, it’s the beginning of his most recognized series, but also because it is also one of the better books in the series – at least of what I have read so far.

Ubuntu Unity: Keyboard Shortcuts and System Monitor

The Unity launcher is nice, and, like with Windows since version 7, you can pin – or “lock” – items to the launcher by right-clicking them when they’re running. For me, locking the System Monitor to the launcher was always one of the first things I had to do after setting up a new install of Ubuntu – though it could also be accessed by simply searching “system monitor” in the Unity dash. However, since upgrading to 13.04, I decided to try keeping a cleaner system, and that also meant not having a cluttered Unity launcher.

For me, some things are necessary to have on the launcher, such as my browser of choice, a link to LibreOffice and the files link to my Home directory. However, keeping things like Terminal and System Monitor seemed unnecessary, especially since there is already a shortcut to Terminal by default (CTRL+ALT+T). Being someone who was primarily a Windows user up until a little over a year ago, having a shortcut to an application that managed and monitored running processes was something I was used to and therefore depended on, and CTRL+ALT+Delete has always been the sacred keyboard combination for it. Luckily, setting up a keyboard shortcut in Unity to run its System Monitor isn’t difficult and only takes a minute to do, so long as you know the command for the shorcut.

  1. Go to System Settings > Keyboard and click on the Shortcuts tab.
  2. (Optional) If you’re assigning CTRL+ALT+Delete to open System Monitor, click on the System option under the category panel, click on Ctrl+Alt+Delete beside “Log out” and, when it says “New accelerator…” hit your backspace key to disable the shortcut.
  3. Click on Custom Shortcuts under the category panel.
  4. Click on the “+” icon below the shortcut list pane.
  5. In the field titled “Name:” type in the name of your shortcut (can be anything that tells you what it does).
  6. In the field titled “Command:”, type out the command you want the shortcut to process. In the case of running System Monitor, the command is gnome-system-monitor.
  7. Click on “Disabled” beside the name of your shortcut and when it says “New accelerator…” hit the key combination you wish to use for the shorcut on your keyboard, which you should then see listed in place of “Disabled” after you’re done.

Ubuntu Server: Adding Users to the Sudoers List

If you have ever ran an Ubuntu Server installation, you may be familiar with the /usr/sbin/visudo file, which lists everyone with super-user permissions on the system. The only user that is in the file with ALL permissions by default is root, which, by default, isn’t even accessible directly in current Ubuntu versions. Though the root user can be assigned a password so that logging in as root is possible, no one would recommend it – or at least no one that I have seen.

When you install Ubuntu Server, you create an initial user. This user is automatically placed in the sudoers group, which means this user can perform actions as the root user by using the command¬†sudo su¬† and providing their password. Perhaps you’ve wanted to create an additional user and add them to the list of sudoers so that, like your initial user, they can use the¬†sudo¬† command. Well, it only takes two commands to do this.

First, you create the user using the adduser command:

sudo adduser <username>

At this point, some tutorials online explain how to add this user to the /usr/sbin/visudo file with the same permissions as the root user. If you do this, you will practically be creating a duplicate root user who can do anything on the system. Instead, it’s best to simply add this user to the sudo group:

sudo adduser <username> sudo

If you exit your current terminal session, reopen the terminal and log in as the user you just created, you’ll notice that this user can also perform actions using the¬†sudo¬† command.

You can also check to see that the user is in the sudo group by viewing the groups users:

grep sudo /etc/group

Make sure the user is listed after your initial user and any other users you may have already added.

Similarly, you can remove a user from the group using the deluser  command:

sudo deluser <username> sudo

I recommend issuing the grep sudo /etc/group  command to ensure the user was removed as well.

Also, take note that the initial user created when installing Ubuntu 12.04 is added to the following groups as well, so if you’re intention is to create a user who is an ‘administrator’ on the machine, it may be wise to add them to all of the following groups.


To see the list of groups on your server, simply issue the command grep <username> /etc/group , where <username> is the user you initially created during system install. Of course, you can ignore the group with the same name as the user.

XAMPP with Ubuntu

If you want a nicely compiled web server to use for testing, nothing beats XAMPP. And if you use Windows, it’s even nicer with XAMPP Lite. It’s so convenient, you can even run the server from a USB thumb drive.

However, I’ve learned recently that Linux doesn’t have quite as many convenient options. If you wish to set up a web server on Linux, there are countless tutorials across the net on doing it. For me, I just wanted something that I could run and test some things when I needed to without having to upload it to a production web server. Not to mention, it’s faster when everything is on a local machine. I was hoping that a XAMPP Lite setup had been released for Linux, but I was unfortunately wrong. Unlike Windows, Linux would require XAMPP to be installed in the /opt/ directory, which is owned by root. This means my system user wouldn’t be able to access the directory and directly alter files/folders, at least not without steps that extend beyond the directions given on the XAMPP website.

First off, I followed the directions for installing XAMPP exactly as described on the website. At first glance, everything looks fine. However, once I tried to access FTP using the default nobody user, I realized something was wrong. It gave me a 550 permissions error. Initial searching online seemed to indicate that the error wasn’t typical with others, so I figured something must have gone wrong with the installation. I had also installed the most recent beta version. I decided to uninstall, download the latest non-beta version and install it. Everything, again, went as expected with no errors. Again, I logged in via FTP and found that I could not create directories or alter files due to insufficient permissions. Doing a little more troubleshooting, I found that the lampp/htdocs folder was actually solely owned by root, instead of being owned by the user nobody and the root group. The nobody user had no ownership of the directory or its contained files/folders and therefore no permissions to affect it. I logged into root via terminal and changed ownership of the lampp/htdocs to nobody and from there everything worked fine accessing the directory via FTP.

A different approach would have been to change ownership of the directory to my own system user, this way I could directly alter the files/folders through nautilus without even having to run the proFTPD server. Since I am using the web server for testing locally anyway, this would have been the way to go.

For reference, here are the terminal commands used.

For listing ownership of files within a directory:

ls -l <path>

If you are already within the directory for which you want to list ownership of subsequent files and folders, you can leave the <path> value empty.

For changing ownership of the htdocs directory:

chown -R <username>:<usergroup> /opt/lampp/htdocs

Using your username for both the <username>  and <usergroup>  values will be fine.

The reason I recommend XAMPP over other Linux web server packages for using as a test server is that it is the easiest to uninstall that I have seen. Deleting the /opt/lampp directory is all that has to be done for complete removal.

phpFreeChat and phpBB3: Better Group Identifying

When comparing all of the free or open-source software available for providing chat on a website that I have seen so far, I have personally found phpFreeChat to be one of the more impressive options. Though a new version is in the works (2.x), the first branch (1.x) is the most stable and contains the most features as of this moment.

Of those features:

  • the ability for anyone to create rooms (if enabled)
  • op status for administrating, as well as the ability to identify chatters by their credentials from various other site software (such as phpBB)
  • an assortment of theme options that are included, as well as the ability to customize with your own
  • private messaging

I don’t need to explain a great deal about phpFreeChat. You can learn almost anything you need to know about it from its official website and forums. However, what I did not find there and thought useful is a better way to identify chatters for granting op status based on their phpBB group(s). I typically use phpBB as a board in most scenarios.

Here is a copy of the basic chat setup from the phpFreeChat website for integrating with phpBB and using its user information for chatters:

define('IN_PHPBB', true);
$phpbb_root_path = (defined('PHPBB_ROOT_PATH')) ? PHPBB_ROOT_PATH : '../';
$phpEx = substr(strrchr(__FILE__, '.'), 1);
require($phpbb_root_path . 'common.' . $phpEx);

// Start session management

if ($user->data['user_id'] == ANONYMOUS)
	login_box('', $user->lang['LOGIN']);

require_once dirname(__FILE__)."/src/phpfreechat.class.php";
$params = array();
$params["title"] = "Quick chat";
$params["nick"] = $user->data['username_clean']; 
$params['firstisadmin'] = false;
if ($user->data['group_id'] == 4 OR $user->data['group_id'] == 5) // Admins and Moderators
$params["isadmin"] = true; // Do what you want cause a pirate is free, you are a pirate ;)

$params["serverid"] = md5(__FILE__); // calculate a unique id for this chat
$params["debug"] = false;
$chat = new phpFreeChat( $params );

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
  <meta http-equiv="content-type" content="text/html; charset=utf-8" />
  <title>Chicken Talk Chat Room</title>  
<div class="content">
  <?php $chat->printChat(); ?>


I have highlighted the lines that grant op status based on the user’s board group.

The method I now use was found by searching the phpBB boards for a way to determine whether a user is in a particular group. You may think this is what is already done in the phpFreeChat example of using phpBB to identify chatters to grant op status above, but what is actually being done there is the chat script is determining if one of the groups being checked is the user’s primary group. Because group assignment is an important way to identify a board user’s main role, it is not uncommon for users to be in multiple groups so that they can access multiple functions. For example, a particular user may be a board administrator, but his primary group is support – because that is his main function on the board. In this case, in order for the user to get op status in the chat, you would have to have the check be looking for the support group, because that is the group ID that will be seen here since it is the user’s primary group. Even though the admin group is being checked, only one group ID is being passed for the user in this case, and it is the user’s primary group only.

For the method that I prefer, follow these steps:

  1. Require the includes/functions_user.php file.

    require($phpbb_root_path . 'common.' . $phpEx);

    and add the following after it:

    require($phpbb_root_path . 'includes/functions_user.' . $phpEx);
  2. Use the group_memberships() function to identify an array of all of the user’s assigned groups.

    if ($user->data['group_id'] == 4 OR $user->data['group_id'] == 5) // Admins and Moderators
    $params["isadmin"] = true; // Do what you want cause a pirate is free, you are a pirate ;)

    and replace it with the following:

    if (group_memberships(array(4,5),$user->data['user_id'],true))
       $params["isadmin"] = true; // Do what you want cause a pirate is free, you are a pirate ;)

As that example is now, it is still only checking for the Administrator and Global moderator groups. However, you can add a group ID to the array within the parentheses and it will check for that group as well. Unlike the original method, this check will pass so long as the user is within one of the listed groups – not requiring the group to be the user’s primary group.

Also, if you wish to not require chatters to be registered and logged in on your board, you can do the following to allow guest chatting:

  1. Find:
    if ($user->data['user_id'] == ANONYMOUS)
    	login_box('', $user->lang['LOGIN']);

    and replace it with the following:

    $RequireLogin = false; // if true, will require chatter to be logged in on the phpBB board 
    if ($user->data['user_id'] == ANONYMOUS)
          login_box('', $user->lang['LOGIN']);

    Changing $RequireLogin to true will allow you to quickly revert back to requiring registeration and login without having to replace code again.

  2. Find:
    $params["nick"] = $user->data['username_clean'];

    and replace it with the following:

    if ($user->data['user_id'] != ANONYMOUS) $params["nick"] = $user->data['username_clean']; // phpBB nick used

    If this isn’t done and the $RequireLogin variable is set to false, the guest will be given the nick¬†ANONYMOUS. Otherwise, they are either prompted for a nick upon loading the chat or given a randomly generated guest nick – depending on your phpFreeChat configuration for that.

Orange Is The New Black

Work has kept my girlfriend and I from enjoying our usual getaway from the world to the streaming of Netflix, but we finally got around to it tonight while we ate dinner. Expecting to watch something from our typical list, we saw the unavoidable advertising for Netflix’s original series Orange Is The New Black. To be honest, I really expected this was going to be a pure-bred comedy. Even the synopsis gave me that impression. I won’t dare say that I knew otherwise even within the first two minutes, during which a brief montage of female nudity was put on display, which neither of us saw coming.

I’ll admit that I didn’t think the show was all that bad. I guess it’s probably not that surprising that my girlfriend found much less taste for it. Don’t think the abundance of female nudity is the reason for my interest in watching it again. Actually, I guess I am intrigued by the dramatic presentation of the prison life. Oz was a hit show a decade or so ago, but I didn’t get to watch it due to my lack of an HBO subscription – though I did manage to catch an episode or two during occasional opportunities. Still, the only thing I can remember about Oz is that the newspaper editor from the Spider-Man movies played a bald-headed paraplegic. That’s literally it.

But anyway. I wouldn’t say anything such as “Orange Is the New Black is one of the best new TV shows,” but I will say that it probably isn’t anywhere near being the worst. Plus, getting to see ol’ Captain Janeway from Star Trek: Voyager play a soviet kitchen-head is entertaining in itself, especially following my shock of seeing her on the whacky CN show NTSF:SD:SUV. Still, it’s worth a gander or two if you don’t mind slightly unrestrained nudity and sexual themes – which is common in most HBO/ShoTime series as well (eg.¬†The Tudors and¬†Spartacus) – or a casually-paced drama storyline.