Tag Archives: Tricks

Oops, That Kernel Didn’t Work!

Being security conscious, I try to keep everything up to date. This includes the Linux kernel that is the heart of our systems.

In keeping with that, a few weeks ago I changed all of my Mint 17.3 machines to the kernel recommended in the kernel chooser.

Kernel chooser

Kernel chooser

As you can see above, I’m running the kernel recommended by Linux Mint. This went well for all but one of my machines. My bedside, 4 processor, 8 gigs of RAM machine seemed to run fine for a week or so, but I found that when running certain software packages; the computer would completely freeze. Anything to do with video or graphics would freeze at random times with no warning.

Scouring the logs was pointless, as the freeze happened before anything was logged.

At first I blamed a new wireless keyboard / mouse combo that was purchased at the same time. Putting a USB set back in, proved the wireless was not the cause.

Searching the Mint and other forums showed that many people were having the same problem I was. A combination of the processor type and graphics card seemd to be to blame.

By this time I had already removed the previous kernel, so it was time to put it back!

Open your Update Manager, click on View, and then select Linux kernels

In my case, I re-installed the 3.13 kernel that had been working flawlessly before. Of course if there are notes about security issues or regressions that could impact your system, then chose another.

Installing a different kernel

Installing a different kernel

Next you need to edit the GRUB config file, as I was booting quietly, not displaying the boot menu. To do that, simply drop to a terminal and edit it with your favorite text editor. I use medit

$ sudo medit /etc/default/grub

will open your text editor in super user mode.

Edit grub

Edit grub

Editing Grub

Editing Grub

You’ll see in the above example, I’ve commented out, using the # symbol, to have the boot process ignore the two commands at lines 7 and 8. Doing this, will now let me see the grub boot menu at startup. Save and close the file, and then, it’s very important that you tell grub that you’ve changed it. Do this by issuing the command:

$ sudo update-grub

Now it’s time to reboot. When you do, at the grub boot window, arrow down to Select previous Linux version, and select that.

Once you’ve booted up, and after you are satisfied that there are no issues with the new kernel, you can then go back into the update manager and un-install the previous kernel that was giving you fits.

Note: After much experimenting, I was able to upgrade to kernel 3.16, and maintain a stable machine!


Breaking Things: A New Mint Install Problem

One of the trials of experimenting with Linux, is that every now and then, I really mess things up! This past weekend, I managed to  cause some bad sectors on my hard drive while playing with some software that ended up freezing up. The hard reset of the machine caused the damage.

Fine, I’ll reinstall Mint 17 which won’t take long, and I do a complete backup to my ownCloud server automatically so nothing lost but a little time.

Once everything was restored to my liking though, I found a weird problem. My system was slow and sluggish, often freezing up for long periods of time. Opening the System Monitor found the problem quickly though. The program mate-settings-daimon was eating 100% of the CPU cycles on all 4 CPUs in my machine!

Some digging around found that it was a known bug that was supposed to be fixed, but I was sure having problems!

Digging through the Linux forums found it to be a common problem, even with Mint 17.1. The most common cause turned out to be the keyboard NUM lock, causing the extra compute cycles. Supposedly, going into settings and turning off NUM lock was supposed to fix the problem. Nope, that didn’t help.

What finally ended up being the problem for me, and perhaps for you, was that when my system installed, it set an important permission incorrectly.

In the /run/user/1000/dconf/ directory the file called use  was showing it was owned by root  but since I’m user 1000, it should have been owned by me!  As I watched the file, you could see it refreshing itself, dozens of times a second, eating all your CPU time Checking the logs, proved the permissions to be the problem as over and over, a Permission Denied message would display for that file..

Opening a terminal window in superuser mode lets us change the permissions. Use sudo caja   then right click on the file user and select Properties. Make yourself the owner of the file with full permissions and then close caja and reboot your computer.



My CPU time from mate-settings-daemon went from 99% to 0% as it should have. Now it only shows usage when it’s supposed to!


Software: Making LIfe Easier

I have a mostly blind mother, who loves to watch our  ustream channel on her gigantic projection TV. She enjoys being able to see me, as well as my interaction with the goats.

A  problem she was having though, is that if ustream goes down from a brief network outage, the browser dropped out of full screen, or locked up entirely; the video of the goats would be gone.

She can’t see the mouse cursor to get everything working again.

So today, using Teamviewer to access her computer ( I’m in a different part of the country)  I used a couple of tools I’ve mentioned to you before, to fix her problem. Those tools are the VLC media player, and the Python program called Livestreamer

The computer she’s using,  is devoted to the single task of showing the goats, so today, I  set it up so that’s all it will do!

First things first, was to open the VLC media player, select preferences, and tell VLC to always play in the full screen mode.

VLC Media player setup

VLC Media player setup

Next was to install the other software she needed. First was Python,  after which you use the Python package installer PIP, to install the Livestreamer software using the command:

# pip install -U livestreamer

The next thing to do is have the computer launch the Livestreamer command at startup. This is done in your Preferences menu, under Startup Applications

Startup Applications

Startup Applications

Startup Application listing

Startup Application listing

That done, I just issued a reboot command to the machine, and after it booted back up, Bob’s your uncle, she was watching the video stream, full screen!

Now if she loses her stream, all she has to do is reboot her computer, using a hardware button she can feel on her computer.


Breaking Things: When Updates Fail

Over the weekend, I allowed Linux to do an update. All was going well  until the Update Manager politely posted an error message:

Update Manager Error

Update Manager Error

You’ll notice the last line in the error message, unexpected end of file or stream, with the file name and location of the bad file.

All this means, is that during the download, the file was corrupted somehow. I blame my poor WiFi connection to this particular machine.

How to fix it? Easy, just clear your cache!

Open a Terminal Window and type this:  sudo apt-get clean

After you are asked for your password, the installation cache will be emptied, and you can then restart the Update Manager.

LInux will always tell you what is wrong, so read dialog windows carefully!


Python Is Your Friend

Today we learn about Python, a programming language and utility set that can add much functionality to your Linux installation.

Python Programming Language

Python Programming Language

Most Linux distributions include Python, and since we use Linux Mint on the farm, I’ll be basing everything on Mint, an Ubuntu off-shoot.

Python is already included in Ubuntu based Linux distributions, but there is a thing or two you will want to add. The first thing to do is to open a terminal window and install PIP, the Python script installer.

In your terminal, simply type: easy_install pip

Now, you are ready to start installing cool Python scripts. Today’s script is one we use every single day of the year. It’s called Livestreamer.

Livestreamer is a command line application that is used to launch the VLC media player and play just about any web video on your desktop, without using your browser!

To install Livestreamer, in your terminal window type: pip install livestreamer

After it’s installed, the fun begins. Next, in your terminal, you can now invoke Livestreamer with the location of your favorite youtube, liveleak or other video. We watch Jupiter Broadcasting a lot, so here’s an example to watch their live video feed, typed into your terminal:

livestreamer rtmp://jblive.videocdn.scaleengine.net/jb-live/play/jblive.stream best

Or to watch our goats:

livestreamer http://justin.tv/goatslive best

You can always get help with Livestreamer by typing: livestreamer –help

As time goes by, we’ll highlight other cool tools using Python.