Tech stuff and info dump

Save python history across sessions (linux, Ubuntu)

May 30th, 2010

To get python to save history across sessions you put the file .pystartup in your home directory and you add the line

Open a terminal and go to your home directory.

(In Ubuntu 10.04 and other versions, navigate to Applications -> Accessories -> Terminal to bring up a terminal window. You should already be in your home directory.)

Add the line

export PYTHONSTARTUP=/home/name_of_home_directory/.pystartup

to the .bashrc file, replacing name_of_home_directory with the name of your home directory.

(In Ubuntu 10.04 and other versions, you can open this file by typing

gedit .bashrc

at the command line. This will bring up a simple editor. Just add the line given above to the bottom of the file, save the file and close the gedit window.

The name of your home directory is the string that appears before the @ sign in your command line prompt, assuming you haven’t done anything to change this. For example, your prompt might look like this:

name_of_home_directory@mycomputer:~$

You can also find it by going to Places->Home Folder. The window that pops up will have the text

name_of_home_directory – File Browser

at the top.)

That should do it!

Thanks to archduke.


Filed under: Customisation,python
Tags:
May 30th, 2010 15:00:13

OpenOffice Calc: How to turn off auto-correct for (C) (R) and -> <- arrows

May 26th, 2010

Recently, I wanted to include a string like this:

Latin (C)

in an OpenOffice spreadsheet.

Unfortunately, every time I entered ‘Latin (C)’, the ‘(C)’ would get changed to a copyright symbol. Ctrl-z would erase the entire entry, rather than revert the copyright symbol to the string I typed in the first place.

To turn off this behaviour, I went to ‘Tools -> Autocorrect…’ and selected the ‘Replace’ tab. This gives a big list of all the auto-corrections OpenOffice will make.

I clicked on each item that I didn’t want OpenOffice to ‘fix’ for me and clicked ‘Delete’ to remove the entry.

