Archive for December, 2008

Changing visual editor appearance in WordPress 2.7

The visual editor in wordpress 2.7 has serif fonts and a much smaller font size than the previous version by default. If you like the larger sans-serif fonts in your editor you can adjust them in wp-includes/js/tinymce/wordpress.css located in your wordpress installation directory. For example the default body (paragraph) font entry is:

body.mceContentBody {
        font: 13px/19px Georgia, "Times New Roman", "Bitstream Charter", Times, serif;
        padding: 0.6em;
        margin: 0;
}

To get larger, sans-serif fonts similar to previous versions of wordpress change the body.mceContentBody entry into something like:

body.mceContentBody {
        font-family: Verdana, Arial, Helvetica, sans-serif;
        font-size: 16px;
        padding: 0.6em;
        margin: 0;
}

				
				

Tags:

Saturday, December 13th, 2008 Uncategorized No Comments

Touchpad sensitivity in linux

On some laptops the default pointer speed is very low when using the touchpad. If you own a Synaptics or ALPS Glidepoint you can use the synaptics driver for the X server to customize these settings.

There is even a graphical tool called gsynaptics that allows you to edit the settings graphically.

Configuring the X server

In your X server configuration file (e.g. /etc/X11/xorg.conf) add a new section for your touchpad:

Section "InputDevice"
	Identifier	"Synaptics Touchpad"
	Driver		"synaptics"
	Option		"SendCoreEvents" "true"
	Option		"Device" "/dev/psaux"
	Option		"Protocol" "auto-dev"
	Option		"SHMConfig" "true"
EndSection

Also add an InputDevice entry to your server layout:

Section "ServerLayout"
	InputDevice	"Synaptics Touchpad" "CorePointer"
EndSection

Restart your X server when you have adjusted the settings.

Installing and using gsynaptics

Install gsynaptics.  In Ubuntu linux it is available as the gsynaptics package from the package repository.

You should be able to run the tool. If you are not able to run it, ensure that you have enabled the SHMConfig setting of the synaptics driver.

Tags: ,

Saturday, December 13th, 2008 Uncategorized No Comments

System tray application for linux

Alltray is a linux application that allows minimizing any application to the system tray. In Ubuntu linux the tool is included in the package repository as the alltray package.

To start an application minimized run:

alltray

The tool also allows minimizing an already running application to the system tray, run:

alltray

A special cursor appears which allows you to select the window you want to minimize.

Tags: ,

Saturday, December 13th, 2008 Uncategorized No Comments

Online speed reading application

Spreeder is an online speed reading application. You can paste the text into the tool and let it flash the text by at your desired reading speed.

This way of presentation is called Rapid Serial Visual Presentation, the idea to flash the text by instead of scrolling by or showing large chunks of text is to reduce the time the eyes have to adjust after movement. The chunk size should be selected so that the entire text is readable without moving your eyes.

There is also the Firefox RSVP plugin which can be integrated into your browser.

Whether this really works, I don’t know yet, but I will probably try it out a couple of times.

Wednesday, December 10th, 2008 Uncategorized No Comments

Linux Character Device Driver Template/Skeleton with Interrupt Handler and Device Read Blocking (Kernel Module Example)

Linux Device Driver Template/Skeleton with Interrupt Handler and Device Read Blocking (Kernel Module Example).

Tuesday, December 9th, 2008 Linux Kernel No Comments

Java code reverse engineering to UML

When you have hacked a small Java application together and you would like to document it a little bit afterwards, NetBeans offers some nice Code Reverse Engineering features with its UML plugin to aid you in this task.

Installation

To install the plugin in NetBeans (version 6.5 at the time of writing), do the following:

  1. Start NetBeans
  2. Select Tools -> Plugins
  3. Open the Available Plugins tab
  4. Select UML in the list and click Install

Use

To use the plugin (assuming you already have created a NetBeans Project with your source code):

  1. Right click on the project you want to reverse engineer and select Reverse Engineer…
  2. Set your desired options and select OK
  3. Open the newly created UML project in the tree view
  4. Right click on Diagrams and select New -> Diagram and select Class Diagram.
  5. Open the newly created diagram
  6. Select the classes from the Model folder of your UML project you want to include in the diagram and drag them onto the diagram space in the main window

