Archive for the ‘Ubuntu’ Category
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.
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
This Tutorial is just a documentation of how I flashed my Samsung Galaxy S (I9000) using heimdall with Darky’s Rom v10.1, follow the steps at your own risk. I am in no way liable for any damage caused to your phone following these steps. I would advise reading up on flashing before proceeding along with pre-reading the guide first.
If you don’t know what you’re doing, you should probably not do it.
For more information, help and most anything check out xdadevelopers forum and DarkysRom.com
This guide is using a fresh install of Ubuntu 11.04 on a memory stick, I was unable to get heimdall installed on Fedora 15 or Ubuntu 10.04.
For this guide I will use Darkys Rom v10.1, however it should work for all ROMs that come with the correct files, as shown below.
Installing Heimdall
First install the Qt Gui libraries:
sudo apt-get install libqtgui4
Once that’s installed head over to the heimdall website and download heimdall and the frontend for it, here I went for version 1.1.1 as the latest version (as of writing this guide 1.2.0 does not have a frontend).
Here simply download the .deb file and run it once it’s downloaded, you should be able to install them no problem.
(direct links for the version used in this guide)
Heimdall – https://github.com/downloads/Benjamin-Dobell/Heimdall/heimdall_1.1.1-1_i386.deb
Heimdall-frontend – https://github.com/downloads/Benjamin-Dobell/Heimdall/heimdall-frontend_1.1.1-1_i386.deb

Getting The Files
Download the ROM you wish to flash your phone with, for example download Darky’s Ressurection v10.1.
Extract Darky_Resurrection_10.1_i9000.zip
Inside also extract Darky_Resurrection_10.1.tar
You should have the following files:
Darky_Resurrection_10.1_i9000 (folder)
- Darky_Resurrection_10.1 (folder)
- boot.bin
- cache.rfs
- dbdata.rfs
- factoryfs.rfs
- modem.bin
- param.lfs
- Sbl.bin
- zImage
- Odin3 v1.3,exe
- Odin3 v1.7.exe
- s1_odin_20100512.pit
Preparing Your Phone
Make sure you have full battery and disabled all lagfixes.
Flashing The Phone
Press Alt+F2 and then type “heimdall-frontend” and hit enter.
Add the files to the correct heidmall options as so:

Repartition
PIT : s1_odin_20100512.pit
PDA/Code
FactoryFS : factoryfs.rfs
Kernel(zImage) : zImage
Param.lfs : param.lfs
Primary BootLoader : boot.bin
Secondary Bootloader : Sbl.bin
CSC
Cache : cache.rfs
Database Data : dbdata.rfs
Other
Modem : modem.bin
Recovery : –
Finally put your phone into download mode.
Once your phone is in downloadd mode, make sure it’s connected via USB and then press start on Heimdall.
After a few minutes your Heimdall will say Finished. Boom you’re done. Just wait for your phone to finish doing whatever it’s doing and you should end up back at the home screen soon enough.

Open up the openbox config file, it should be located in /home/username/.config/openbox/ but if it’s not you might have to do a little digging.
nano /~.config/openbox/rc.xml
Find the following lines and remove or comment them out, you can use Ctrl+W in nano to find:
Note: XML comments are as follow:<-- Comment -->
Save with Ctrl+X, Y, Enter (if you’re using nano) and restart OpenBox (Preferences -> OpenBox Config -> Restart) and all should be done.

If you’re getting the following error while trying export a video under several different codecs in OpenShot including AVI, MOV and MPEG using (mpeg2, mpeg4 or h.264) chances are this might help you with that error.
The following formats/codecs are missing from your system:
libmp3lame
You will not be able to use the selected export profile. You will need to install the missing formats/codecs or choose a different export profile.
This is a simple fix:
- Open up Synaptic Package Manager
- Search “libavformat”,
- If the current package installed is “libavformat52″ select “libavformat-extra-52″ (alternativly “libavformat-unstripped-52″ should also work).
- Else the package might be “libavformat53″ so simply change to “libavformat-extra-53″, basically it might end in different numbers, it should work the same.
- Hit Apply and approve the changes.
Let’s say you’ve got a text file, of any size, big or small, and you want to remove every other line of that file, well here are a few commands in Linux that allow you to do this.
Example, you want to get from this:
1
2
3
4
5
6
7
8
9
10
To this:
1
3
5
7
9
The sed way:
sed -n "p;N;" file.txt > newfile.txt
The awk way:
awk 'NR%2 != 0' file.txt > newfile.txt
Here you can actually specify N lines, replace 2 in the above command and you’ll be able to take out every N’th number. As an example, here’s the above replaced with a 3 on the file:
1
2
4
5
7
8
10
Easy as pie, right?
Error:
end_request: I/O error, dev sr0, sector 537392
If you’re getting a similar error filling your screen once you’ve installed Ubuntu, don’t panic. It’s pretty common which is basically because Ubuntu (or any other Linux distro) can’t control your CD/DVD drive properly, it’s probably trying to open/close it but doesn’t know if it has or not. The problem is that you don’t get to see what Ubuntu wrote before because it’s filled your screen up with this error.
If you’ve just installed Ubuntu this probably happened when it wanted you to take the disc out and close the cd tray (if there is one) then hit Enter to finish the installation, so just do that and ignore this error.
|
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.
|