Archive for the ‘blog1’ Category
It’s a pretty common problem, one which could be solved by pretty much the following sentence: ‘[Insert Linux Distro], [Insert Media Player] not stopping screen saver when playing videos.’ And, yeah, it’s very annoying. Something that should have been fixed thousands of releases ago, just like most common Linux problems. Luckily though there is a fix, it’s easy and it’s awesome.
Introducing: Caffeine, “An application to temporarily prevent the activation of both the screen saver and the “sleep” powersaving mode.” – https://launchpad.net/caffeine
Essentially what this program does is look for processes running on your machine (you can do this too, just run ‘ps -A’ in a terminal emulator to see a list of everything), so you set process names which the program should look out for, for example ‘vlc’ and when there is a process with this name Caffeine disables the screensaver, when the process stops the screensaver is re-enabled. It even comes with a little tray icon which allows you to manual enable or disable the screensaver/power management with a single click.
Installation (Ubuntu):
sudo add-apt-repository ppa:caffeine-developers/ppa
sudo apt-get update
sudo apt-get install caffeine
Usage:
You’ll be able to see if caffeine is running by the tray icon the first time you use it (this can be disabled in the settings).
[caption id="attachment_23469" align="aligncenter" width="225" caption="Caffeine Running (Screensaver / Power Management Enabled)"]  [/caption]
[caption id="attachment_23470" align="aligncenter" width="225" caption="Caffeine Running (Right Click Settings)"]  [/caption]
[caption id="attachment_23471" align="aligncenter" width="225" caption="Caffeine Running (Screensaver / Power Management Disabled)"]  [/caption]
Adding Processes:
To add a process which will disable the screensaver from being activated, for example VLC so we can watch a movie without constantly having to wiggle the mouse:
First, run VLC (or whatever other media player you wish and just replace VLC for that for the other few steps)
Next, right click on the Caffeine tray icon and select “Preference”.
Click the “Add” button.
[caption id="attachment_23473" align="aligncenter" width="403" caption="List of processes already disabling the screensaver, note Totem is added here."]  [/caption]
You should be greeted by a list of the running processes, select the name of the media player (this case, vlc) if it isn’t there check under the “Recent Processes” tab or alternatively just write the command you would use to run this program from the command line.
[caption id="attachment_23474" align="aligncenter" width="402" caption="Adding VLC to processes to disable the screensaver."]  [/caption]
Finally click the “Add” button and close the preferences window, that pesky screensaver should no longer be bothering you!
Stopping Flash from enabling the screensaver:
Okay, this is actually really easy, if you’re using Chromium or Google Chrome or Firefox, you’ll just want to add the processes ‘npviewer.bin’ to list, you can use the above instructions to do so.

Product: RGB OLED 160X128 Display
Manufacturer: Densitron
Price: £20.33 (At the time of this review.)
Datasheet: DD-160128FC-2A Datasheet | Farnell Mirror
EAGLE library: http://prusadjs.cz/eagle/OLED.lbr
The DD-160128FC-2A is a solid little screen, at around 4.3cm (from corner to corner) it’s perfect for displaying information on small mobile robots, a little serial terminal screen for desktops, wrist mounted electronics and a whole bunch more. The only issue with the design of the screen is that it doesn’t come with any mount holes, leaving the only real option of mounting this to a case or project box with glue on the back (which makes it not reusable) or sandwiching the displays edges between two layers (which could prove difficult with only a few millimetres border).
The display boasts a bright back-light thanks to the use of OLED (organic light-emitting diode) which also keep the power consumption low (3.3V input) making this an awesome little display for mobile use when a power supply isn’t available. The colours are surprisingly deep and vibrant for such a small display and there is no visible flicker from the refresh rate. The 160×128 resolution is easily enough to display around 10 lines each with 18 characters on, alternatively it would look great displaying a camera video feed or a slideshow of pictures.
An EAGLE library was created for this OLED screen which includes pin descriptions and correct sizing for those wishing to create their own PCBs for projects using this display. It can be found here.

