Tuesday, January 15, 2013

Fedora 18 Review

Fedora 18 was released today so I thought I would take a quick look at it and share my thoughts.


Monday, January 14, 2013

Pear Linux 6.1 Video Review

With the release of Pear Linux 6.1 today, I thought I would give it a try and put together a quick video review. Let me know if this is something you find worthwhile and I may do more.


Saturday, January 12, 2013

How to Take Screenshots of the Login Screen in Ubuntu 12.10



Last month when I posted about installing multiple desktops environments within Ubuntu, I found myself needing to take a screenshot of the login screen. It wasn't immediately obvious how this could be done but after a bit of fiddling around I managed to find a good solution that I thought I would share. First off, you will need to make sure imagemagick is installed. Open the terminal and type:




  • sudo apt-get install imagemagick

After it installs we are going to create a script to take the screenshot for us. I like to keep my scripts in a folder called “Scripts” within my home directory but you can create it anywhere you like. In the terminal type:

  • sudo nano screenshot.sh

This will open nano, a simple terminal based text editor. On the first line type:

  • chvt 7; sleep 5s; DISPLAY=:0 XAUTHORITY=/var/run/lightdm/root/:0 xwd -root -out ~/temp.xwd; convert ~/temp.xwd ~/screenshot.png; rm ~/temp.xwd

This script will exit the console mode, wait for five seconds (you can change this to anything you like), capture the screen into a file called temp.xwd and finally convert it to a png. Now type ctrl-x to save the script. In order to run it however, we will need to make it executable, so type:

  • sudo chmod +x screenshot.sh

Now log out of your session and once you are back to the login screen type ctrl-alt-1 to open the console mode. You will have to login with your username and password, and then navigate to the folder where the script is located and type:

  • sudo ./screenshot.sh

Enter your password and the script will boot you back into lightdm and after five seconds it will capture the screen. To see the image log back in to ubuntu and navigate to your home folder. There you should find a new file called screenshot.png

Thursday, January 10, 2013

Removing Unsupported Game Entries from Steam Beta

I’ve been playing around with steam beta for linux a bit this week and I am super excited to see this amazing project working so well in Ubuntu. After adding some games I purchased from the Indie Humble Bundle I noticed a little bug that I thought I would touch on. When you view your list of “Linux Games”, Steam will show games that are compatible with linux but unfortunately not all of them are officially supported yet. The easiest way to check if the installation will work is to click the install button and on the window that pops up, check if the disk space required information is visible. If it is blank, like the screenshot below, it will likely not install properly.


If you have accidently installed an unsupported game, steam will throw an “invalid app config“ error when you try to run it. To get rid of the application entry do the following. Make sure steam is closed then open a terminal and navigate to ~/.local/share/Steam/SteamApps/common .Then type the following:


  • rmdir {name of game}

in my case it was:

  • rmdir snapshot

This will remove the directory. Next navigate to ~/.local/share/Steam/config/ and type:

  • sudo nano config.vdf

This will bring up the text editor. Find the section called “apps” and locate the block that references the game you wish to remove. It will start with a number code followed by an open and closed curly brace. Check the “Installdir” section for clues to which entry is which. Write down the number code before continuing. Delete the entire entry, including the number code, the open and closed curly braces and everything in between them. In my case I deleted:

"204220"
{
    "installdir" "~/.local/share/Steam/SteamApps/common/snapshot"
    "HasAllLocalContent" "1"
    “UpToDate" "1"
}

Press ctrl+x to save and then navigate back to ~/.local/share/Steam/SteamApps/ Now type:

  • rm appmanifest_{number code}.acf

in my case it was:

  • rm appmanifest_204220.acf

Now start up steam and it will no longer think you have the game installed.

Saturday, December 15, 2012

Raspberry Pi - Daily Deviations Picture Frame



I have been following the progress of the Raspberry Pi with keen interest for a while now and I’ve finally got one of my own to play with. Over the past couple of weeks I’ve been tinkering with it in the evenings and I’m absolutely blown away by this little device. With a $35 dollar price tag, the RPi is a surprisingly capable computer. You obviously won’t be doing some of the CPU intensive tasks you would be used to on your PC, but its a great way to tinker and learn and maybe find a great practical use for it along the way. After a little trial and error I’ve found an interesting application for it that I wanted to share.