The classes are now included in your diagram, including their relations. If this is too crowded right click on an empty space of the diagram and select Show/Hide List Compartments -> Collapse All.

If you want to automatically add a little structure click the Hierarchical Layout button on the toolbar or press Ctrl+Shift+K.

Now rearrange the classes, delete classes that are not relevant for your purposes from your diagram, add some notes and you have a Class diagram, including relations.

Tags: , , ,

Monday, December 8th, 2008 Uncategorized No Comments

PageUp and PageDown history search auto completion on the BASH shell

History PageUp/PageDown completion

To enable PageUp/PageDown history completion and per-word navigation while holding the control key on the BASH shell create the file ~/.inputrc with the following content:

"\e[5~": history-search-backward
"\e[6~": history-search-forward

Other fancy options

To enable other nifty terminal options besides the history completion, like per-word navigation when holding control down put the following in your ~/.inputrc:

# do not bell on tab-completion
#set bell-style none</pre>
set meta-flag on
set input-meta on
set convert-meta off
set output-meta on

# Completed names which are symbolic links to
# directories have a slash appended.
set mark-symlinked-directories on

$if mode=emacs

# for linux console and RH/Debian xterm
"\e[1~": beginning-of-line
"\e[4~": end-of-line
"\e[5~": history-search-backward
"\e[6~": history-search-forward
"\e[3~": delete-char
"\e[2~": quoted-insert
"\e[5C": forward-word
"\e[5D": backward-word
"\e[1;5C": forward-word
"\e[1;5D": backward-word
# for rxvt
"\e[8~": end-of-line

# for non RH/Debian xterm, can't hurt for RH/DEbian xterm
"\eOH": beginning-of-line
"\eOF": end-of-line

# for freebsd console
"\e[H": beginning-of-line
"\e[F": end-of-line
$endif

Making the changes global

Changing ~/.inputrc only affects your own account, to make the changes global edit your /etc/inputrc instead.

Sources

PageUp and PageDown history search auto completion on the BASH shell.

Tags:

Monday, December 8th, 2008 Uncategorized No Comments

MS Office <-> OpenOffice conversion

Aside from the default import/export functions in openoffice there are two interesting free converters:

The Sun ODF Plugin enables transparent opening/saving of ODF files in MS Office. The second plugin adds an ODF submenu in the file menu.

While comparing the conversion of a document the OpenXML/ODF translator seemed to retain style names and cross references better than the native OpenOffice conversion and the Sun ODF plugin. There is one important thing to keep in mind with this converter: before conversion remove all links to pictures and other external resources (this will embed them in the current document) or you might get unexpected results.

Tags: , ,

Monday, December 8th, 2008 Uncategorized No Comments

Source formatting in WordPress

To enable code snippets in WordPress these plugins can be used:

You can now use the sourcecode tag to insert code blocks. With these two plugins you can use the HTML editor as well as the visual editor.

For use in the visual editor first enable the Kitchen Sink (button on toolbar) and click the Paste as Plain Text button on the toolbar. You get a dialog in which you can insert your plain text source code, when you are done editing select Insert and you’re done.

Example

The code:

[cpp]
if (true) {
    test();
}
[/cpp]

yields the following result:

if (true) {
    test();
}

Supported languages

The following languages are supported by the plugins: (<Language name>-<lang value>):

  • Bash — bash, sh
  • C++ — cpp, c, c++
  • C# — c#, c-sharp, csharp
  • CSS — css
  • Delphi — delphi, pascal
  • Java — java
  • JavaScript — js, jscript, javascript
  • PHP — php
  • Python — py, python
  • Ruby — rb, ruby, rails, ror
  • SQL — sql
  • VB — vb, vb.net
  • XML/HTML — xml, html, xhtml, xslt
Monday, December 8th, 2008 WordPress No Comments

SCP – copy files with spaces

To copy files containing spaces in their names with SCP the following way of quoting can be used:

scp -r user@server:"'/path with spaces'" /localpath

Tags: ,

Monday, December 8th, 2008 Uncategorized No Comments