For those wishing to use this product in conjunction with an mbed (more info here) someone (simonb, over at the mbed community) has created a driver for the “Densitron DD-160128FC-1A”, this should work perfectly well with this newer module screen and all the source code and much more information is available through the mbed website – here. This is a great library which allows you full control over colour, fills, text, individual pixels and even the orientation of the screen.
If you’d prefer not to attempt creating your own PCB and all that pesky soldering, or are not very good at soldering I strongly advise buying the breakout board for this screen (this can be found at Farnell here), it’ll allow you to develop and play around with the board much easier and it’s only around £15.
Densitron also offer a bunch of other screens with a range of sizes, resolutions and prices and due to the ease of use of their products they seem to be an ideal for hobbyists, students and anyone looking to prototype a product quickly. Check out their entire range over at Farnell – http://uk.farnell.com/densitron/
Keep tuned for more projects using this, all will include schematics and source code.
Continue reading Densitron – DD-160128FC-2A – Review

Product: RGB OLED 160X128 Display
Manufacturer: Densitron
Price: £20.33 (At the time of this review.)
Datasheet: DD-160128FC-2A Datasheet | Farnell Mirror
EAGLE library: http://prusadjs.cz/eagle/OLED.lbr
The DD-160128FC-2A is a solid little screen, at around 4.3cm (from corner to corner) it’s perfect for displaying information on small mobile robots, a little serial terminal screen for desktops, wrist mounted electronics and a whole bunch more. The only issue with the design of the screen is that it doesn’t come with any mount holes, leaving the only real option of mounting this to a case or project box with glue on the back (which makes it not reusable) or sandwiching the displays edges between two layers (which could prove difficult with only a few millimetres border).
The display boasts a bright back-light thanks to the use of OLED (organic light-emitting diode) which also keep the power consumption low (3.3V input) making this an awesome little display for mobile use when a power supply isn’t available. The colours are surprisingly deep and vibrant for such a small display and there is no visible flicker from the refresh rate. The 160×128 resolution is easily enough to display around 10 lines each with 18 characters on, alternatively it would look great displaying a camera video feed or a slideshow of pictures.
An EAGLE library was created for this OLED screen which includes pin descriptions and correct sizing for those wishing to create their own PCBs for projects using this display. It can be found here.

For those wishing to use this product in conjunction with an mbed (more info here) someone (simonb, over at the mbed community) has created a driver for the “Densitron DD-160128FC-1A”, this should work perfectly well with this newer module screen and all the source code and much more information is available through the mbed website – here. This is a great library which allows you full control over colour, fills, text, individual pixels and even the orientation of the screen.
If you’d prefer not to attempt creating your own PCB and all that pesky soldering, or are not very good at soldering I strongly advise buying the breakout board for this screen (this can be found at Farnell here), it’ll allow you to develop and play around with the board much easier and it’s only around £15.
Densitron also offer a bunch of other screens with a range of sizes, resolutions and prices and due to the ease of use of their products they seem to be an ideal for hobbyists, students and anyone looking to prototype a product quickly. Check out their entire range over at Farnell – http://uk.farnell.com/densitron/
Keep tuned for more projects using this, all will include schematics and source code.
(more…)
I have a TV and my monitor connected to my PC by a VGA switch box but what’s annoying is they aren’t the same resolution. This causes problems because I can’t see what I’m doing when I have switched to TV and usually have to leave the setting manager open so that when I change between them I just have to hit return and the resolution changes. That’s great and all but it’s far more effort than I want for something I do fairly often.
My plan was initially to create two xorg.conf files and switch between them using a script, I figured this would be the easiest way even though I haven’t messed around with xorg stuff for a few years ever since things just started working better in Linux. Turns out I couldn’t even find where they keep the xorg.conf file, it sure isn’t in /etc/X11 where it was the last time I looked..
On the search for this file though I came across another useful tool called xrandr, which essentially allows you to change the resolution from the command line.
Xrandr is used to set the size, orientation and/or reflection of the outputs for a
screen. It can also set the screen size.
If invoked without any option, it will dump the state of the outputs, showing the
existing modes for each of them, with a ‘+’ after the preferred mode and a ‘*’
after the current mode.
There are a few global options. Other options modify the last output that is spec‐
ified in earlier parameters in the command line. Multiple outputs may be modified
at the same time by passing multiple –output options followed immediately by
their corresponding modifying options.
For more information on xrandr check out the manual page (or type man xrandr in terminal).
It turns out it’s an extremely easy tool to use, with a command as simple as the following changing the resolution:
xrandr --output VGA1 --mode 1440x900
So the next thing I did was create the following script which allows the resolution to switch between 1440×900 and 1360×768 (my monitor and my TV native resolutions).
#!/bin/bash
TV="1360 x 768"
MONITOR="1440 x 900"
TEST="$(xrandr | grep current | sed -e 's/.*current //;s/, maximum.*//')"
#echo $TEST
if [ "$TEST" == "$MONITOR" ]
then
xrandr --output VGA1 --mode 1360x768
elif [ "$TEST" == "$TV" ]
then
xrandr --output VGA1 --mode 1440x900
else
exit
fi
This script simply checks what the current resolution is being used and then toggles between the two set resolutions.

