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

Sunday, 20 January 2013

Howto: Fix XSane error; scanner failed to start.

For a little while now I've been unable to use XSane due to an error when trying to perform a colour scan on my Epson Perfection610.  Many things were tried including purging xsane, removing ~/.sane etc.

I finally found a solution given by Ronok in this post.

Following the full steps is not necessary, I had sane and most things associated with it already installed.

sudo gedit /etc/sane.d/dll.conf

Then find "epson" and "epson2"
#epson
epson2 

Comment out "epson2" and uncomment "epson" so you are left with:

epson
#epson2 

I rebooted but I'm unsure if that is required, afterwards XSane worked perfectly as it had for years.

Wednesday, 14 April 2010

Howto: Move the Window buttons back to the correct side.

Ubuntu 10.04 Lucid Lynx has moved the window buttons to the left on the title bar. Its a peculiar thing to decide to do and myself and others I have spoken with can't see *why* they should chose to do it. The only answer I keep coming back to is that this is just something to stand out and give a unique(ish) appearance, as part of their re-branding.

Well, I would much prefer them back over on the right, as I feel it looks better and I really don't see the point in moving something that
requires a retraining has no purpose than for appearances sake. In my opinion of course.

Paste the following into a terminal:

gconftool-2 --set '/apps/metacity/general/button_layout' --type string ":minimize,maximize,close"

Or, fire up gconf-editor from a terminal or Alt+F2 run dialog, and in the left pane navigate to :
apps / metacity / general

In the right pane double click on button_layout and paste in:
menu:minimize,maximize,close

Note, if you select Ambiance again in the theme selector it will again "break" your buttons, bit of a nuisance.

This will give the original layout, be aware that the default themes will look a little broken if you do this, if you do use the orginal theme I would advise you to keep the order of maximise,minimise,close (I am not sure whether it still breaks the buttons surround). They will look fine in the new order on the right, the bevelling on the theme will look nasty if you re-order the buttons though. Personally I don't much like the default theme so I will be retaining my current window decoration and going back to the "old" order.

The window theme I use can be found here : LINK :


Wednesday, 12 August 2009

Enable Composite Manager in Metacity

Not every computer has the resources to run Compiz, but if you pine after some nice effects like window shadows then there is a good chance your computer is capable of running simpler effects. i use this on my Acer Aspire One, sure it can manage Compiz, but it is a little overkill on the baby netbook.

Well rejoice now as Metacity has a composite manager built in which can give you nice drop shadows as well as a window preview on alt+tab and that  pesky inactive window title-bar transparency (which I detailed how to disable last post).

Enable the composite manager in gconf-editor and navigate to the branch in apps/metacity/general

Tick the box next to the setting composite_manager and you are now hopefully enjoying drop shadows... Yay!

A quick alternative is to paste this into a terminal

gconftool-2 -s '/apps/metacity/general/compositing_manager' --type bool true

and if you need to disable it again use:

gconftool-2 -s '/apps/metacity/general/compositing_manager' --type bool false




Adjust Titlebar Transparency in Metacity

I might be in the minority with this sentiment but I really dislike the transparency Gnome has gained on its inactive window titles when using the GTK window decorator. So here is how to make inactive windows have a solid title-bar or if you are are fan of it, make it even more transparent.

Press alt+F2 and in the run dialog enter:

gconf-editor

Navigate in the left hand tree to the branch /apps/gwd/

The two values we are interested in are :

metacity_theme_opacity which affects inactive window titlebars
metacity_theme_active_opacity which affects active windows

A setting of 1 will make the title-bars solid while 0.75 is the default at three quarters opacity.

Friday, 7 August 2009

How to use OTF fonts in Ubuntu

It isn't possible to use OTF fonts directly in Ubuntu without converting them into TTF's.

If we spend just a few minutes and install FontForge and make a very small script it becomes almost trivial to do.

sudo apt-get install fontforge

Now we should make the scripts, well it is two actually but one is a small config script for FontForge and the other is just a script to convert many OTF files in one go, rather than individually. First the FontForge settings file.

cd ~/bin
touch otf2ttf.conf

Then open otf2ttf.conf in your favourite text editor and paste the following into it.