I’ve seen a few people contemplating using the Raspberry Pi to power a photo frame for the living room. One of those digital picture frames that cycles through a bunch of pre-loaded jpgs of your friends and family. This gave me the idea of having a piece of art hanging on the wall, with a nice wooden frame, that actually downloads new art everyday and cycles through it. So I’ve come up with a fairly simple way to do this all without ever starting X.

I would just like to clarify a few things first. This solution relies on a few bash scripts, and this is my first experience making them. I’ve really been piecing together bits of commands that I have found all over the web. I am by no means an expert and this method is probably not the best way to achieve the end result. In saying this, if you know of a better way to get this job done, by all means leave me a comment as I would love to hear your ideas.


What it does

When the RPi is turned on it boots up, deletes all jpg’s and png’s in the directory /home/pi/deviant/, downloads the daily deviations from deviantart, deletes any that aren’t a jpg or png (gifs and other files don’t work yet) and begins a slideshow using the framebuffer. At midnight the slideshow is halted, the RPi is rebooted and the cycle starts over.

What I used

Raspberry Pi Model B
8GB SD Card
Rapbian Wheezy

How it works

After you have a fresh install of raspbian wheezy on your SD Card, pop it into your RPi and boot it up. There is a little wizard at the beginning that walks you through a few simple startup options. I chose to expand root partition to fill SD Card, changed the keyboard layout to us, changed my timezone to Edmonton and changed start desktop at boot to no. After a reboot the RPi will take a few minutes to resize the root and then it will ask you to login. The username by default is pi with a password of raspberry. Every time the device is turned on it will ask you to login, and for our purposes this is not ideal. We want the user pi to be automatically logged in upon boot. Here is how we do that:
  • sudo nano /etc/inittab


This will open nano as root, which is a terminal based text editor. Scroll down until you find the following line:

  • 1:2345:respawn:/sbin/getty --noclear 38400 tty1

Add the pound sign to the beginning of this line to comment it out and add the following to the line beneath it:

  • 1:2345:respawn:/bin/login -f pi tty1 </dev/tty1 >/dev/tty1 2>&1

Please note that I've used the default user "pi". If you are using a different user name use that instead. Press ctrl+x to exit, type Y to save and enter to confirm filename. Now type

  • sudo reboot

The RPi will reboot and if you did everything right, it will now automatically login as user pi. The next thing we will need to do is install fbi (Linux FrameBuffer Image Viewer). To do this type the following:

  • sudo apt-get update
  • sudo apt-get install fbi

The next thing we have to do is create the scripts that will do the work. Make sure you are in the home directory and type

  • mkdir deviant

This will create a new directory within your home folder called deviant. Change into this newly created directory and type

  • sudo nano getart.sh

Once nano is open we will enter the commands to remove any images from the deviant directory.

  • rm *.jpg *.png
  • rm aa.*

The aa.* will make sense later. Next we will enter the commands to download the daily deviations from deviant art:

  • wget -U 'SomeUserAgent/1.0' -O- 'http://backend.deviantart.com/rss.xml?q=special:dd' 2> /dev/null |

  • grep -Po 'http://[^.]+\.deviantart.com/art/[^"]+-\d+' |

  • sed -r 's/.+-([0-9]+)/http:\/\/www.deviantart.com\/download\/\1\/aa/' |

  • wget -U 'SomeUserAgent/1.0' -i-