After installing Ubuntu 11.10 I headed straight for an install of gnome-shell, I’ve been using it for a couple of months without any issue and got used to it enough that it wouldn’t impede on my workflow. That was until this release, when it was officially supported by Canonical and all of a sudden it’s broken and mostly useless. So off to Xfce I go, it’s like gnome2 but way more customisable and actually pretty sweet.
However because I installed from a clean Ubuntu install rather than an xubuntu install I noticed that I still have the global menu (or appmenu-*) floating at the top under the default panel. To remove it, since it’s doing nothing and it looks plain stupid with transparency added to the panel.
It’s pretty simple to uninstall, just open up a terminal window and use the following command:
sudo apt-get remove appmenu-gtk3 appmenu-gtk appmenu-qt
Now just re-start X (log out and in again, restart the computer) and when you return, it should be gone.
And if you ever feel the need to want it back, maybe you want to give unity another try then use the following command:
sudo apt-get install appmenu-gtk3 appmenu-gtk appmenu-qt
Source: http://www.addictivetips.com/ubuntu-linux-tips/how-to-disable-global-menu-in-ubuntu-11-10-tip/
The mediaplayer widget found on github, created by eonpatapon – (https://github.com/eonpatapon/gnome-shell-extensions-mediaplayer).
I’ve been searching for a while for a good, solid widget style thing that’ll sit in the top of the gnome-shell panel which can control the music that’s playing in banshee, rhythmbox or whatever else you want to use to play your tunes.
Installation:
1. First you’ll need to grab some dependencies:
sudo apt-get install git gnome-common gnome-tweak-tool
2. Next download the files from the git repository as below (this will download the folder to whatever directory you’re currently in, in terminal):
git clone https://github.com/eonpatapon/gnome-shell-extensions-mediaplayer.git
3. Once it’s finished download (it shouldn’t take too long it’s only about 2.30MB as of writing this guide), you’ll want to install using the following commands:
cd gnome-shell-extensions-mediaplayer
./autogen.sh --prefix=/usr
make
sudo make install
4. That’s it, it’s installed. Next you’re going to want to enable it, run gnome-tweak-tool and under extensions slide the newly installed extension to ON and it should appear next to the “Universal Access Settings” in the top right.

If when attempting to update software or install new software in Ubuntu you find yourself being asked to insert the installation/live CD or if you find the following errors while trying to update your sources the following should help fix this error.
W: Failed to fetch cdrom://Ubuntu 11.10 _Oneiric Ocelot_ - Release amd64 (20111012)/dists/oneiric/main/binary-i386/Packages Please use apt-cdrom to make this CD-ROM recognised by APT. apt-get update cannot be used to add new CD-ROMs
W: Failed to fetch cdrom://Ubuntu 11.10 _Oneiric Ocelot_ - Release amd64 (20111012)/dists/oneiric/main/binary-amd64/Packages Please use apt-cdrom to make this CD-ROM recognised by APT. apt-get update cannot be used to add new CD-ROMs
W: Failed to fetch cdrom://Ubuntu 11.10 _Oneiric Ocelot_ - Release amd64 (20111012)/dists/oneiric/restricted/binary-amd64/Packages Please use apt-cdrom to make this CD-ROM recognised by APT. apt-get update cannot be used to add new CD-ROMs
W: Failed to fetch cdrom://Ubuntu 11.10 _Oneiric Ocelot_ - Release amd64 (20111012)/dists/oneiric/restricted/binary-i386/Packages Please use apt-cdrom to make this CD-ROM recognised by APT. apt-get update cannot be used to add new CD-ROMs
E: Some index files failed to download. They have been ignored, or old ones used instead.
In order to fix this you’ll need to open up a terminal and type:
sudo nano /etc/apt/sources.list
Now you’ll see something similar to the following:

From here add a # to any lines starting with “deb cdrom:” then save and exit nano (Ctrl+X, Y, Enter).
Now from terminal type:
sudo apt-get update
You should now be able to install and update all the things without the need for a CD being mounted.
ifconfig eth0 | sed -n '/^[A-Za-z0-9]/ {N;/dr:/{;s/.*dr://;s/ .*//;p;}}'
So you want to display just your IP address and not all the other stuff that comes with using the ifconfig command. Then use the above command.
It’s useful if you need your IP address in a script but you don’t want to set a static address for your machine, it outputs just the IP address on a single line as shown below:

Okay so, with Google Plus just being released to a select few (and invites) you might be wanting to export all your Facebook photos, tagged and albums you’ve uploaded to Google+. There are several ways of going about this, a few webapps, apps and through Facebook itself, the problem is that most of these don’t work in Linux making it a little more tricky to do without switching to Windows or OSX or borrowing some ones laptop for a while.
Through Facebook Route:
This way is actually pretty easy, which came as a surprise to me since I would have though it be in Facebooks best interest to keep users there just because it’s too much hassle to change.
First head over to Facebook.com, login and make your way through the labrynth that is Facebook settings to
‘Account Settings’ > Next to ‘Download Your Information’ click ‘Learn more’ > click ‘Download’.
This way you’re going to have to wait for Facebook to process all your data, they’ll then send you an e-mail once it’s done to a download link. This is a compressed (ZIP) file which contains all your information from Facebook, in the Photos folder you’ll find all your pictures which can then be uploaded to Google Plus.
The problem with this way is that it can take a reasonable amount of time (a couple of days depending on how much information you have..) and I’ve had it fail on a couple of occasions.
Alternatively you can use the following:
The PhotoGrabber Option:
For this you’ll need a couple of dependencies installed, it’s a desktop app that downloads the files for you.
Install dependencies:
sudo apt-get install python python-tk
Install PhotoGrabber:
svn checkout http://photograbber.googlecode.com/svn/trunk/ photograbber-read-only
cd photograbber-read-only/
./pg.py
Once you’ve ran all that and the ./pg.py bit it should load up with the following:

Click Login and then proceed to login and allow PhotoGrabber to do its thing, once you’ve done that you’ll get to a screen similar to below with a code:

Copy and paste that into the PhotoGrabber window (you’ll need to use Ctrl+V no right click to paste) and then it’ll let you choose which photos to take. Once you’ve picked, hit Download and watch them download to the folder you specify. There’ll be a lot folders, one for each place you were tagged. Once it’s done you can upload them however you want to Google Plus otherwise just keep them.

In ROS (Robot Operating System) it’s really easy to publish variables to be used between nodes running on the same roscore however I was having some difficulty doing the same for arrays. The problem came when there was no real examples of how to use them, so here is a working example of std_msgs/*MultiArray in ROS.
Publishing:
[gist][/gist]
Subscribing:
[gist][/gist]
After installing Steam on my linux machine in wine I noticed a really annoy bug, the windows of steam are tiled across my screen as shown in the screenshot below.
Fix:
I managed to fix this by opening up the ‘Configure Wine’ program that comes with wine and under the Applications tab switching from Windows XP mode to Windows 7, this fixed this bug and I now also have system borders on the steam windows.

Installing Wine:
If you’re interested in getting steam installed I used this guide - https://wiki.ubuntu.com/UbuntuMagazine/HowTo/InstallingSteam – It’s pretty simple and only takes a few minutes to do. Below is a quick, simple breakdown of what that guide says to do.
Download wine:
sudo apt-get install wine
Download the steam installer from here:
http://www.steampowered.com/v/index.php
Copy over the tahoma.ttf font from a Windows install (or Download it here – http://source.winehq.org/source/fonts/tahoma.ttf ). Do this command from the folder you downloaded the font to.
cp tahoma.ttf ~/.wine/drive_c/windows/fonts/
(If it doesn’t work and says the folder is missing or somthing like that do the following and then re-do the cp)
mkdir ~/.wine/drive_c/windows/fonts/
Finally install Steam (Do this command in the directory you downloaded the Steam installer to):
msiexec /i SteamInstall.msi
|
About Hi, my name is Alex. I just got through studying Robotics at UWE and I am continuing to do a MSc by Research also in Robotics.
I enjoy a whole heap of things but on this website I mostly post linux, programming, machine vision and other similar topics.
You're free to redistribute anything you find on here, unless it states otherwise, as long as you are not selling it for profit and you link back to my site. Cheers.
Disclaimer Just to cover my ass.
Any information on this site is for informational purposes only, I take no responsibility for the accuracy, reliability, bla, bla or bla to it. Any information you use, you are using at your own risk. I am in no way liable for any loss, damage of data, hardware or anything else in connection with the use of this website.
|