#!/usr/local/bin/fontforge
# Quick and dirty hack: converts a font to truetype (.ttf)
Print("Opening "+$1);
Open($1);
Print("Saving "+$1:r+".ttf");
Generate($1:r+".ttf");
Quit(0);

Save the file, and now lets make the script to convert many fonts in one swoop.

cd ~/bin
touch otf2ttf
chmod +x otf2ttf

Again, open this file with your prefered text editor and paste the following in.

#!/bin/bash
#
# had to enable extglob
shopt -s extglob

# this uses globbing to match fiels ending in otf/OTF
for i in +(*.otf|*.OTF)

do fontforge -script /home/subbass/bin/otf2ttf.conf $i

done

To use this now (provided that your ~/bin folder is in your path) just open a terminal where your OTF files are, and issue the command otf2ttf. It will convert 20 files in just a couple of seconds to give you an idea of speed, you can then move all the resulting TTF files into ~/.fonts


Credit to http://www.stuermer.ch/blog/convert-otf-to-ttf-font-on-ubuntu.html where I found the script before re-typing the instructions. I put it here so I don't lose it next time I need it.

Wednesday, 5 August 2009

Howto Create Split RAR Files

Lets learn how to create split Rar files

If you have a large amount of data to backup or especially to transfer it can be very prudent to use an archive that can be split into smaller parts, if one section becomes corrupted during transfer, it is far better to transfer a single 15mb file again, than an entire 10GB file, right?

Lets grab the rar program:

sudo apt-get install rar

Ok lets compress our directory of files:

To compress file(s) to split rar archive know which directory you want to compress, I'll use a fictional DVD Image folder in the home folder.

rar a -m5 -v5M -R myarchive /home/yourname/dvdimage

Let me break the above command down

rar – starts the program
a – tells program to add files to the archive
-m5 – determine the compression level (0-store (fast)…3-default…5-maximum(slow))
-v15M – determine the size of each file in split archive, in this example you get files with size 15MB (if you wanted files of 512kB size you would write -v512k)
myarchive – name of the archive you are creating
/home/yourname/dvdimage – is folder of the files you wish to add to the archive

You can also add -p to the command after a and it will prompt you for a password.

You can read the manual for more options with man rar (Press q to exit and arrows to scroll up/down)

To uncompress the archive type:

rar x myarchive.part01.rar

Or right click on file myarchive.part01.rar in Nautilus and choose Extract Here.




Tuesday, 4 August 2009

Howto make autohide panels smaller and hidden more in Gnome

Autohide panels in Gnome default to a 6 pixel strip remaining showing. I suspect this is done to "reduce confusion" which is a popular phrase from the Gnome guys, regardless its a little annoying to autohide a panel and still have it show around 20% of itself, so lets fix that.

The easiest way to do this is pop open a terminal and enter:

gconf-editor

This is quite a daunting program if you are fairly new to dabbling in the guts of OS's, and I must warn you to be a little careful in here, certainly don't go just changing stuff around to "see what happens"... Ok, no-one is that dumb... right?

Anyway, down the left hand side is a nice tree menu, navigate to:

/apps/panel/toplevels/

You should then see your panels on the left in the toplevels branch, possibly named bottom_panel_screen0, top_panel_screen0 or simply panel_0, panel_1 etc. Click on each of the panel entries and you will see the right pane populate with some "keys", locate the one auto_hide_size which is very likely set to 6 at the moment, change the 6 to a 1 by clicking on it.

The change is nearly instant and you will hopefully see the relevant autohidden panel sneak a little further offscreen, setting the value to 0 (zero) will not have the desired effect incidently so stick to 1 please.


Monday, 3 August 2009

Delay applications running with sleep from autostart

This is how to cause some programs to wait until they run from the autostart, I will cover both Gnome and Openbox.

First, how to do this in Gnome. Fire up the Session manager either from preferences or via:

gnome-session-properties

Now when you either edit an existing entry, or add a new one the command should be in the following format:

bash -c "sleep 30; gnome-do"

This will make Gnome Do wait 30 seconds before running, obviously you can adjust the 30 and the command to run as your needs dictate. Any changes will be affected when you next login of course.

