Showing posts with label ubuntu. Show all posts
Showing posts with label ubuntu. Show all posts

Tuesday, 13 March 2012

Ubuntu 11.10 - Cannot add new item when editing main menu

I still use the old school "Main Menu" editor AKA Alacarte to create new application launchers. Unfortunately, there is a bug that means that alacarte doesn't know about all of it's dependencies. This means that if you just install alacarte, and run "Main Menu", most of the buttons (including New Item) don't work. The solution is to manually install gnome-panel as well e.g.
sudo apt-get install alacarte gnome-panel

Saturday, 12 November 2011

Problems cloning a GitHub repo using Egit on Eclipse 3.6.2 Helios


Eclipse 3.6.2 Helios
Egit 1.1.0
Ubuntu 11.10 Oneiric Ocelot

ERROR: when adding public repo (on github) to clone, does not accept SSH key password (just keeps asking for it again and again)

SOLUTION: https://bugs.eclipse.org/bugs/show_bug.cgi?id=326526
Then add to your .bashrc:
export GIT_SSH=/usr/bin/ssh
(and reload it with a "source .bashrc")
If it still doesn't work, try re-creating SSH keys through eclipse (Prefs>General>Network>SSH2) and use those keys for authentication (you have to add the public key to github again)


ERROR: on commit:
Unhandled event loop exception
No more handles [MOZILLA_FIVE_HOME='/usr/lib/xulrunner-addons'] (java.lang.UnsatisfiedLinkError: Could not load SWT library. Reasons:
/home/jack/programs/eclipse_v3.6.2/configuration/org.eclipse.osgi/bundles/203/1/.cp/libswt-mozilla-gtk-3659.so: libxpcom.so: cannot open shared object file: No such file or directory
no swt-mozilla-gtk in java.library.path
Can't load library: /tmp/swtlib-32/libswt-mozilla-gtk-3659.so
Can't load library: /tmp/swtlib-32/libswt-mozilla-gtk.so
/tmp/swtlib-32/libswt-mozilla-gtk-3659.so: libxpcom.so: cannot open shared object file: No such file or directory
)

SOLUTION: Ensure you have sun java installed: http://www.multimediaboom.com/how-to-install-java-in-ubuntu-11-04-natty-narwhal-ppa/
Then install xulrunner-1.9.2 (NOT v2.0) manually by downloading it from here (you will need to navigate to your version of ubuntu first, if it is not 11.10 Oneiric):
https://launchpad.net/ubuntu/oneiric/i386?text=xulrunner
Then install with this command:
sudo dpkg -i file.deb
Then add this line to your .bashrc:
export MOZILLA_FIVE_HOME=/usr/lib/xulrunner-1.9.2.17
(and reload it with a "source .bashrc")



ERROR: on push:
fatal: cannot exec '/home/jack/programs/eclipse_v3.6.2/plugins/com.aptana.git.core_3.0.0.1303919605/os/linux/askpass.tcl': Permission denied
SOLUTION: just change permissions to 777

NEXT ERROR:
exec: 3: wish: not found
SOLUTION: http://sysadmin.circularvale.com/desktop-config/getting-git-working-in-aptana-on-ubuntu/
Basically install these packages: tk and python-tk

Sunday, 16 October 2011

Ubuntu 11.10 - Show Desktop Keyboard Shortcut

I couldn't find the keyboard shortcut / hotkey for minimising all windows. Turns out it was renamed to "Hide all normal windows". This can be found in Keyboard settings, under the Shortcuts tab.

Wednesday, 28 September 2011

Ubuntu 10.04 Lucid - notify-send in crontab not working

Alternative title: How to harness Ubuntu's black notification bubbles to set yourself repeating reminders

I recently found the wonderful command notify-send, which you can use to create those black Ubuntu notifications in the top right of the screen e.g. notify-send "Message Title" "This is my message." (you may need to install libnotify-bin). I then tried to shove this in my crontab to remind me to do stuff (e.g. take a short break every hour) but it didn't work.

