Getting the process ID when pidof doesn’t work

August 21, 2008

I have found that sometimes the pidof command does not work. This seems to be the case when a program is actually a script being interpreted by another program e.g. python. It shows up in the ps list of processes with a pid but pidof fails to return it. In this particular case it is Elisa.

There are other ways to do it involving grep and pipes and other programs but this is just a simple single command replacment for pidof.

ps -o pid –no-heading -C elisa

This may not work on all flavours of linux as they have slightly different ps commands but it works fine on Ubuntu 8.10

Location of trash folder in Ubuntu

July 1, 2008

Sometimes I get files stuck in my recycle bin that do not get deleted when I empty the trash. This is usually because they are owned by root and my normal user does not have sufficient privileges to delete them.

sudo rm ‘ing the .trash folders on each drive does not work and after a lot of searching I finally found the folder with the trash files lurking in it here:

~/.local/share/Trash/files/

So to get rid of these these annoying files use this command:

sudo rm -rf ~/.local/share/Trash/files/*

and then do a normal empty trash.

Change fat32 drive label under Ubuntu / linux

July 1, 2008

How to change the drive label for a fat32 partition or drive in linux.

First you need to install mtools and then edit the configuration file.

sudo gedit /etc/mtools.conf

Add something like the following to assign a drive letter to your fat32 drive

drive d: file=”/dev/sdb1″

you can find out the second bit by running mount when your device is connected

sudo mlabel -s d:

to check that it is the right one and then to change it:

sudo mlabel d:whatever

Ubuntu – Resuming from Suspend Without a Password

November 1, 2007

If you are lucky enough to get suspend working in Ubuntu it will ask for a password on resume, unfortunately there is no easy way to disable this feature. It is however posible.

You need to start the configuration editor, this is supposedly in: Applications -> System Tools -> Configuration Editor
You may need to edit your menus to enable it as it starts hidden, it seems to be Gnome’s dirty little secret that it has a registry, similar to the windows one. I don’t have it in my menus at all so in a terminal:

gconf-editor

The setting we need for 7.10 is in: apps -> gnome-power-manager -> lock
untick suspend

pity this option is not exposed in the power management applet…….

Debugging Meedio

May 19, 2007

Add a desktop shortcut pointing to meedio then add the following to target after the path (outside the “”):

-debug -no-screen-idle -screen-top “0” -screen-width “640” -screen-height “480” -screen-sizable “true”

you can make the screen size bigger but it should be smaller than your display resolution so that you can see the log window.

Load a playlist quickly in meedio

May 19, 2007

first make a playlist in meedio and save it. The default save location is
C:\Documents and Settings\All Users\Application Data\Meedio\playlists\

Unfortunately the internal message sender doesn’t support spaces in filenames so move your playlist file somewhere else…

Then add a command module somewhere in you tree. Under Properties select or add the following:

Command to Send: Send Custom Command
Custom Command to send: music.load-playlist
Custom Parameters to send: file=

Add a jump target name to the module and then bind it to a button on your remote under the input tab

You will still have to push play to make the list actually start playing.

You can add

Making vmware reconnect usb device at startup

May 16, 2007

The default way that workstation reconnects a usb device at startup is by using hardware addressing by some form of id number:

from the .vmx config file
usb.autoConnect.device0 = "path:2/7 autoclean:1"

alas it seems that ubuntu does not always use the same id for the same usb port each time so that when you start up your vm you get a usb device not found error and you have to add it manually

It seems like you can get round this by using something like:
usb.autoConnect.device0 = "vid:15c2 pid:ffdc"

You can find the vid and pid for your device by running:
grep "USB: Found device" vmware.log

from your vm’s folder

This loads up my remote device successfully and will hopefully work between reboots…

How to add a graphical watched tag to a meedio screen

May 7, 2007

meedio watched tag example

First add the following to your themes default.reources file somewhere within the <image> tag:

<watched-img source=”draw:unselcircle”/>

You could point to an actual image but this way it is more subtle, portable and matches any theme.

Now to edit the screen file for your section, I would recomend copying media.screen to somewhere and using that as an alternate screen rather than editing the default one.

Replace everyting between and including:

<mode name=”movie-details” and </mode>

with this :

<mode name=”view-watched” preset=”simple-list-mode” >
<cells orientation=”cols”>
<cell left_padding=”1/30″>
<label caption=”{caption}” name=”” translate=”” />
</cell>
<cell size=”5/100″ right_padding=”5/100″ >
<image image=”{@ifequal( {watched} , ‘True’ , ‘watched-img’ , )}” image_format=”fit-left-img-format”/>
</cell>
</cells>
</mode>

that will add an extra display mode called ‘view-watched’ to that particular screen.

To use this mode you need to add it to the views section of the media library that your screen uses :

Meedio Library View

So thats it, all done

bear in mind that this will probably only work with the default player as it requires the watched field in the library to be set, also if you watch a ’watched’ video it will become unwatched again, go figure..

You will also need to make sure that your importer is set to “update existing items” not “delete and reimport”.  If you delete stuff after watching it you will also need to use the DeleteMissing importer as the “update existing items does not remove non-existent items.

May 7, 2007

This blog is just a little place for myself to post configuration steps for various stuff as I go along, My memory these days is even more  shite than it used to be.