Computers
Interesting Applications under Windows & Linux
see also Windows apps.
[CZ] and Linux
apps.
Last
change: March 2 2006
AD
Content
1.Audacity 1.2.1 for Windows (home)
Recording:
- Make sure you've selected the right input source (e.g. "stereo mix") on
the Mixer toolbar.)
- Sometimes you cannot select an input source because the Mixer toolbar
is disabled for some strange reason. It may help if you restart
Audacity.
- To avoid bad sound set the input volume (on the Mixer toolbar) less
then 1.0, e.g. 0.3.
2.Gimp 2.0
Draw a straight line: select the pencil tool, click where you want the
start point, press Shift and click to the end point.
Layers & text: every part of the image may be in a separate layer
=> you can move them independently. In the image window: Layer->New
Layer. To switch between layers and select which to show use
Dialogue->Layers (or Ctrl+L).
Paths: to draw a path (e.g. borders of some part of the image) click in
the image window Tools->Path (or B). The path consists of vertices and
edges, you set the vertices by clicking in the picture. You can choose
various types of line (dashed etc.).
Gimp plugins extend its capabilities and can be obtained from the plugin registry.
3. Mplayer (home)
Mplayer is a great media command-line player with a GUI gmplayer.
Currently (2004/11) the gui only works under Linux.
I use "[g]mplayer" to refer both to gmplayer and mplayer.
Real fullscrean
Sometimes when you toggle the fullscreen mode (via 'f' or a
gmplayer menu) only a large black area is added around the movie but it is
not resized. There are two solutions as far as I know:
- either use another video output driver that supports real fullscrean,
e.g. openGL (-vo gl2) or xv if they're supported by your system. Set it
via Preferences->Video or the option -vo <driver name>. The
selected driver may have some other disadvantages, e.g. the driver gl2 on
my system does display new subtitles over the old ones instead of erasing
them before.
- or use the option -zoom to enable software zoom: $ [g]mplayer
-zoom ...
Subtitles
Display subtitles in a black area below the movie
Mplayer loads a subtitle file but default. If not you can use the option
-sub <subtitle filename>.
By default, subtitles can only be positioned within the display area. To
position them outside the movie you need to add a space to it:
[g]mplayer -vf expand=0:-100:0:0
- adds 100px black border below the movie
To set the subtitles' position within the whole area (the movie area + the
border) use the menu Preferences->Subtitle & OSD->Position (0 =
bottom, 100 = top) or the keys r and t.
Warning: there could be a problem if the movie height/width is 3/4, i.e.
if it is in the TV format as opposed to the cinema format - perhpas a part of
it could be out of the screen.
Czech subtitles & the encoding cp1250
To watch a movie with Czech subtitles in the Microsoft's encoding cp1250
you need an appropriate truetype font that contains the Czech accented
characters, e.g. the "unicode" font Luxi Serif - mine is in
/usr/share/fonts/truetype/ttf-xfree86-nonfree/luxirr.ttf. It seems that the
following requirements must be satisfied: your system must have the program
iconv installed and in the path and freetype2 (version
>= 2.1) must be installed too and mplayer must be compiled with the
support for ttf. Then you can run mplayer as follows, specifying the encoding
of the subtitle file with the -subcp option:
mplayer -subcp cp1250 -font
/usr/share/fonts/truetype/ttf-xfree86-nonfree/luxirr.ttf xampleMovie.avi
[-sub a_subtitle_file]
WARNING: if you specify a wrong encoding (e.g. cp1250 while the subtitle
file is in latin2 or utf8) no subtitles will be displayed.
Subtitles & true type font size
To change the size of a true type (.ttf) font used for subtitle use:
-subfont-text-scale N
where N = 1..100 is a percentage of the screen height; by default it's 5,
10 is large enough.
Problems
- "Your system is too SLOW to play this!"
- Try -nocache - may be you're using a cache to play a
non-interleaved AVI file.
MPlayer under Linux
Mplayer - recording a stream (stream not seekable)
You can record a stream by giving the option -dumpstream. But it may
happen that you're able to play a stream without problems (such as
mplayer -playlist http://example.com:8000/listenradio.pls) but if
you add the option -dumpstream you hear no sound and mplayer blocks right
after saying "Stream not seekable!". It may help to find out what is the url
of the stream itself (not the playlist) and use that url instead. You can get
the url from the playlist or by running mplayer with -v and looking for
something like "Filename for url is now http://example.com:8000/".
In my case, running mplayer -dumpstream
http://example.com:8000/ still has not produced any sound and seemed to
block after "Stream not seekable!", but a file stream.dump was created and
was growing, i.e. mplayer was recording (verified with mplayer
stream.dump).
PS: You may be also interested in the ption -dumpfile <name of file to
save into>.
Mencoder - encode a video
Encoding a raw stream video with:
mencoder film.stream -ovc lavc -lavcopts
vcodec=mpeg4:vbitrate=1000:vhq -vf scale=768:576 -oac copy -o
encoded_film.avi
I got the following problem: when I tried to play the result there was
only the audio and mplayer said "Cannot find codec matching selected -vo and
video format 0x34504D46". According to an advice
I've deleted all my codecs.conf (namely /etc/mplayer/codecs.conf), as mplayer
has it built-in, tried to encode again - and it worked!
Note: I think that the command encodes video with mpeg4 implemented by
lavc, the audio is only copied, and bitrate is set to 1000 (could be higher
for better quality).
Merging videos with mencoder
Source: Julian
Coccia's blog
cat *avi | mencoder -oac copy -ovc copy -o myvideo.avi -
This would simply concatenate all avi files in the current directory into
a new video called myvideo.avi, maintaining the original audio and video
codecs.
If you want this video to be viewable in a windoze machine (this part is
not easy), then use the following codecs:
cat *avi | mencoder -oac pcm -ovc lavc -lavcopts vcodec=msmpeg4 -o
myvideo.avi -
4. VLC media player (home)
Display subtitles by default (no need to set subtitle
track manually): Preferences->Input->Choose subtitle track: replace
'-1' by '0'. According to the (French) tooltip it only sets subtitle track
for DVD but in fact it works for CD/files as well.
Position subtitles below the movie: as of today,
2004/12/4, this is not possible except for some DVD subtitles - VLC can only
display the subtitles in the movie area. The feature is on the to do list but
most probably it is not considered to be important. So hope & wait.
NET Applications
1.Apache, PHP, SQL server
The Czech language
See
- PHP - php.ini: default_charset = "iso-8859-2"
- Apache - httpd.conf: AddDefaultCharset ISO-8859-2 See also
AddCharset, AddLanguage, LanguagePriority, DefaultLanguage. Or the best
is to comment AddDefaultCharset out - it has precedence over the meta tag
which prevents you from setting a coding for a page.
- HTML: <meta http-equiv="Content-Type" content="text/html;
charset=iso-8859-2" />
- Database - MySQL's my.cnf: default_character_set = czech
(or latin2)
1.1 Install Apache2 + PHP under Windows
- the Apache and
php
documentation is sufficient.
Notes:
- php.ini must be in the system root (c:/winnt/ or c:/windows/); somebody
says that for the Apache php module you can put php.ini into the Apache
install directory (e.g. C:\Program Files\Apache Group\Apache2\) but for
me it doesn't work.
- You can set some php variables in Apache httpd.conf using the
directive:
<IfModule sapi_apache2.c>
#!! Use "sapi_apache2.c" instead of "mod_php4.c" for apache2 !!
# Values set here do apply only if not overwritten in php.ini
php_value docref_root "modules\php\"
AddType application/x-httpd-php-source .phps
</IfModule>
httpd.conf
In the Apache configuration file httpd.conf do (in addition to those
needed by the php install):
1.
# Allow only local access. Was:
#Order allow,deny
#Allow from all
Order deny,allow
Deny from all
Allow from localhost, 127.0.0.1
Allow from mycomputer.example.com
2. Other examples
# Set parameters for www directory
<Directory "C:/*/my-www-dir"> ... </Directory >
<Directory "C:/Program Files/_net/Apache Group/Apache2/cgi-bin"> ...
</Directory >
DirectoryIndex index.html index.php #added index.php
Alias /my-www/ "C:/me/net/my-www-dir/" # will require the last '/'
#AddDefaultCharset ISO-8859-1 #If not commented-out, will override the
page's charset
1.2 Install Apache2 + PHP under Cygwin
Problems
- In shell run rebaseall or st. like "rebase -v -d
-b 0x68000000 -o 0x10000 /usr/bin/cygintl-1.dll"
- see /usr/share/doc/Cygwin/rebase-2.3.README
- Windows uses the same base address for various .dlls => if you do
not remap you'll get an error like this one:
C:\cygwin\usr\sbin\httpd.exe (1016): *** unable to remap
C:\cygwin\bin\cygintl-1.dll to same address as parent(0x21A0000) !=
0x21B0000
1.3 Personal Apache 1 under Linux
To start Apache if you're not the root you need to:
- Create a directory you've write access to to serve as the server root,
e.g. /home/example/apache
- $ cp /etc/apache/httpd.conf /home/example/apache
- Modify /home/example/apache/httpd.conf:
- Start Apache: /usr/sbin/apache -f
/home/example/apache/httpd.conf # use -F to run in the
foreground
- I'd suggest to copy /usr/sbin/apachectl to a directory on your $PATH
and modify it as follows:
- PIDFILE=/home/example/apache/apache.pid
- HTTPD='/usr/sbin/apache -f /home/example/apache/httpd.conf'
Now you can use 'apachectl start' and 'apachectl
stop'.
1.4 Non-root install of MySQL under Linux
See this discussion.
Summary (if MySQL installed already):
- $ cp /etc/mysql/my.cnf /home/example/mysql
- edit the file to change all paths to point to directories you can write
to;
- Perhaps add (under [mysqld] default_character_set = czech (or latin2 or
utf8 if compiled) and change user to user = example (or whatever your
username). It might be a good idea to change the port it binds to (both
for mysqld and clients) so as not to conflict with another instances of
mysqld (mysqld will start and stop immediately if the port is occupied
without issuing a warning).
You'll need to tell all mysql* programs that you are not using the
default configuration so that they can talk to the server; it's usually
enough to add the option -S /home/example/mysqld.sock
- Optional: you may want to copy & modify /etc/init.d/mysql to start
& stop mysqld more easily.
- Initialize MySQL: $ mysql_install_db
--defaults-file=/home/example/mysql/my.cnf # create grant tables,
create a test database, etc. You may need to add the option
--basedir='' if it ends with the error 'Didn't find
/home/example/bin/mysqld'
- Run the server: $ /usr/bin/mysqld_safe
--defaults-file=/home/example/mysql/my.cnf #
- Optional: verify the server runs: $ mysqladmin -S
/home/example/mysqld.sock version # modify to fit the socket file
set in my.cnf
- Connect, change passwords etc.: $ mysql -S
/home/example/mysqld.sock -u root # user root created by default
with an empty password. Note: after you set a password you need to supply
the option -p to mysql/mysqladmin so that it asks for the
password (otherwise you get "error: 'Access denied for user
'root'@'localhost' (using password: NO)'").
- Drop anonymous accounts (see securing
...): mysql> DELETE FROM mysql.user WHERE User = '';
and mysql> FLUSH PRIVILEGES;
- Create
a database: mysql> CREATE DATABASE example;
- Create a new
user and give her access to the database: mysql> GRANT
ALL PRIVILEGES ON example.* TO 'example'@'localhost' IDENTIFIED BY
'some_password';
Note: if you get the error "ERROR 1045 (28000): Access denied for
user 'example'@'localhost.localdomain' (using password: YES)"
when connecting e.g. by "mysql -v -h 127.0.0.1 -u example -P 6306 -p"
then you need to do mysql> GRANT ALL PRIVILEGES ON example.*
TO 'example'@'localhost.localdomain' IDENTIFIED BY
'some_password'
PHP Note:
If you specify 'localhost' as the server name, the connection will die
with "Warning: mysql_connect(): Can't connect to local MySQL server
through socket '/var/run/mysqld/mysqld.sock' ". Use '127.0.0.1'
instead.
1.4 PostgreSQL run by a non-root under Linux
- Create the "database cluster" (root for databases and various psql
files):
mkdir /home/example/postgresql/data; chmod 0700
/home/example/postgresql/data
/usr/lib/postgresql/bin/initdb -D
/home/example/postgresql/data
- Set the directory where to place a socket (.lock file) - add
unix_socket_directory = '/home/example/postgresql' to the
file /home/example/postgresql/data/postgresql.conf (created in the data
directory by the previous command).
- Run the database (instead of the -D <data directory> option you
can put the directory name into the variable PGDATA):
/usr/lib/postgresql/bin/postmaster -D
/home/example/postgresql/data
Useful options: -p <portNumber>, -k <directory for a lock
file>
You can use he program pg_ctl to start/stop/restart/... your server (give
it the -D option).
- Create a new database - you have to give the absolute path to
the socket directory:
/usr/lib/postgresql/bin/createdb -h /home/example/postgresql
testdb
- Connect to the database as the current user (e.g. username):
/usr/lib/postgresql/bin/psql -h /home/example/postgresql testdb
#connect via the socket
/usr/lib/postgresql/bin/psql -h localhost [-p 5432] testdb username
#connect via tcp/ip
Note: The location of PostgreSQL binaries may be different under other
distributions than Debian.
2. TightVNC - remote desktop server & client
TightVNC is an open source (as
opposed to VNC) software package that let's you see the desktop of a remote
machine and control it. It's available for Windows, Linux and others. You can
even work on you remote Linux machine while sitting at a Windows computer.
TightVNC is not very secure by itself so it's highly recommanded to use SSH tunnelling
(howto) to connect the VNC client and the server. With a windows client
you need a SSH client that supports port forwarding, e.g. the most used one:
PuTTY (see
windows
howto).
Preparation
Tell to the vncserver what window manager and applications it should start
at startup - edit $HOME/.vnc/xstartup
VNC: HOWTO Linux to Linux over SSH
Situation: you are on your local linux box called home.example.net that
runs sshd and you've ssh access to a linux box work.example.net. You want to
test that you can connect from that box via vncviewer to your vncserver
running at home.
1. Setup ssh port forwarding at work
CONSOLE 1:
homeuser@home$ ssh workuser@work.example.net # log into work
workuser@work$ ssh -v -L 5977:127.0.0.1:5907 homeuser@home.example.net # port forwarding; change 'home.example.net' to your machine's name/IP
## SSH should, among others, print a line telling the forwarding is set similar to the following:
# debug1: channel_free: channel 2: direct-tcpip: listening port 5907 for 127.0.0.1 port 5907, ...
## Now you are logged from home to work back to home; 127.0.0.1 is loopback device of home
Notes: notice you must type capital -L . If you type -l instead of it it
won't work and ssh won't let you know you've made an arror.
2. Start the server and the client on the other side
homeuser@home$ vncserver :7 -localhost # allow only connections from 127.0.0.1; the order of options mattters
CONSOLE 2:
homeuser@home$ ssh -X workuser@work.example.net # log into work from another console; -X = allow execution of X applications (GUI)
workuser@work$ vncviewer 127.0.0.1:77 # or 127.0.0.1::5977; vnc shall promt you for your vnc password
Notes
Starting vncserver on the display 7 means it will listen on the port 5907
and telling vncviewer to connect to display 77 means it will connect to the
port 5977.
It's very important to set the port forwarding correctly otherwise I'll
get an error like "vncviewer: VNC server closed connection". I believe it's
because the vnc server accepts by default only local connections, i.e. from
127.0.0.1 and forwarding (work) 5977 to home.example.net:5907 will not use
the loopback device (127.0.0.1) but the ethernet card you to use at home to
connect to the net whose IP is determined by your provider. Thus, though you
formally connect from the localhost (via ssh forwarding) from the localhost,
practicaly it's not percieved as a local connection.
Security: Setting a Firewall
Assumption: your VNC server runs on the display 3.
To make your system more secure you should forbid any connection to the
port 6003 (X server of the vnc) and you should stealth the port 5903 to hide
it from all but the ip 127.0.0.1.
VNC: HOWTO Windows to Linux over SSH
1. Setup PuTTY
Session: set "Host Name" to home.example.com, "Protocol" to SSH
Connection: set "Auto-user name" to homeuser
Connection->SSH->Tunnels: setup Port forwarding - in the section
"Add new forwarded port" set "Source port" to 5977 and "Destination" to
127.0.0.1:5907, click the button <Add>
Session: save the session - type any name into "Saved sessions" and click
<Save>
2. Connect via PuTTY & start the server
In PuTTY click <Open> or click twice to the session name. Type your
password to log in home.example.com.
homeuser@home-over-ssh$ vncserver :7 -localhost # start the
server
3. Start the viewer
Under Windows, start the vncviewer. Server is "127.0.0.1:77". It should
prompt you for your vncserver password.
Possible problems
As far as I know you won't be able to use an iso8859-2 (e.g. Czech)
keyboard/characters because Windows uses its CP1250 encoding while Linux
expects iso8859-2 input, so only rectangles, ? etc. will be displayed instead
of non is8859-1 characters. Perhaps there is a way to correct it, I'd be glad
to learn it.
Firefox - the best web browser ever
My favourite extensions:
- Mouse Gestures
Tabbrowser Extensions (homepage
- not at update.mozilla.org) - lot of bugs and problems; not
recommended
- TabMix Plus - does pretty
the same as Tabbrowser extension. A descendant of TabMix?
- Locale Switcher - change the UI language when next started
- Dictionary Search -
find a selected word in a given dictionary
- DownTHEMall! - download
all page's links based on a filter (e.g. all *.jpg)
- Nuke
Anything - remove any object from the web page
- Flashblock - replaces Flash
objects with a button you can click to view them
- Web
Developer - actions with images, css (e.g. edit css), links to W3C
docs, validation services, ...
- ChatZilla - irc client
- fireFTP (fr)
- Mozilla Archive Format - MAF -
store a complete site in one archive (as IE)
- SessionSaver
- save opened tabs on close & reopen on start
- OpenBook
- allows for customization of the Add Bookmark dialog (the tree
open,keyword input...)
- Download
Statusbar
- More extensions at the Extensions Mirror
Other useful extensions:
- LiveHTTPheaders -
watch the http communication between the browser and a server
- Super DragAndGo - Drag
a link or anything like a uri somewhere on the page to open it in a new
tab.
- Document
Map - Displays the current page's heading structure in the sidebar,
allowing rapid navigation.
- Free Search Engine Optimization Resources - SEOpen site
- Greasemonkey - Allows you
to customize the way a webpage displays using small bits of JavaScript
(can be automatically run for a given page). Platypus is a graphical extension
that allows you to modify a page visually and, in the end, create a
Greasemonkey script to perform the same changes. An archive of
scripts.
- Aardvark - modify web
page: select any element of a page, display some info,
remove/erase/isolate/show its source/... - pretty useful. Try its demo on
the page.
- French
Language Pack for 1.0.4 (homepage)
- Copy plain
text - copy a text from the browser withou formatting
The Plugin "Plugger" (v. 5.1.3)
It wasn't able to handle ppt presentations in the full-screen mode (The
menu in OpenOffice "Start presentation F9"). So I bypassed the plugger's
oocontroler and run it in an external instance of the OpenOffice, which works
fine. For that you need to modify your $HOME/.plugger/pluggerrc-5.1.3 -
replace OO(impres) by a direct call to soffice:
## Presentations
##
...
nokill exits fill: soffice "$file"
#OO(impress)
Various
Open an URL in FireFox
$ mozilla-xremote-client -a firefox
openURL\("http://www.centrum.cz/",new-tab\);
1. JEdit - a great programmer's editor
written in Java
More on jEdit: see my jEdit Developer documentation
page
- Compile C++ from Jedit: 1)install plugin Console; in it type 'g++ -o
myprogram $f' , $f will become a name of the file benig edited. You can
type 'cd $d' to enter the directory of the file being edited.
- My CommentParensFolder
plugin that provides the folding mode "parenscomment" that folds blocks
between '{' and '}' and multilline comments (either /* */ or //).
1.1 Macros & BeanShell
Info about jEdit:
- jEdit.getPlugins() - in the Console it prints names of loaded
plugins
Other
- Run an external application (open a help file):
Runtime.getRuntime().exec("C:\\WINNT\\hh.exe
C:\\php\\php_manual.chm");
- Run an external application on a buffer (open file) -see the function
runInSystemShell in Console documentation.
- Get a FoldHandler:
- ServiceManager.getServiceNames(
"org.gjt.sp.jedit.buffer.FoldHandler" ) - print's a list of all
fold handlers available, let's take e.g. "explicit"
- (FoldHandler)ServiceManager.getService("org.gjt.sp.jedit.buffer.FoldHandler",
"explicit")
- Evaluate a code in a new intepreter (good if you want to declare a
class, change its code and delcare (evaluate) it again):
- bsh> import bsh.Interpreter;
- bsh> myBsh = new bsh.Interpreter();
- bsh> myBsh.eval( textArea.getSelectedText() ); // or
.getText()
- Load a class
- bsh> addClassPath( URL | path ); // e.g.
"/home/me/myjedit/bin"
- bsh> reloadClasses( "mypackage.MyClass" ); // class loading
unavailable in jedit
OR
- bsh> file = new File( "/home/me/myjedit/bin" ) // you can test
file.exists();
- bsh> import java.net.*; loader = new URLClassLoader( new URL[]{
file.toURL() })
- bsh> myClass = Class.forName( "mypackage.MyClass", true, loader
); // true = do initialize;
// use '$' to separate inner name: MClass$InnerClass
// If a parameter is an array of Strings its class is:
classA = java.lang.reflect.Array.newInstance( String.class, 0
).getClass()
- bsh> myClassObj = (mypackage.MyClass)class.newInstance(); // if
it has no argument constructor
or: bsh> myClassObj = myClass.getConstructor(new
Class[]{Integer.TYPE, Object.class}).newInstance( new Object[]{ 5,
null });
BeanShell Troubleshooting & Limitations
So far BeanShell is unable to evaluate a class containing inner classes
used by it:
class Impossible2EvaluateByBeanshell {
//eval causes "internal Error: Attempting to load class in the process of being defined"
public static void iWillFail( java.io.File dir )
throws MyInnerClassException {}
static class MyInnerClassException extends Exception {}
}
jEdit's menu bar
- Add a menu for a plugin:
class = "plugin.jcompiler.JCompilerPlugin";
menu = new EnhancedMenu( class+".menu", jEdit.getProperty(class+".name")
); // not all plugins have .menu; there's may be .menu-item or
.menu.code
view.getJMenuBar().add( menu );
- Remove the last menu: view.getJMenuBar().remove(
view.getJMenuBar().getComponent(view.getJMenuBar().getMenuCount() - 1)
);
- Or remove the created menu: view.getJMenuBar().remove( menu
);
- And redisplay the menu bar: view.getJMenuBar().repaint()
1.2 Plugins
CODE BROWSER
Show 'class::method' instead of 'method': locate your ctags config file
(e.g. ~/.ctags) and add the line '--extra=+q'. Note: #aComment is not allowed
in the file.
1.3 LaTeX utilities
- A plugin "LaTeX tools"
- Macros: Latex.bsh
that presents you with a panel of latex commands to be inserted on click;
you can also get it from community.jedit.org
by searching for Latex macros (no quotes around!). Latex.py (needs jython, I haven't
tried it).
2. Software for XML (Oct 2004)
- Parsers - the most important: expat (small, in
portable C, non-validating), libxml2,Xerces2-J (Java, belongs to Apache
XML); PHP5: dom xml, simpleXML (based on libxml2), PHP4: expat, dom xml
(based on libxml2).
- Transformations:
- XSLT - Xalan2-J (in Apache XML; in Xerces2-J?), Saxon (implements
XSLT 2.0), libxml2 (C++), Xalan-C++, PHP5: libxslt (based on
libxml2)
- XSL/FO (exact formatting language) - FOP (Java, in Apache XML, v
0.20.5 is nearly complete).teX (PassiveTeX) - good for publishing,
not for web, uses TeX makra; xmltex.
- Systems: Cocoon - in Apache XML, framework for web
application development, Java. Content Management
Systems: Forrest (in Apache XML) - a documentation system based
on Cocoon. AxKiy - as Cocoon, in Apache XML, Perl. Native XML
Database: Xindice (in Apache XML) questioned via Xpath, see also
XUpdate, XML-RPC. Scripts in PHP, ... .
- SAX
- Simple API for XML - suggested API to be used by parsers => it's
possible to change the parser you use.
CANNOT CREATE BUT CLASSES/USE CASES:
State and activity diagrams can only be created when a class or actor is
selected => create a class/actor first, click on it and voila!
4. Eclipse Tips
Version: 3.1.0, Linux GTK
Plugins
I'd recommend to separate your plugins from your eclipse instalation. That
will make upgrades easier.
- Create a folder for the plugins such as
/home/me/eclipse-plugins with the subfolders:
/home/me/eclipse-plugins/eclipse
/home/me/eclipse-plugins/eclipse/plugins
/home/me/eclipse-plugins/eclipse/features
- Create the file
/home/me/eclipse-plugins/eclipse/.eclipseextension that
holds the minimal version of Eclipse required. Its content should be
something like:
id=org.eclipse.platform name=Eclipse Platform
version=3.1.1
- Notify Eclipse of the plugin directory - in your eclipse instalation
directory create the subdirectory links/ that will hold text
files ending with .links and containing paths to the extension locations
(path=...) - our example my-eclipse-plugins.links will
contain:
path=/home/me/eclipse-plugins
Some useful plugins:
- Coffee-Bytes Eclipse Folding Plug-in (www)
enhances the default Eclipse code folding feature set with many
additional options and plenty of new functionality. Update site:
http://eclipse.coffee-bytes.com/update-site
- eSpell3 - Generic
spell checker plug-in for the Eclipse
- Properties
Editor - Handy for Unicode in properties files - automatically
replaces characters by their entities.
Languages
- PHPEclipse -
update site:
- TeXlipse - LaTeX editing
plugin, update site: http://texlipse.sourceforge.net/
Tips & Tricks
See Help->Tips & Tricks - they're great!!!
- Change the value of the template variable {$user}
- It's obtained from the java system property 'user.name' => edit
eclipse.ini and add e.g.:
-Duser.name=Jakub Holy
- Size of the recently opened files list
- Change it in Preferences/General/Editors/"Size of recently opened
files"
Useful hotkeys
A = Alt, C = Control, S = Shift
- C-S-R
- Find a resource (any file) in the project
Java editing (JDT - Java Devel. Tools)
- Pop-up JavaDoc on classes/methods/fields: F2 or
Edit->Show Tooltip Description.
For external jars set the JavaDoc location:
Project->Properties->Java Build Path, the tab "Libraries" - click
the little arrow left to the jar file name to expand its information,
select "Javadoc location", press the button "Edit" and navigate to the
directory with the jar doc's package-list and index.html.
I'd also suggest to set "Source atachement" (where the source files are
located) because, for some reason, setting the javadoc location is not
sufficient for the pop-up javadoc info, it only works with an external
browser (Shift-F2 instead of F2). But when I set
the source location the popup started to display the javadoc too.
- Completition: Ctrl+SPACE
Java debugging
Find out the return value of a method: select the whole line return ...;
and inspect it (Ctrl+Shift+I, or through the context menu).
C++ editing (CDT)
Code formatting for C++
Get the GNU indent
plugin (it requires GNU
indent to be installed). As the gnu indent assumes tab width to be 8
while Eclipse uses 4 by default you either have to change it for indent (the
option --tab-size4) or for Eclipse (Window -> Preferences -> Editors
-> Text Editors - "Displayed tab width").
GNU indent uses the GNU Coding Style
by default.You can change the formatting by specifing some options in a
.indent.pro file that is either in the same directory as the one
indent is run from or in your $HOME. My .indent.pro contains:
--blank-lines-after-declarations
--blank-lines-after-procedures
--brace-indent0 // '{' in the same column as 'if'
--tab-size4 // the default in Eclipse
Eclipse & CVS
Eclipse & CVS over SSH
Eclipse 3.1.1, Jan 19 2006
If you use CVS over ssh (the ext method) and you authenticate
yourself using a private+public key pair protected by a password:
- Preferences > Team > CVS > Ext Connection Method: select "Use
another connection type method..." and set the connection type to
extssh. (Using an external program with CVS_RSH set to ssh and
CVS_SERVER = ssh results in "Unknown response received from cvs server:"
with no details when you attemp a cvs operation).
- Preferences > Team > CVS > SSH2 Connection Method, tab
General: click Add Private Key... to add the private key you use to
authenticate with the server.
This should be all. When you attemp a cvs operation you should be prompted
for your password.
CVS tips
Replace by a previous version: context menu: Replace with > Revision
> click on the revision with right mouse button and select "Get Contents";
open & save & commit the file.
- OOoLatexEquation
- A macro that let you use LaTeX to create equations & whatever
else and include it in OOo. Looks very cool. Homepage.
- Writer2LaTeX/xhtml/BibTeX & Calc2xhtml
- A Java converter from OOo to the given formats. See its homepage.
OpenOffice 1.0.2 - poznámky [CZ]
Problémy a Resení:
- PYestane fungovat (automatická) kontrola pravopisu
- Pøíèina: není urèen jazyk textu, resp. toto urèení se vypaøilo.
Øe¹ení: 1. Vybrat v¹echen text (Ctrl+A), 2. Formát->Znak: nastavit
jazyk na èeský ( i jiný).
- Nefunguje dokonèování slov (hlavnì po spu¹tìní)
- Mo¾ná pøíèina: seznam slov je prázdný a nedoplòuje se (i kdy¾
"Shroma¾ïovat návrhy" je zatrhnuto). Øe¹ení: Nástroje->Automatické
opravy/Formát->Dokonèování slov: zru¹it volbu "Shroma¾ïovat návrhy"
a zmáèknout OK, pak ji znovu povolit a OK.
- Písmo UI
- Zmìna písma UI: Tools -> Options -> OpenOffice.org -> Font
Replacement, za¹krtnout "Apply Replacement Table", napsat "Andale Sans
UI" - musím to napsat, proto¾e v dropdown menu to není.
- LINUX: OpenOffice blocks at startup, perhaps after being killed / a
crash
- Use 'strace soffice' to find out where exactly it gets stucked.
Perhaps it's when it tries to connect to a socket left by the previous
version (something like "connect(9, {sa_family=AF_FILE,
path="/tmp/OSL_PIPE_1000_SingleOfficeIPC_...") => killall
soffice.bin, remove the socket from /tmp, try to start soffice and it
should be ok.
OpenOffice 1.1.2 - poznámky
- Vkládání nezalomitelné mezery za jednopísmenné pøedlo¾ky
- Viz makro vlnka.
Czech TeX/LaTeX under Debian
Support for Czech is included in the basic tetex-* (base, bin, doc, extra,
lib, non-free) packages since Woody (see).
You only need to enable it. If you've Sarge, use run texconfig
and click "FORMATS", which will open a file in vim, uncomment whatever you
want (e.g. the section "Czech") and type ':wq' to finish. Texconfig will
automatically apply the changes and generate the uncomented formats.
Correct hyphenation
- Either use '\usepackage{czech]' and process with [pdf]cslatex and do
not use babel
- Or use babel ('\usepackage[czech]{babel}' but not usepackage{czech})
and process with [pdf]latex.
tex2rtf & Czech
It was hard to create a RTF with correct Czech. Finally, I discovered a
method that shall work (for a text in iso-8859-2(latin2)): 1. The source
cannot contain neither '\usepackage{czech]' nor '\usepackage[czech]{babel}';
2. The source must include '\usepackage{babel]' and
'\usepackage[latin2]{inputenc}'; 3. process with:
latex2rtf -C latin2 -i czech my-latin2-file.tex
vlna: jednopismenne predlozky
Pred publikaci je treba pustit na zdrojak program vlna, ktery nahradi
mezery za jednopismennymi predlozkami a spojkami nezlomitelnou mezerou (s
tebou -> s~tebou). Program je napr. na ftp://math.feld.cvut.cz/pub/olsak/vlna/.
utf8 in LaTeX - package utf8
\usepackage[utf8]{inputenc}
- it cannot be used together with babel (including things like
\usepackage[T1]{fontenc} and \usepackage{czech} -
you have to remove them to get rid of errors).
- it requires the package latex-ucs (apt-get install latex-ucs) = utf support
for latex
- make sure that your editor saves the file in utf8; I can only recommand
jEdit.
- and that's all! you can start typing e.g. Czech characters.
Powerpoint-like presentation with LaTex
- Beamer - a
recommanded way of creating presentation. (apt-get install latex-beamer)
Clanek
o Beameru na root [CZ].
- TeXPower - "a bundle of
style and class files for creating dynamic online presentations with
LaTeX", links to alternatives. Indeed cool!
- pdfscreen - the LaTeX pacakge. See Creating `Powerpoint-like' presentations
with LaTeX.
LaTeX examples
Define a new command that displays a given text in
italic and adds quotes around it
\newcommand{\inlcitace}[1]{,,\textit{#1}''}
Usage: here comes \inlcitace{quoted string in it} end.
GPG - GNU Privacy Guard (GnuPG)
GnuPG is an Open Source replacement for PGP (Pretty Good Privacy), which
is a program and standard for cryptographic privacy and authentication. It's
used to sign and encrypt messages and files. See GnuPG homepage for more information.
Key servers
Search Google
for 'gpg "public keyserver"'.
Create your own key pair
- gpg --gen-key # answer the questions; your key info will be
"your-name (a comment) <user@domain>"
It will print something like "pub 1024D/93887B45" => your public
key ID is 0x93887B45. The key may be identified either by it's id or by
the user@domain you specified during the generation.
- Create a revocation certificate for the key:
gpg --output gpgkey-revoke-certificate.asc --gen-revoke <key
ID> # the certificate will be in
gpgkey-revoke-certificate.asc
Note: you created a "generic" revocation certificate; if you revoke
the key for a special reason it's a good idea to create a new revoc.
certificate and state the reason in it.
- Export the public key so that you can send it to somebody:
- Export the public key to a keyserver (e.g. pks.gpg.cz) - most of them
share the keys so it's enough to choose one:
gpg --keyserver www.keyserver.net --send-key
<user@domain>
Verify a file's signature
- Find & import author's key: gpg --keyserver www.keyserver.net
--recv-keys <key ID> [OR: --search-key
<user@domain>]
Note: instead of user@domain you can search for a part of
the key info (e.g. "jakub holy" or "Jakub Holý")
but it's slower.
Some key servers have web interface for searching keys, e.g. wwwkeys.eu.pgp.net.
If some key server doesn't respond it may be down, try another one.
- Check the signature: gpg --verify filename.asc
Notes
- You should only use keyservers
you trust - anybody can 1. Create a key with the same info (user@domain)
as the key to be faked; 2. Modify the message/file to be faked and sign
it with this file; 3. Set up his own keyserver and upload there the fake
key. 4. Direct a user to this keyserver. I can state here that my key is
to be found e.g. at wwwkeys.eu.pgp.net, and
subkeys.pgp.net (and many others) but a malicious hacker could change
this page and replace them by a fake keyserver.
To be more sure you access a credible key server, find it's address in
the "Gnu Privacy Guard (GnuPG) Mini Howto" at GnuPG homepage, the section
7.3: "Keyservers" (unless they've changed it).
OFFICE
- Open Office ( èesky)
- OpenOffice.org XML
Essentials: Using OpenOffice.org's XML Data Format - an on-line
book; also inside: XML intro, some Java code.
- OOo XML
filtres
- OOoMacros for end-users and
developers
- Writer2LaTeX
(xhtml, BibTeX) - output filter to produce strict xhtml and more.
- Unofficial
FAQ (cz): ne/plovoucí okna: C+mouse click/drag.
- HTML editors with with graphical display of pages:
- Amaya by w3c
- Nvu - based on Mozilla
technology
PROGRAMMING etc.
- ArgoUML - An Open Source UML
design tool with cognitive support. Written in Java, Java Web Start
enabled. Code generation. Various modules available.
- Dia - An Open Source
gtk+ based diagram creation program.
- EclipseUML Free
Edition plugin by Omondo
- Reverse Engineerings and Code Exploration
- Doxygen (Java,
C&C++, ..., partly PHP) can be also used to process undocumented
code; it can generate collaboration, class hierarchy etc. diagrams;
pretty good.
- RedHat Source
Navigator (C, C++, Java, Tcl, [incr tcl], FORTRAN, COBOL,
assembly). I use it in addition to Doxygen.
MEDIA
- Audacity - Open Source
sound editing and recording software. (Note: For recording, make sure
you've selected the right input source (e.g. "stereo mix") on the Mixer
toolbar.)
- Codecs: KL Codecs
Resource Page (Real/QuickTime Alternative, ...)
UTILITIES / VARIOUS
- Narval: A
framework (language + interpreter + GUI/IDE) dedicated to the setting up
of intelligent personal assistants (IPAs; software agent). The purpose:
"... prepare your morning newspaper, help you surf the web by filtering
out junk ads, keep searching the web day after day for things you want,
participe in on-line auctions, learn you interests and bring you back
valuable information, take care of repetitive chores, answer e-mail,
negociate the date and time of a meeting ...".
- Sumatra TT: universal
data pre-processing system allowing to access and transform data stored
in various types of datasources, in Java. CZ: "Nástroj vhodný pro
pøedzpracování, vizualizaci a datamining. Obsahuje moduly, které lze
uspoøádat do dataflow schématu a jím potom nechat projít data. Hodí se
pro získání prvotních informací o datech a následné pøedzpracování pro
vstup do neuronových sítí. Výsledky lze té¾ vizualizovat."
- Weka 3: Data Mining
Software in Java
SECURITY
- Steghide - a
steganography program that is able to hide data in various kinds of
image- and audio-files.
SYSTEM
- Bochs "is a highly portable
open source IA-32 (x86) PC emulator written in C++, that runs on most
popular platforms. It includes emulation of the Intel x86 CPU, common I/O
devices, and a custom BIOS." It emulates the whole PC => you can use
it to run another operating system in it (Windows 95/NT, Linux and more).
It's relatively slow because it emulates the whole PC.
Jakub Holý 2004 AD