Turns out that from the crontab, you have to tell it which DISPLAY to use, and luckily this turned out to be quite simply. All you need to do is add this prefix: DISPLAY=:0.0. So my crontab now looks like this:
# m h dom mon dow command
0 * * * * DISPLAY=:0.0 notify-send "Have a break" "Have a Kit Kat"

Thursday, 8 September 2011

Ubuntu 10.04 Lucid - Keyboard Shortcut to move window to other monitor (output)

I have a dual-monitor setup, and have always wanted to be able to move a window to another screen using a keyboard shortcut / hotkey. Turns out it is really easy:

CCSM (Compiz Comfig Settings Manager) > Put > Put to next output

I set it to <Ctrl><Alt>Enter

Thursday, 18 August 2011

Google Chrome on Ubuntu 11.04 Natty - Your profile could not be opened correctly

For me this was due to ghost chrome processes still running. Close chrome, and type:
ps aux | grep chrome
I had output like this:
16660 ?        00:00:15 chrome
16666 ?        00:00:00 chrome
16668 ?        00:00:00 chrome
18159 ?        00:00:11 chrome
18165 ?        00:00:00 chrome
18167 ?        00:00:00 chrome
Then kill em all!!! e.g. to kill the first one (process id 16660), type:
kill 16660
Then when you restart chrome, it should be able to load your profile properly again.

Monday, 27 June 2011

Gnome-do Suspend not working in Ubuntu Lucid 10.04

I love Gnome-do, but the version in the Lucid repo stopped at 0.8.3.1 (and 0.8.2.1 for gnome-do-plugins), which had a bug that meant Suspend didn't work (from the Session Management plugin). After noticing this had been fixed in a later version, I resorted to grabbing the latest version of the source code and compiling it myself. This was a surprisingly easy task.

1) Get the dependencies (including Bazaar which you need to download the source code)
sudo apt-get install bzr
sudo apt-get build-dep gnome-do
sudo apt-get build-dep gnome-do-plugins
2) Download the source code
bzr branch lp:do gnome-do
bzr branch lp:do-plugins
3) Install (do this for both of the new directories)
cd gnome-do
./autogen.sh
make
sudo make install
4) Restart gnome-do and enable GNOME Session Management plugin