For Openbox we need to edit ~/.config/openbox/autostart.sh (where ~/ relates to your own home folder, the system will translate it). The file is a simple text format with one command per line, almost all applications in here will want a & (ampersand) after them. The ampersand tells the system to run the command and not wait for it to finish before going to the next, without it Openbox would likely run the first command then stall loading, waiting for it to end before it would even finish loading the desktop.

Ok, the magic to cause the delay....

(sleep 30s && ubuntuone-client-applet) &

Please note the parenthesis, its apparently very important to ensure the command is bracketed like this. Again you may adjust the delay time, and the command (in this case ubuntuone-client-applet)



Tuesday, 14 July 2009

Set up rxvt terminal with unicode and clickable URL's

Rxvt is a super fast unicode terminal which I have recently switched to away from Eterm for my transparent desktop terminal.

sudo apt-get install rxvt-unicode-ml

Next is to create a configuration file for it in your home folder.

touch .Xdefaults

Now paste this lot in...

URxvt*termName: rxvt

## borderless and no scrollbar
URxvt*scrollBar_right: false
URxvt*scrollBar: false
URxvt*borderLess: false

## teh transparency stuff
URxvt*inheritPixmap: true
URxvt*tintColor: white
URxvt*shading: 100

##
## These 3 lines make links clickable
##
URxvt.urlLauncher: firefox
URxvt.matcher.button: 1
URxvt.perl-ext-common: matcher,readline

## geometry and font
URxvt*geometry: 80×15
URxvt*font: xft:Terminus:pixelsize=12

## change default colors
URxvt*background: #000000
URxvt*foreground: #A8A8A8
URxvt*color0: #000000
URxvt*color1: #A80000

## URxvt*color2: #00A800
URxvt*color2: #ED254F

URxvt*color3: #A85400
## main bars in irssi
URxvt*color4: #020202
URxvt*color5: #A800A8
URxvt*color6: #00A8A8
URxvt*color7: #A8A8A8
URxvt*color8: #545054
URxvt*color9: #F85450

## Time in Irssi
URxvt*color10: #ED254F
## URxvt*color10: #50FC50

## URxvt*color11: #F2FC50
URxvt*color11: #ED254F

URxvt*color12: #5054F8

URxvt*color13: #ED254F
## URxvt*color13: #F854F8

URxvt*color14: #50FCF8
URxvt*color15: #F8FCF8

Note that some of the colours have been changed to coordinate with my current desktop theme, the original colours are commented out so you can easily revert. Also the line defining the window geometry seems to have no effect, I shall look into that and correct it when I get some time and inclination. At the moment I don't mind because the default window size is fine, and the launcher I use to start the transparent terminal I use on the desktop mainly for my screen with irssi, hellanzb and mediatomb in has the geometry set on it. the launcher command is:


rxvt -g 80x15

Last job is to tell compiz to not decorate this window, this will get rid of the title bar, borders and shadow etc.

Hopefully you have installed the advanced compiz settings (ccsm), so just open that up and go to the section for window decorations
in Effects, Window Decorations.

Add the rxvt window to be excluded from shadows and decorations, and that should see you done.



Monday, 13 July 2009

Howto: Ubuntu 9.04 notification of available updates revert behaviour

Revert the change in notifications of available updates to original behaviour.

Open a terminal and issue the command:

gconftool -s --type bool /apps/update-notifier/auto_launch false

This will do away with the Update manager automatically opening and revert to showing the update icon instead effectively reverting to original behaviour. The new method seems like a massive regression to me. I don't want to wait 7 days to have the computer randomly open the update manager, and even worse that 7days is reset if you used Synaptic, apt-get or add/remove!

I completely fail to understand why none critical updates should wait 7days before Ubuntu decides that you should install them, and reset the clock if you opened Synaptic in between.

Thursday, 9 July 2009

Synaptic not showing search results

Synaptic fails to show search results for packages that you know are present.

This was an annoying little problem I had on 8.10 and bless my soul if it didn't occur on my fresh clean install of 9.04, so I thought I should throw the solution up here in case I need it again, or anyone else does.

Open a terminal and issue the following command

sudo update-apt-xapian-index

It will just take a couple of minutes to rebuild the apt database, then Synaptic should work fine again.



Wednesday, 8 July 2009

Control+Alt+Backspace shortcut does not restart the X server

Control+Alt+Backspace shortcut does not restart the X server

