Showing posts with label productivity. Show all posts
Showing posts with label productivity. Show all posts

Friday, 10 September 2010

Howto: Bind Keys In Nautilus To Scripts Or Other Menu Items.

I picked up this excellent tip from Webupd8.

First you should have installed Nautilus Open Terminal for an initial very useful shortcut. It adds a menu entry on the right click and in the File menu to do exactly what it says, open a terminal at the current folder you have open in the active Nautilus window. So enter the following into a terminal.

sudo apt-get install nautilus-open-terminal

If it is already installed it will just inform you of it in the text it spews, otherwise it will install it, and inform you of that too.

Open up gconf-editor from a terminal or Alt+F2 (you may also have it listed in your Applications/System Tools/ menu as Configuration Editor. Be a little bit careful in here, there is possibility of breaking stuff. Navigate in the left hand pane to Desktop/Gnome/Interface.

Change the toggle for "can_change_accels" to true/enabled. Leave the gconf-editor window open as you most likely want to disable it again after setting the keybindings you want. Be aware that you can only bind to the main Nautilus menu and not to its right click menu.

Press Alt+F2 and enter "nautilus -q" to restart Nautilus, then you may set any menu item or script to have a key bind simply by opening the Nautilus main menu and then pressing the key bind that would like to set it as while hovering over the item. For instance I hovered over Open Terminal and I have set to F4, I have also added bindings to other scripts I use fairly frequently.

I would suggest disabling the "can_change_accels" to false again to prevent accidental overwriting of key bindings, thats entirely up to you though, and be aware of what key binds you set of course, binding ctrl+c to close/quit nautilus is going to cause problems ;)

Sunday, 2 May 2010

Howto: Ubuntu 10.04 Lucid Post Install Acer Aspire One 110 (aka AAO & AA1) 8GB/16GB SSD Model

I need to clarify that this is on the Acer Aspire One 110, a couple of comments have indicated that the wifi fix did not work on their machines, one at least has a different model and its entirely my mistake I didn't state clearly which model it is I have, well the wife and I both have. Doing a lspci shows we have Atheros AR5001 wireless device.

Post install there are a number
of things that need tweaking. The wifi and media cards will not function correctly without some work, other things will improve performance or help the SSD longevity.

Wifi
Lets start by fixing the wireless, its probably the first thing you want to do as it will drop your connection like a butterfingered, blind juggler...... With one hand.

In your System / Admintration / Software Sources, enable any repo's that aren't enabled, though you can avoid the source ones if you want. The fire up synaptic, Reload the repository lists and add following package:

linux-backports-modules-wireless-lucid-generic

it will also select a similar named package with your kernel version in its name that we also want. Once that is done I would reboot and your wifi should be nearly done. Now I have installed on mine twice and the second install wouldn't automatically connect to the home wifi when I rebooted, I had to go into System / Preferences / Network Connections and delete the existing wireless connection there, and then Add the connection again. I am not sure why, but its not much trouble to correct and barely worth the time investigating. Yours may work without doing that.

Media Card Readers
You need to edit /etc/default/grub (as root ofc) and find the
line that starts:

GRUB_CMDLINE_LINUX_DEFAULT="quiet splash"

Change it to read

GRUB_CMDLINE_LINUX_DEFAULT="pciehp.pciehp_force=1 elevator=noop quiet splash"

The pciehp part fixes the card readers to be hot swappable and the
elevator=noop improves SSD performance, we'll add that now while we are dabbling in the right place. Anyone with a HD version who may be following this should omit the elevator=noop.

To then make the changes actually apply next boot they have to be applied to the Grub boot process so you should then perform :

sudo update-grub

Many thanks to Magrat G for pointing out the ommision in the comments.

Ramon in the comments made the following suggestion:

I've got a SD card in the storage expansion slot (where /home is mounted). To avoid suspend/hibernate failure, this is a nice tweak:

echo "SUSPEND_MODULES=\"sdhci sdhci_pci\"" | sudo tee -a /etc/pm/config.d/suspend_modules

It is reported in bug #477106 (see comment #35):
https://bugs.launchpad.net/ubuntu/+source/linux/+bug/477106

I will add a disclaimer that I have not tested that but it seems like a good fix and has many reports of it working for many people.

Move /tmp to RAM and general fstab fiddling
Lets backup our fstab before we start messing with it, if anything breaks we can copy it back and start again.. By we, I mean *you* of course ;)

sudo cp /etc/fstab /etc/fstab-bak
sudo gedit /etc/fstab


then add these lines at the bottom

none /var/log tmpfs size=10M 0 0
none /tmp tmpfs size=100M 0 0
none /var/tmp tmpfs size=20M 0 0


That is all we do to move /tmp to RAM but we can make another change here to improve SSD lifespan and performance. Find the lines that mount your SSD partition/s and tweak the options to include noatime so the filesystem does not record access times, which is pretty useless and causes unnecessary writes. An editted line might look like this for root:

/dev/sda1 / ext2 defaults,noatime,errors=remount-ro 0 1

Or if the UUID scheme is in use /home might be:

UUID=10b794b3-78b6-44f1-b179-8e38302efe05 /home ext2 defaults,noatime 0 2

Notice the use of ext2 in the examples above, Its fairly important to not use a journalled filesystem on this older SSD. I'm not a filesystem guru and it may be fine to use ext3 or ext4 without journalling, but I am unsure so I formatted with what I knew was recommended.

You get the idea, if you have any doubts just leave it be or google for a more in depth guide on this point.

I will be adding further onto this post as time permits and I go through them myself, or remember what I did.

Sunday, 18 October 2009

Howto: Sync Bash History Between Terminals

Do you want to be able to use the history from another terminal quickly and simply in a new terminal, or to be able to use any one of the terminals on your desktops to continue working with a current history?

Me too :]

This is a very easy tweak and makes a lot of sense to most people. So we need to edit the file ~/.bashrc

gedit ~/.bashrc

At the bottom paste in the following:

shopt -s histappend
PROMPT_COMMAND="history -n; history -a"
unset HISTFILESIZE
HISTSIZE=2000


Unsetting HISTFILESIZE just gets rid of the filesize limitation, and we rely on HISTSIZE which allows 2000 lines in the file, both normally default to 500.

PROMPT_COMMAND tells bash to reload history and append to history each time it draws the prompt in the terminal.

The only thing to note is if you jump from one terminal to another and wish to recall the last history line from the former terminal, press enter once with a blank line, this causes bash to draw the prompt and sync, if you only just opened the second terminal then you don't have to. The sync only occurs when the prompt is drawn, nothing else to note.

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.

Friday, 24 July 2009

Bulk rotate images using EXIF data

Using a simple command line command it is very simple to rotate any number of images using the exif data (hopefully) contained in the image. Most cameras will save the exif data and include the camera rotation when the photograph was taken.

sudo apt-get install jhead

then when we run the following command in the folder it will losslessly rotate the photographs that need it.

jhead -autorot *

Job done :]

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.

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.