Monday, July 24, 2006

Ubuntu: some tips

*.desktop files are stored in /usr/share/applications folder.
Icons are stored in /usr/share/pixmaps folder.

Adding this line MOZ_DISABLE_PANGO=1 to /etc/environment supposedly speeds up Mozilla Firefox.

Ubuntu: more speed

The prelink package contains a utility which modifies ELF shared libraries and executables, so that far fewer relocations need to be resolved at runtime and thus programs come up faster.

How to enable prelink:

1. Activate Ubuntu universe sources. The procedure is well-documented by Ubuntu
2. use apt-get or synaptic to install prelink
3. Open /etc/default/prelink with your favorite editor, as sudo/root
4. Change PRELINKING=unknown from unknown to yes
5. Adjust the other options if you know what the heck you're doing. Defaults work well
6. To start the first prelink (the longest one!), run sudo /etc/cron.daily/prelink

Sunday, July 23, 2006

Ubuntu: w32codecs installation

First download w32codecs package from here or here. Then:
$ sudo dpkg -i package.name.deb

http://help.ubuntu.com/community/RestrictedFormats

Ubuntu: my NTFS mount point

My NTFS mount point in /etc/fstab:
/dev/hda1 /media/hda1 ntfs defaults,nls=utf8,umask=007,gid=46 0 1

Saturday, July 22, 2006

Ubuntu: set correct DPI for X server

You can use utilities xdpyinfo | grep resolution and xrdb -query to get current DPI value. To change DPI values create a file ~/.Xresources or edit ~/.config/xfce4/Xft.xrdb (if using XFCE4) and add line:
Xft.dpi: 96
Or you can edit directly /etc/X11/xorg.conf and under "Monitor" section add a line:
DisplaySize XXX XXX (in my case it's 270 203)
XXX is calculated by using formula 25.4 * pixels (height or width) / DPI.

Note: X Window System has it's own DPI value set in /etc/X11/xorg.conf; desktop environment, for example XFCE4 - in ~/.config/xfce4/Xft.xrdb; Mozilla Firefox - in browser.display.screen_resolution (about:config).

UPDATE: There's a bug in Ubuntu 7.04 Feisty Fawn in xorg module, so that xorg doesn't honor DisplaySize line in xorg.conf.

Ubuntu: generate program menus

generates programs menu for all menu-aware applications
Debian menu keeps transparently the menus in the different
window-managers in sync with the list of installed programs.

Debian menu relies on a list of menu entries provided by programs
and a list of menu-methods provided by window-managers and other
menu-aware applications.

Menu provides system-level and user-level configuration and overrides
for both menu entries and menu-methods.
$ sudo apt-get install menu
$ sudo apt-get install menu-xdg #not sure about this
$ sudo update-menus

Ubuntu: Flash player plugin install

It's very easy to install Flash player in Ubuntu Linux. Just execute following commands in terminal:
$ sudo apt-get install flashplugin-nonfree
$ sudo update-flashplugin

Ubuntu: MS TrueType font install

At first add keyword multiverse to repositories list in /etc/apt/sources.list. Then download Tahoma font and execute:
$ sudo apt-get install msttcorefonts
$ cabextract IELPKTH.CAB
$ sudo cp *.ttf /usr/share/fonts/truetype/msttcorefonts/

Edit /etc/defoma/hints/msttcorefonts.hints file (as root) and append the following lines:
begin /usr/share/fonts/truetype/msttcorefonts/tahoma.ttf
Family = Tahoma
FontName = Tahoma-Regular
Encoding = Unicode
Location = Magyar Dutch Spanish Czech Russian English Catalan Slovak Italian Turkish Danish Slovenian Basque Portuguese German Polish Swedish Norwegian French Finnish Greek
Charset = ISO8859-1 ISO8859-2 ISO8859-3 ISO8859-4 ISO8859-5 ISO8859-7 ISO8859-9 ISO8859-10 ISO8859-13 ISO8859-14 ISO8859-15 KOI8-R KOI8-U CP1251 VISCII1.1-1 TCVN-5712 ISO10646-1
UniCharset = ISO8859-1 ISO8859-2 ISO8859-3 ISO8859-4 ISO8859-5 ISO8859-7 ISO8859-9 ISO8859-10 ISO8859-13 ISO8859-14 ISO8859-15 KOI8-R KOI8-U CP1251 VISCII1.1-1 TCVN-5712
GeneralFamily = SansSerif
Weight = Medium
Width = Variable
Shape = NoSerif Upright
Foundry = Microsoft
Priority = 20
end
begin /usr/share/fonts/truetype/msttcorefonts/tahomabd.ttf
Family = Tahoma
FontName = Tahoma-Bold
Encoding = Unicode
Location = Magyar Dutch Spanish Czech Russian English Catalan Slovak Italian Turkish Danish Slovenian Basque Portuguese German Polish Swedish Norwegian French Finnish Greek
Charset = ISO8859-1 ISO8859-2 ISO8859-3 ISO8859-4 ISO8859-5 ISO8859-7 ISO8859-9 ISO8859-10 ISO8859-13 ISO8859-14 ISO8859-15 KOI8-R KOI8-U CP1251 VISCII1.1-1 TCVN-5712 ISO10646-1
UniCharset = ISO8859-1 ISO8859-2 ISO8859-3 ISO8859-4 ISO8859-5 ISO8859-7 ISO8859-9 ISO8859-10 ISO8859-13 ISO8859-14 ISO8859-15 KOI8-R KOI8-U CP1251 VISCII1.1-1 TCVN-5712
GeneralFamily = SansSerif
Weight = Bold
Width = Variable
Shape = NoSerif Upright
Foundry = Microsoft
Priority = 20
end
Actually these lines are taken from Arial font description and modified to Tahoma.

Then execute:
$ sudo defoma-font -v reregister-all /etc/defoma/hints/msttcorefonts.hints

Add the line bellow to /etc/X11/xorg.conf file:
FontPath "/usr/share/fonts/truetype/msttcorefonts"


May be helpful (may be not):
$ sudo dpkg-reconfigure defoma
$ sudo defoma-reconfigure
$ sudo fc-cache -f -v