Edit: I believe this was removed because the kernal already contained another combo that does the same job, Alt+SysReq+k will terminate and restart X if it should become unresponsive.

If you would prefer the old key combination then issue the following two commands in a terminal. I would advise against this though, but as always, the choice is entirely yours.

sudo apt-get install dontzap
then do:
sudo dontzap –disable



Monday, 22 June 2009

Install Samba Server on Ubuntu

Install Samba Server on Ubuntu


If you want to share files between your Ubuntu and Windows computers, your best option is to use Samba file sharing.


To install, first open a terminal window and enter the following command:


sudo apt-get install samba smbfs


We’ve got samba installed, but now we’ll need to configure it to make it accessible. Run the following command to open the configuration file, substituting your editor of choice:


sudo gedit /etc/samba/smb.conf


Find this section in the file:


####### Authentication #######

# “security = user” is always a good idea. This will require a Unix account
# in this server for every user accessing the server. See
# /usr/share/doc/samba-doc/htmldocs/Samba-HOWTO-Collection/ServerType.html
# in the samba-doc package for details.
; security = user


Uncomment the security line, and add another line to make it look like this:


security = user
username map = /etc/samba/smbusers


This will set Samba to use the smbusers file for looking up the user list.

Create a Samba User

There are two steps to creating a user. First we’ll add that username to the smbusers file.

sudo gedit /etc/samba/smbusers


Add in the following line, substituting the username with the one you want to give access to. The format is ubuntu-usuername = “username”. You can use a different samba user name to map to an ubuntu account, but that’s not really necessary right now.

joe = “joe”


Next, we’ll run the smbpasswd utility to create a samba password for the user.


sudo smbpasswd -a


Now you can create samba shares by right clicking in Nautilus and defining the share in properties/sharing.


Thursday, 11 June 2009

Acer Aspire One update broke Wifi


Just updated my Acer Aspire One (Intreprid 8.10) and the wifi broke. A quick poke around and installed:

linux-backports-modules-generic

After a reboot the wifi sprang back into life.

Friday, 29 May 2009

Is your Nautilus slow to open directories?

Fix Naultilus slow loading some directories.

If nautilus is taking an age to load some directories on your computer then you may have Assistive Technologies enabled.

Simply go to the System menu on your desktop and then in Preferences. Click on Assistive Technologies.
Untick the box marked "Enable Assistive Technologies" and choose "Close and Log Out" at the bottom of the window.

When you log back in Nautilus should be opening directories instantly again. Apparently this became an issue in 8.10 when Assistive technologies was enabled by default, I only spent aoround 8 months suffering with this before getting off my backside and finding a fix, it is disappointing that there has not been a direct update to sort this out, there must be a lot of people stuck with this problem.

Wednesday, 11 February 2009

Disable IPV6 on Ubuntu 8.10

Disable IPV6 on Ubuntu.

Some people feel loading IPV6 can improve the network performance and if your ISP doesn't support IPV6 yet (which most do not) then it will do no harm to disable it.

sudo nano /etc/modprobe.d/blacklistappend the following line:blacklist ipv6

Save the file and restart your machine!
You can verify that ipv6 is actually disabled using the following command:

ip a | grep inet6


If you see no ouput then IPV6 is now disabled.

Wednesday, 8 October 2008

Update to the latest Compiz Fusion On Ubuntu Hardy

You will need to add a new repository that contains recent Compiz packages. Open System->Administration->Software Sources. Select the Third-Party Software tab and click Add. Paste in the line below and click Add Source.

deb http://ppa.launchpad.net/compiz/ubuntu hardy main

Close Software Sources and when prompted, choose to reload the repositories.

A number of software updates related to Compiz should become available now; install them using Update Manager. Log out and back in to Ubuntu or restart Compiz manually. You should now be up-to-date.

A nice new window shifter is available for the new Compiz called StackSwitch, just install it from the repo and disable the normal Shift Switcher. It would be nice if the author will add selecting the windows by the mouse much like Expo or some other window plugins.

Tuesday, 16 September 2008

Error trying to mount an external device: mount_point cannot contain the following characters: newline, G_DIR_SEPARATOR (usually /)