Note: I actually left the old repo versions installed, in the hope that there may be some dependencies fulfilled. Hopefully this wont cause any headaches in the future (it hasn't so far).

Sunday, 5 June 2011

Ubuntu 11.04 Natty - Slow Alt+Tab Window Switcher

If you regularly use the Alt+Tab window switcher, and find it is annoyingly slow to launch, simply go into the Compiz Config Settings Manager (you will need to install this if you havent already - it's in the repos), and look under Window Management > Static Application Switcher and then click the Behaviour tab, and set the Popup Window Delay to 0.

Rather odd that it would be set to anything else if you ask me...

Friday, 20 May 2011

Ubuntu 11.04 Natty - Changing the Number of Workspaces

OS: Ubuntu 10.04 Natty Narwhal

By default, Natty comes with 4 workspaces, which you can view by clicking the Workspace Switcher icon in the Unity Launcher. I personally don't like using multiple workspaces, so I wanted to change this to 1, so I didn't accidentally move windows to hidden workspaces (with hotkeys etc.) never to find them again. Others of you may want to reduce the number to 2, or even increase the number. An easy way to do this is with the Compiz Config Settings Manager, but if you don't have this installed, you can do it with gconf-editor.
  1. Hit F2 and type gconf-editor
  2. Navigate to apps > compiz-1 > general > screen0 > options
  3. Update the number of workspaces by changing the values of the variables hsize and vsize, which represent the horizontal and vertical number of workspaces respectively (I set both of mine to 1)
Note: if like me you only want to have 1 workspace, you probably will also want to get rid of the Workspace Switcher icon in the Unity Launcher. Once you have followed the above instructions, all you have to do is log out and back in again and the icon will be gone!

Wednesday, 18 May 2011

Banshee Notification Area Icon in Ubuntu 11.04 Natty

My favourite extension for Banshee is called Notification Area Icon, which lets you control Banshee from an icon in the panel (left click will restore / minimise to tray, and right click will give you music controls). Unfortunately this stopped working after I upgraded to Ubuntu Natty.

To get it working again, you need to put Banshee in the Unity panel whitelist, which you can check with the following command.
gsettings get com.canonical.Unity.Panel systray-whitelist
Mine read as follows:
['JavaEmbeddedFrame', 'Mumble', 'Wine', 'Skype', 'hp-systray', 'scp-dbus-service']
To update this, you must append 'banshee' to the end of the list, and set it like so:
gsettings set com.canonical.Unity.Panel systray-whitelist "['JavaEmbeddedFrame', 'Mumble', 'Wine', 'Skype', 'hp-systray', 'scp-dbus-service', 'banshee']"
And then you will need to do a restart.


REFERENCES
http://fossplanet.com/f10/%5Bbug-777112%5D-%5Bnew%5D-notification-area-icon-not-working-ubuntu-11-04-banshee-2-0-0-a-154634

Adding a Custom App to the Unity Launcher

OS: Ubuntu 11.04 Natty Narwhal

I use a custom version of Eclipse, which I simply download from their website, extract to somewhere in my home directory, and then I can run the executable. If you want to integrate something like this with the new Unity launcher in Natty, you can do so by following the instructions below:
  1. Open the dash and run "Main Menu".
  2. Create a "New Item" in a suitable location (e.g. Applications > Programming).
  3. Leave the Type set to Application. Give it a nice readable Name, and then for the Command, simply type the path to your executable. You can also add an icon by clicking the springboard button.
  4. You should then be able to invoke the Dash, and type the Name you entered before, and your app should appear. You can then drag it into the Launcher.

Friday, 22 April 2011

Wireless Sync Music between Ubuntu PC and Android Phone

PC: Linux - Ubuntu 10.10 Maverick
Phone: HTC Wildfire with HTC Sense for Android 2.2 Froyo

I have been looking for a good way to wirelessly sync music to my phone for ages. I tried various android apps that failed to meet my needs in one way or another:

-Winamp - need winamp client on PC - no version for linux
-DoubleTwist (AirSync) - only for iTunes
-Android Sync Manager WiFi - PC client requires winXP or above
-Dropbox - must upload all music to internet first (when dropbox syncs on PC), which takes AGES, AND cannot auto-download anything - have to select each song and long press>download (BUT could work with additional app "Sync Folder with Dropbox")
-SugarSync - no Linux client
-ZumoDrive - same as dropbox in that have to upload everything to the cloud first, and cannot auto sync a particular folder on android, so would have to manually download all songs

And then I found Syncness. It doesn't require a PC client as it connects straight to network shares over your WiFi. Requires minimal setup (see below), and then you can have a directory of music on your PC automatically syncing to your phone every night (or just manually whenever you want). It costs about £1, but is well worth it.


SETUP

Put some music in a dir on your PC, and share it: R click > Sharing Options (then it might ask you for permissions to install some sharing libs). Now open Syncness on your phone and create a new profile and give it a name e.g. Music. Click the "Share" folder icon, and let it scan your network for shares, and then select your share from the list. Next click the "Local" folder icon and select your Music dir (if you don't already have one, you may need to connect your phone to your PC and create it first). Set "Sync Type" to "Push To / Pull From Remote", check "Active" (so it appears in your "Active profiles" list), and also check "Allow file deletions", so it can wipe old music you don't want any more. Then enter your Ubuntu name/pass (I left Domain blank), and do Menu > Save. Then you can setup a sync schedule if you want, but I don't change my music that often, so I just do it manually by pressing the big blue SYNCHRONIZE button on the home-screen.

Tuesday, 22 February 2011

PHP Logging on Ubuntu 10.04 Lucid

PHP CONFIGURATION
Enable PHP logging by setting up the appropriate variables in your php.ini. If you don't know where your php.ini file is, try the command: locate php.ini, mine was here: /etc/php5/apache2/php.ini:
error_reporting = E_ALL & ~E_DEPRECATED
log_errors = On
error_log = /var/log/apache2/php_errors.log
EXTRA: if you want to show PHP errors on screen, set:
display_errors = On
To finish, we restart apache: sudo /etc/init.d/apache2 restart


PERMISSIONS
Then find out what your apache user is called: ps aux | grep apache (mine was www-data), and ensure that user has full permissions on the log file directory (/var/log/apache2/). The best way to do this is ensure the user has group access i.e. either add the user the group currently assigned to the directory, or change the directory's group to one that the user is in! On my system, the directory had the group: adm, and so I added www-data to that group (see /etc/group). You then need to give the directory full permissions for group access: sudo chmod 770 /var/log/apache2/

To register these changes, we need to log out and back in again.


TESTING
An easy way to generate a PHP error is to call an undefined function i.e. put this PHP code into one of your pages:
a_function_that_doesnt_exist();
Now when you visit that page, you will either get a PHP error on screen (if you enabled that), or your browser will just display a 403 error, but importantly, your new log file php_errors.log should have been created and had it's first error logged.


INLINE PHP CONFIGURATION
One other method worth noting is inline configuration. During development, you may decide you want to temporarily enable showing errors on the screen for a particular page. The easiest way to do this, is simply to add this line of PHP to the top of your PHP file:
ini_set('display_errors', TRUE);

Wednesday, 26 January 2011

Installing Sass on Ubuntu 10.04 Lucid

Sass is a CSS extension that enables you to use variables, nested rules etc. To install it, see their website. If like me, you just try the first command they give you before installing ruby, you will get this:
The program 'sass' is currently not installed. You can install it by typing:
sudo apt-get install libhaml-ruby1.8
Don't do as it says and install libhaml-ruby1.8, as you end up with an old version of Haml/Sass: 2.2.17. Instead, you first need to install Ruby and RubyGems, which is simple:
sudo apt-get install rubygems
Next, we install Sass using RubyGems (thanks for tip from Boyd Hemphill):
sudo gem install sass
You should now have Sass installed, but if you try to use it, you may still get the original "not installed" message. This is because annoyingly the RubyGems binaries directory is not automatically added to your PATH. To do this, I simply added the following to the end of my ~/.bashrc file:
export PATH=$PATH:/var/lib/gems/1.8/bin
Then restart your terminal and that should be it. You can check that it installed successfully, and that you have the latest version with the following command:
sass -v
I get the following output: Sass 3.1.15 (Brainy Betty). You can then follow the rest of the tutorial on their website to start compiling .sass files into .css files.

Additionally, see this blog post for a great walk-through in refactoring existing CSS to Sass.

Saturday, 23 October 2010

Disable Alt+Space from activating the window menu in Ubuntu 10.10 Maverick

I wanted to change my Gnome-Do hotkey to Alt+Space, but it didn't work - when I pressed the key combination, it just activated the window menu. In order to assign this key combination to something else you must first disable it's current use. To do this, go into the main menu, then System > Preferences > Keyboard Shortcuts, and find "Activate Window Menu", double click it to assign it a new key combination, and simply press Backspace to disable it.

Monday, 4 October 2010

Apache Ant error: restrict doesn't support the nested "name" element

System: Ant 1.7.1 and Sun Java 1.6 on Ubuntu Lucid 10.04

Code snippet:
<target name="jar">
<jar basedir="${bin}" destfile="${project.name}.jar">
<restrict>
<name name="**/*" />
<archives>
<zips>
<fileset dir="/opt/project_jars">
<include name="file.jar" /> 
</fileset> 
</zips> 
</archives> 
</restrict> 
</jar> 
</target>

From googling the error, I found this thread: http://markmail.org/message/y2ly5gykzbpab7p7. The suggested solution of adding namespace information got rid of the original error, but introduced a new one:
restrict doesn't support the nested "archives" element

Actual solution: upgrade Ant to 1.8
sudo apt-get install ant1.8 

Thursday, 5 August 2010

Installing Songbird 1.7.3 on Ubuntu 10.04 Lucid

Download the "Songbird 1.7.3 Generic Linux Tarball" for your architecture from the Linux section of the Contributed Builds page on the Songbird wiki. Extract this to a good permanent location (this is the install directory, which contains all the files required to run Songbird), I chose /home/jack/programs/songbird.

I read over the instructions on the Building Songbird page. This was just to make sure I had the right dependencies installed (the rest of the instructions are for compiling from source, which we don't need to do). It also showed me how to completely uninstall any previous versions.

Now I tried running songbird for the first time (running the songbird script in your songbird directory), and it worked, but was giving loads of GStreamer warnings e.g.
Failed to load plugin /usr/lib/gstreamer-0.10/libgstdvdspu.so undefined symbol: gst_video_event_parse_still_frame
This is caused by a clash between Songbird's included libraries and those installed on your computer. The solution is to tell Songbird to only use it's own libraries. This is done by exporting an environment variable before running Songbird each time, for which I have created a little script called songbird-gst-fix, and put in my home/USER/bin directory:
#!/bin/sh
export SB_GST_NO_SYSTEM=1
/home/jack/programs/songbird/songbird
You can now run songbird with the command songbird-gst-fix. I still get a few GDK icon warnings e.g.
gdk_window_set_icon_list: icons too large
But these don't seem to do any harm. Also if you occasionally get an error like this:
Could not call boundObserver.observe(). Key = metadata.artist
It is caused by the "New Releases" add-on, but it doesn't seem to cause any problems. The only way I cant find to get rid of it is to disable the add-on.


REFERENCES: http://ubuntuforums.org/showthread.php?t=1086378

Wednesday, 28 July 2010

Black screen flicker with nVidia v195 drivers on Ubuntu 10.04 Lucid

GPU: nVidia Quadro FX 570
Driver: nVidia version 195.36.24 from the Ubuntu repository

On recent upgrade to Ubuntu 10.04 Lucid Lynx I started getting a really annoying black flicker/flash/blink covering my screens for a fraction of a second at seemingly random intervals (sometimes every 10 seconds, sometimes every 10 minutes). This only happened when I was using dual monitors in TwinView mode. It didn't matter if compiz was enabled.

I originally had the nvidia-current package installed (which at the time of writing was v195.36.24), so I tried a couple of other versions, including v173.14.22 from the Ubuntu repo, and v256.35 - the latest from the nVidia site, both of which had other issues. I also tried reverting to the open source drivers, as detailed here, but it turned out they did not support 3D graphics.

After reading a lot of forum posts about this issue I realised that the problem was with an nVidia tool called PowerMizer. By default is in adaptive mode, which means it jumps between performance levels, juggling your GPU clocking settings on demand. The flicker I was getting was happening every time it jumped between performance level 0 and 1 (which I believe relates to 2D and 3D graphics).

SOLUTION
I fixed the problem by forcing PowerMizer to stay in level 1, which with the v195 drivers you can do graphically by running nvidia-settings, selecting PowerMizer on the left, and then setting the mode to "Prefer Maximum Performance". Unfortunately this setting does not persist through restarts, which is not a problem for me, but I've read that you can fix this by putting something in your xorg.conf (see this post).

Sunday, 18 July 2010

Playing GSM audio files on Ubuntu 9.10 Karmic

Note: you will need to have a package called sox installed for this to work

1) Create script file in your ~/bin directory (assuming that is on your PATH) called play_gsm_with_sox containing the following:
#!/bin/sh
gnome-terminal --command="play $*"

2) Make it executable (and test it by executing the command play_gsm_with_sox file.gsm)

3) R click your gsm file > properties > open with > command > play_gsm_with_sox

Then you should be able to double click gsm files and get a little terminal window playing them, which you can close to stop playback

Wednesday, 2 June 2010

Installing GIMP 2.7 on Ubuntu 9.10 Karmic

I wanted to try the latest version of GIMP, to see the long sought after single-window mode in action.

Method 1 - PPA

The first, and by far the easiest method is by using the PPA on this page: https://launchpad.net/~matthaeus123/+archive/mrw-gimp-svn

You simply add the repo with this command: 
sudo add-apt-repository ppa:matthaeus123/mrw-gimp-svn
and then add the GPG key:
sudo apt-key adv --recv-keys --keyserver keyserver.ubuntu.com 405A15CB

PROBLEM HTTP fetch error 7: couldn't connect to host
SOLUTION Open up the outbound TCP port 11371

Then you can install gimp using apt-get (or simply run an update if you already had it installed).


Method 2 - From source

The second method is to install it from source, and while this is much more of a challenge, it doesn't rely on any third party PPAs...

PREPERATION
3 commands to modify (change /home/jack to your home dir), and execute:
mkdir /home/jack/programs/gimp-2.7
export PKG_CONFIG_PATH=/home/jack/programs/gimp-2.7/lib/pkgconfig/:$PKG_CONFIG_PATH
export LD_LIBRARY_PATH=/home/jack/programs/gimp-2.7/lib:$LD_LIBRARY_PATH

INSTRUCTIONS
Download gimp-2.7.0.tar.bz2 from http://www.gimp.org/, and extract it and run the installation commands:
./configure --prefix=/home/jack/programs/gimp-2.7
make
sudo make install
But of course I encountered loads of problems during the configuration stage:

PROBLEM configure: error: Your intltool is too old. You need intltool 0.40.1 or later.
SOLUTION sudo apt-get install intltool

PROBLEM No package 'babl' found
SOLUTION Found http://developer.gimp.org/git.html which has lots of the tools you will probably need including babl and gegl. Eventually found my way to ftp://ftp.gtk.org/pub/babl and downloaded the latest version of babl (for me, this was 0.1/babl-0.1.2.tar.bz2). Extract it, and do the following installation commands:
./automake.sh --prefix=/home/jack/programs/gimp-2.7
make
sudo make install
BUT I encountered more problems along the way:

PROBLEM Got an error message saying I needed ruby
SOLUTION sudo apt-get install ruby1.8-dev

I think at this point babl successfully installed. Back to trying to ./configure gimp, and now we get the following problem:

PROBLEM No package 'gegl' found
SOLUTION Similar to babl, we go to ftp://ftp.gtk.org/pub/gegl and download the latest version, extract it and try to install it with:
./automake.sh --prefix=/home/jack/programs/gimp-2.7
make
sudo make install
But of course we encounter lots of problems:

PROBLEM You must have glib-gettextize installed to compile GEGL
SOLUTION sudo apt-get install libglib2.0-dev

PROBLEM Loads of errors about GDK and GTK, the first of which was:
gegl-paint.c:22:21: error: gtk/gtk.h: No such file or directory
SOLUTION (Note: this auto-installed LOADS of dependencies for me):
sudo aptitude install libgtk2.0-dev
May also need to execute this next command, but not sure (BEWARE: BIG DOWNLOAD!)
sudo apt-get install asciidoc

Then I was back on track for the main GIMP installation, so tried to run the configure script again (remember the --prefix)...

PROBLEM Checks for TIFF libary failed
SOLUTION sudo apt-get install libtiff4-dev

PROBLEM Could not find Python headers
SOLUTION sudo apt-get install python2.6-dev

PROBLEM Could not find PyGTK 2.10.4 or newer
SOLUTION sudo apt-get install python-gtk2-dev

And then I was able to complete the install!!!! You can then run it using /home/jack/programs/gimp-2.7/bin/gimp-2.7