Alternatively, one can go to ‘Tools -> Autocorrect…’, select the ‘Options’ tab and uncheck the box next to ‘Use replacement table’. Doing this should prevent OpenOffice from making any of the changes listed in the ‘Replace’ list. (It is worth having a look through the other tickboxes here as there were several other things I wanted to untick, like fractionifying fractions and making URLs into links.

This worked on OpenOffice Calc 2.4.1 running on Ubuntu 8.04 (Hardy Heron).


Filed under: Customisation,Fixes,OpenOffice
May 26th, 2010 16:04:55

Ubuntu 10.04: Get rid of the whizzy desktop-switching slide animation and other graphical effects

May 18th, 2010

I prefer a simple desktop environment free from whizzy graphical effects. In particular, I didn’t like the whooshing between desktops. I think of my desktops as discrete spaces and didn’t want them to appear connected in any way. In particular, I didn’t want to be able to move a window halfway off the left-hand side of the screen and then find it on the desktop to the next desktop over. How disorienting!

To disable the default

Navigate to System -> Preferences -> Appearance
Click on the ‘Visual Effects’ tab
Choose the ‘None’ option
Click ‘Close’

This freed me from all the unwanted effects.

(To disable only the desktop whooshing and not other graphical effects, perhaps it would be worth exploring ubuntu-tweak. After Ubuntu Tweak is installed, it can be accessed via Applications -> System Tools. I suspect playing around with “Compiz Settings” under the ‘Desktop’ heading could help. I may try this if I find a nice feature missing now that I’ve turned off visual effects, but for now, I’m happy.)


Filed under: Customisation,Ubuntu 10.04
May 18th, 2010 17:49:43

Firefox 3.6.3: make new tabs open at the far right, at the end of the list of tabs

May 13th, 2010

When I uo Ubuntu 10.04, I also ended up with Firefox 3.6.3. This was all fine and dandy apart from one thing: when I right-clicked a link and selected ‘New Tab’, the new tab would come into being right next to the current tab, not at the end of my (usually long) list of tabs. Because I often open multiple tabs at once and prefer to read them left-to-right, I wanted to change this behaviour back to what it was in earlier versions of Firefox.

Here’s how it can be done….

In the window where URLs normally go, type the following:

about:config

Unless you’ve already done this and have unticked the button that says ‘Show this warning next time’, A page will lode with the title ‘Here there be dragons!’ and a warning message.

about-config

Click the button that says ‘I’ll be careful, I promise!’ to get to a page with a zillion options.

You can search via keyword by typing a word into the ‘Filter’ box. For example, if you type ‘tab’ in the Filter box, one of the items that appears in the ‘Preference Name’ column is

browser.tabs.insertRelatedAfterCurrent

Right click on this option and click ‘toggle’ to change the value from ‘true’ to ‘false’ if you want a newly opened tab to appear at the end of your list of tabs.

Mozilla has a handy page with information about some of the preferences that appear in about:config and links to pages that cover other about:config options.


Filed under: Customisation,Firefox
Tags: ,
May 13th, 2010 00:54:12

Firefox 3.6.3: Disable third party cookies

May 11th, 2010

Woo! New version of Firefox came with Ubuntu 10.4!

I couldn’t immediately figure out how to opt out of receiving third-party cookies, but got there in the end. Here’s where the tickbox is hidden….

Navigate to Edit -> Preferences and select the Privacy tab.

Under the ‘History’ heading, there is a line that starts “Firefox will:” and a drop-down menu. Select “Use custom settings for history” from the drop-down menu.

This will cause some new options to appear, including “Accept third party cookies”. Untick this box and click “Close”.


Filed under: Customisation
May 11th, 2010 12:32:26

Ubuntu 10.04: turn off automatic screen lock/disable re-login after computer has been idle

May 10th, 2010

Navigate to:

System -> Preferences -> Screensaver

to open the Screensaver Preferences" dialog box.

Uncheck "Lock screen when screensaver is active" at the bottom of the dialog box.


Filed under: Customisation,Ubuntu 10.04
May 10th, 2010 16:19:30

Ubuntu 10.04 – Move close/maximise/minimise buttons to the right-hand corner of the window (GNOME desktop environment)

May 09th, 2010

Now that I’ve moved the close button to the right of the maximise and minimise buttons, I want to move all three buttons to the right-hand side of the window.

On the computer I don’t care about messing up, I’m trying ubuntu-tweak which I saw mentioned on the Ubuntu forums.

Here’s what worked for me.

I went to http://ubuntu-tweak.com/ and clicked the big button on the left hand side of the page to download and install the latest version of ubuntu-tweak (version 0.5.4.1). Ubuntu automagically gave me the option to install; it was quite a painless procedure.

Once installed, I could access ubuntu-tweak by navigating to:

Applications -> System Tools -> Ubuntu Tweak.

To move the close/maximise/minimise buttons to the right-hand side of the window in a GNOME desktop environment, find:

Desktop -> Window Manager Settings

on the tree view on the left. Click on:

Window Manager Settings.

There, right at the top, in all its glory, sits

Window Titlebar Button Layout

and the choice of “Place”. Click the radiobutton to select

Right

and viola! Life is a better place in which to live. I feel so much better now.

(This seems to sort out the position of the close button in relation to the maximise/minimise buttons as well, so the previous post is unnecessary.)

Note: I’ve never used ubuntu-tweak before so can’t make any guarantees about its safety, reliability, compatibility, etc. As stated before, I’m trying it out on a computer that I’m happy to mess around with.


Filed under: Customisation,GNOME,Ubuntu 10.04
May 09th, 2010 00:52:54

Ubuntu 10.04 – changing the order of the maximise/minimise/close buttons

May 07th, 2010

Well, I’ve finally started the process of migrating my computers to Ubuntu 10.04. This means several rounds of fixing things. Might as well post it all here as I’ll be doing this at least three more times. >+:Sigh:+< One of the things I wanted to do was put the close button on the right of the maximise and minimise buttons, as they were situated in previous versions of Ubuntu. Note: follow the instructions in the above post to move the buttons to the right hand side of the window and change the order of the buttons so that the close button is on the right of the maximise/minimise buttons. Follow the instructions below to leave the buttons on the left-hand side of the window but to put the close button to the right of the other two.

This site had instructions for changing the order of the buttons:

  • Open the configuration editor (press Alt+F2 and type gconf-editor)
  • In the left-hand tree, find app -> metacity -> general and double-click on the field called button_layout.
  • Change the value field to menu:minimize,maximize,close to move the close button to the right of the minimise and maximise buttons.

Thank you, Codigo Manso!


Filed under: Customisation,GNOME,Ubuntu 10.04
May 07th, 2010 18:52:43

Getting around Google fade

February 10th, 2010

The fade-in effect on the Google search engine home page causes me disproportionate rage. I have given it a go for over a month now, but I still cringe every time I load the page, and I’ve decided I just don’t need this kind of aggravation on a daily basis.

I tried out a few other search engines but nothing appealed, so now I’m back to Google. However, the daily bad feeling generated by the fade-in is too much for me. Life is short, so I’ll live it fade-in free.

Here are several of the things I’ve tried, all of which work in one way or another in Firefox….

1. I had Google as my ‘home’ page in Firefox. Changing the link from www.google.com or www.google.co.uk to this:

http://www.google.co.uk/firefox?client=firefox-a&rls=org.mozilla:en-US:official

leaves me with all links but none of the fade-in. My only hesitation in making this change is that I enjoy the occasional changes to the Google logo.

2. I then tried adding the Noscript plug-in and disabling scripts from running on Google, available here:

https://addons.mozilla.org/en-US/firefox/addon/722

This worked, but every time I opened a search page, a little Noscript message would pop up, informing me that scripts were disabled. This was better than the fade, but not quite as good as things were before all this fade-in business began.

3. Finally, I tried the Stylish plug-in available here:

https://addons.mozilla.org/en-US/firefox/addon/2108

Once it was installed, I pointed my browser at Google, clicked the Stylish icon and chose ‘Write new style’ from the menu. I then entered:

@namespace url(http://www.w3.org/1999/xhtml);

@-moz-document domain(“www.google.co.uk”) {

#ghead
{
opacity:1!important;
}
.fade
{
opacity:1!important;
}
.gbh
{
opacity:1!important;
}
#fctr
{
opacity:1!important;
}
#sbl
{
opacity:1!important;
}

}

in the text box and saved. (Many thanks to BdgR47!) Everything works beautifully now – there is no fade, no extra plug-in messages messing up the page and I’ll not miss any festive logos. The world is, indeed, a better place in which to live.


Filed under: Customisation
February 10th, 2010 12:14:30

WordPress – add stats plugin

January 07th, 2010

Add to plugin directory:


wp-content/plugins

Download and full installation instructions here.


Filed under: Customisation,WordPress
January 07th, 2010 05:50:26