The computer fails to mount a device with the following error:
Cannot mount volume.Unable to mount the volume 'yourdevicenamehere'.Detailsmount_point cannot contain the following characters: newline, G_DIR_SEPARATOR (usually /)
This can be from incorrectly setting the mount point by right clicking the drive and choosing Properties then the Drive tab and finally expanding the section for Settings, this should simply contain the name you would like the device to be named on your desktop and NOT a fully qualified pathname such as /media/freecom

If you have incorrectly set this or some other bad voodoo has happened to result in this error then it can at least in some cases be very quickly fixed with the following. Open a terminal and open the Gnome Configuration Editor with this command:

gconf-editor

and navigate to this location in the left hand menu:

system / storage / drives /

If you can now see an entry relating to the problem drive then click it and edit its entry on the right, removing the path and any /'s is normally sufficient , all it should be is a simple name that you would prefer it appear on the desktop as, in my case I was changing a drive that mounted as /media/FREECOM HDD to mount as /media/FREECOMHDD due to X-Plane not liking paths with spaces in. So the correct entry for mine was to just input "FREECOMHDD" with no path, no /'s and no speechmarks! ;)

Thursday, 4 September 2008

Do more with Gnome Do


Do more with Gnome Do.

I just discovered this launcher a few days ago and was instantly impressed after viewing the demonstration video available via the homepage. It provides some of the most powerful features of a launcher I have ever seen with massive potential for speeding up *real* productivity in ways you won't have considered.

First you need to edit the /etc/apt/sources.list file


sudo gedit /etc/apt/sources.list


Then add the following lines:

For Hardy Users
deb http://ppa.launchpad.net/do-core/ubuntu hardy main

deb-src http://ppa.launchpad.net/do-core/ubuntu hardy main

For Gutsy Users
deb http://ppa.launchpad.net/do-core/ubuntu gutsy main
deb-src http://ppa.launchpad.net/do-core/ubuntu gutsy main

Save and exit the file.

Update the source list file using the following command


sudo aptitude update

Install gnome-do using the following command from terminal


sudo aptitude install gnome-do

If you want to open gnome-do go to Applications—>Accessories—>GNOME Do

You can then open its preferences from the system tray and tick the first check box called "Start GNOME Do at login" so that it will launch when you reboot rather than remembering to do so from the menu.You can then choose the "Plug-ins" tab in the preferences to install any plug-ins that you feel would be useful to you, some I find very useful, Evolution, Files and Folders, Gnome Terminal, Locate Files, Tomboy and Tasque. Others would be more dependant on your computer uses and software such as Gmail Contacts, Imageshack, SSH, Rhythmbox etc

To call up Gnome Do just tap the Super+space key combo, that is windows key + space in other words. For further information it is well worth checking out the homepage and for help with plugins it can be helpful to open the preferences and click the About box for a plugin, you will be taken to its own wiki page that often has details on its use.

Sunday, 31 August 2008

Use exiftran to transform jpeg images

Exiftran is a command line utility to transform digital image jpeg images. It can do lossless rotations like jpegtran, but unlike jpegtran it cares about the EXIF data: It can rotate images automatically by checking the exif orientation tag, it updates the exif informaton if needed (image dimension, orientation), it also rotates the exif thumbnail. It can process multiple images at once.

exiftran -ai *

This will transform all the images in a folder, rotating them to the correct orientation as defined by the exif data from the camera and replace the original, assuming your camera can sense and write the orientation into exif data.

exiftran -i9 *

Transform the image through 90degrees (to the right) and overwrite the original.

exiftran -i2

Transforms the image through 270degrees (to the left) and overwrite the original.

I have adapted this into two scripts in my nautilus-scripts folder "/home/subbass/.gnome2/nautilus-scripts/" you can make two scripts in this place using the following code and just changing the exiftran command to rotate left or right in each of the scripts.

#!/bin/sh
for arg; do
filetype=`file -i "$arg"`
if [ -n "`echo $filetype | grep -i '.jpg' `" ]; then

exiftran -i9 "$arg"

else
convert -rotate 90 "$arg" "$arg"
fi
done

The convert at the end is to convert other image formats without me requiring another set of scripts, feel free to omit this if desired. Always do a small test before setting any script to work on large numbers of images, I don't want to be held responsible if your exif data gets nuked.