This will download the files and name them aa.1, aa.2, aa.3, etc. sequentially so we need to now go through each file and rename it or delete it depending on its file type:

  • FILES=~/deviant/*
  • count=0
  • one=1

  • for f in $FILES

  • do

  • file -b $f

  • echo "Checking file number $count"
  • count=$(($count + $one))

  • if [ "$(file $f|grep JPEG)" ]; then
  • mv ${f} ${count%.*}.jpg



  • elif [ "$(file $f|grep PNG)" ]; then
  • mv ${f} ${count%.*}.png

  • elif [ "$(file $f|grep ASCII)" ]; then

  • echo ”Skip Script file”

  • else
  • rm ${f}

  • fi
  • done

This will go through each file in the directory and either rename, skip or delete it depending on if it is a jpeg/png, script, or anything else. The last line will execute the slideshow script we will write next:

  • bash /home/pi/deviant/slideshow.sh

Now type ctrl+x to save. Next we will create the slideshow script. Type the following:

  • sudo nano slideshow.sh

Once nano has opened enter the following command:

  • fbi -noverbose -m 1920x1080 -a -t 10 /home/pi/deviant/*.jpg /home/pi/deviant/*.png

Now type ctrl+x to save and the slideshow script is done but there is one problem. My screen resolution is 1920 x 1080 so I have set the mode to 1920x1080 but this probably won’t actually work right until we add this mode to the system. You can customize this part to whatever works best for your set up. Type the following to add a mode:

  • sudo nano /etc/fb.modes

Now scroll to the end of the page and enter the new mode:

  • mode "1920x1080"
  • geometry 1920 1080 1920 1080 32
  • timings 0 0 0 0 0 0 0
  • accel true
  • rgba 8/16,8/8,8/0,0/0
  • endmode

Now type ctrl+x to save the file. There is one more script to create before we move on. This one is a simple reboot script. Type the following:

  • sudo nano rboot.sh

Once you are inside nano enter the command:

  • sudo reboot

Crtl+x to save and now we have to make these three scripts executable. Type the following commands:

  • sudo chmod +x getart.sh
  • sudo chmod +x slideshow.sh
  • sudo chmod +x rboot.sh

The purpose of the rboot script is to reboot the RPi at midnight everyday. To accomplish this we are going to use cron which is a handy tool for scheduling tasks. First we must start cron at every bootup. Enter the following:

  • sudo nano /etc/rc.local

When the script opens in nano we want to add the following two lines on the line above exit 0.

  • /etc/init.d/cron start
  • bash /home/pi/deviant/getart.sh

Ctrl+x to save. This will start cron and execute the getart script every time the RPi is booted up. Now the final step is to schedule the unit to reboot at midnight everyday. To do that type the following:

  • crontab -e

We need to enter the following command in nano:

  • @midnight /home/pi/deviant/rboot.sh

Again Ctrl+x to save and we are done. Type:

  • sudo reboot

The system is now up and running. So as I mentioned before, there is probably a better way to do some of this stuff and I’ll keep tinkering with it, but it should give you at least a starting point for creating a really simple image viewer.

Saturday, November 24, 2012

Install Multiple Desktop Environments in Ubuntu

As I was testing different distributions I was really blown away at the variety and quality of the different desktop environments. I was incredibly impressed by how robust and powerful some were, such as KDE, and how functional and sleek others were, like Cinnamon. While I did eventually decide to settle on Ubuntu because of their massive user base and application support (Steam, Lightworks, etc.), it was not an easy decision to make, mostly because of how much I had enjoyed many of these desktop experiences. I could really see how certain desktops would be perfect for certain tasks, and finding one that was good for all tasks was almost impossible, at least for my multifaceted workflow that is. Wouldn’t it be great if you could use Ubuntu as a base and choose which desktop environment happens to suit your current needs. Well, as it turns out, you can and it’s actually incredibly simple to do. I want to give a quick run through of how I setup my Ubuntu 12.10 system to allow me to choose between my favorite desktop environments at login.

Unity

This one comes standard with a new install of Ubuntu 12.10 and while it gets a lot of mixed reviews, I actually really like it. It’s a great interface for when I’m working with web applications. With web app support for google docs, reddit, google+ and many more, I find myself using Unity when I’m in a browsing mood. No special steps required to get this one rolling.

LXDE

This is a super lightweight, low profile desktop environment. It loads up insanely fast and takes very little system resources to run. Although I wouldn’t say it’s exactly beautiful to look at, when I need to get some real computing done, thats the last thing I care about. I have been playing with Blender over the past couple of weeks and I could definitely see the benefit of this option when building and rendering complex scenes. To get this desktop simply open the terminal and enter the following:

  • sudo apt-get install lxde

KDE

I’m still discovering all the awesomeness that is kde. I love the idea of activities and could see this being incredibly helpful. I also found it really useful for setting up application menu entries, which I discovered totally by accident. I had downloaded the latest blender release from blender.org (not from the ubuntu software centre) and extracted the files to a folder in my home directory called “Blender”. Although I could start the application by double clicking the blender executable file, I wasn’t able to see it in my application lens. Not the end of the world, but something I wanted to eventually rectify. After installing kde and booting it up, I dragged that same blender executable file to the main panel, right clicked it and chose "icon settings". After clicking on the icon within the next window I was able to browse to the svg file that blender provides in the package and the icon was applied to the file. Interestingly, when I had switched back to unity, blender now shows up with it’s beautiful vector icon in my application lens. I would encourage everyone to at least try kde, it’s a bit of a bigger download (around 300MB) so if you are really low on storage keep that in mind. To install it just open the terminal and enter:

  • sudo apt-get install kde-plasma-desktop

Cinnamon

I was really impressed by this desktop. I was immediately comfortable moving around its workspace, and everything just felt good. I think this desktop is a great option for those switching from windows as its layout will feel pleasantly familiar. It’s simple yet elegant and puts the focus on the applications you are running. To get this desktop up and running, just open the terminal and enter the following:

  • sudo add-apt-repository ppa:gwendal-lebihan-dev/cinnamon-stable
  • sudo apt-get update
  • sudo apt-get install cinnamon

Chrome OS

I had been curios about google’s chrome operating system for a while, so when I saw that it was possible to install it on Ubuntu I just had to give it a shot. I think it only works on a 64 bit system, so make sure that’s what you’re running. Open the terminal and enter the following:

  • wget https://github.com/downloads/dz0ny/lightdm-login-chromeos/lightdm-login-chromiumos_1.0_amd64.deb
  • sudo dpkg -i lightdm-login-chromiumos_1.0_amd64.deb

Cleaning Up the Login Screen

So now that we have a variety of desktops installed, it’s time to try them out. Just log out of your session to get back to the login screen. From here click on the little Ubuntu logo to see all your options. You will probably notice that there is a bunch of desktops that got added that you may not need or want as it can start to get a little cluttered, not to mention unusable if you are on a low resolution monitor. For example, after installing cinnamon, I noticed there were two versions available in the list; Cinnamon and Cinnamon 2D. After using Cinnamon, and seeing that it loaded and worked great, I wanted to remove Cinnamon 2D from the list (along with a few others) and to do this is fairly easy. Just log back into any of your desktop environments and open the terminal. The different options are stored in *.desktop files within the folder /usr/share/xsessions. To remove desktop entries from the login menu, you simply need to rename the ones you don’t want. In the terminal navigate to the folder and rename the appropriate files:

  • cd /usr/share/xsessions
  • sudo mv cinnamon2d.desktop cinnamon2d.desktop.bac


Continue this method for all the options you wish to remove and the next time you log out, you will see the change. To get an option back just rename it back to the original:

  • cd /usr/share/xsessions
  • sudo mv cinnamon2d.desktop.bac cinnamon2d.desktop




Wednesday, November 21, 2012

Fixing Broken NVIDIA Drivers in Ubuntu

Once I got Ubuntu installed I ran into a few issues with the NVIDIA drivers. One of top suggestions people have when starting Ubuntu for the first time is switching to the newest graphics driver. By default the system is set to use the Nouveau driver and for me it worked great without any issue. However when I would switch to any of the other drivers, upon reboot, the login screen would come up a very low resolution and unity wouldn’t pop up at all. I was able to right click the desktop and choose “change desktop background” to get into the settings and change it back, but I couldn't figure out why none of the other drivers worked. After a bit of research and playing around I have discovered a fix to the problem. I needed to install the kernel headers in order to make it work. I opened the terminal and entered the following:

  • sudo apt-get install linux-headers-$(uname -r)

After I entered my password the headers were installed and I switched to the NVIDIA driver and rebooted. This has fixed the issue and I can now successfully use all the NVIDIA drivers.