Pages of pts (pts oldalai)

See my computer how-to blog as well.
See my GitHub repos as well.
Most of the information on this page is available only in the
Hungarian version of this page. Stay tuned for the
full-featured English version.
You can read some
of my old writings (poems, notes, short novels) in Hungarian language on
my personal home page. If your
browser has problems displaying it, try this
link. I've created my personal home page in September 1999, and I haven't
touched it since. All new material (documents, links and downloadable
software) are listed directly on this page. See the
Hungarian version of this page to get even
more new material.

Please enable JavaScript in your browser to see my e-mail address.

Documents, manuals, howtos, tutorials

A Magic Header for Starting Perl scripts
(article appeared in The Perl Journal in April 2003)
Most Perl scripts start with a line beginning with
#! and containing the word perl
(for example, #!/usr/local/bin/perl -w). This line tells
the Unix operating system that it should invoke the specified perl
interpreter with the specified options, and that interpreter will take
care of the Perl script. Although the concept of this first line is
simple, writing it to be universally applicable tends to be very hard.
The article presents the evolution of a magic Perl header, which can take
care of finding the Perl interpreter and set up a proper environment for
starting the Perl script.
[get the magic header and accessories][view an earlier, plain text version of the article][download issue in PDF][download issue in PDF from external website]

rdesktop AltGr fixes:
This tutorial describes how to make the AltGr key work in rdesktop (for
Hungarian layouts), and how to make it possible to use several Windows
keymaps.

pts' tutorial for initiating
free phone calls using VoipBuster:
VoipBuster provides an internet-based telephone (VoIP) service with quite
low rates. Landline numbers of some target countries (including Australia,
Austria, Belgium, Canada, Czech Republic, Denmark, Finland, France, Germany,
Greece, Ireland, Luxembourg, Netherlands, Norway, Portugal, Spain,
Sweden, Switzerland, United Kingdom, and United States) are completely free
to call. See the exact
rates (in Euro-cents per minute). The tutorial tells you how to
set up your computer so you can use this service.

pts' Debian package
tutorial:
The tutorial will teach you how to make a Debian package from a source
.tar.gz, and how to set up a Debian package repository so anybody can install
your packages (and their dependencies) with a single invocation of
`apt-get install'. The document can serve as a tutorial for newbies, and a
reminder for for those who already have some experience.

pts' TV recording with
video4linux tutorial:
The tutorial will help you installing everything so you can watch and
record TV and FM radio programmes on your PC running Linux. The tutorial
focuses on properly configuring the hardware drivers, because that's the
trickiest and the otherwise least documented part of the process. xawtv will
be used to watch TV, and mencoder will be used to record it.

pts' CVS over SSH tutorial
for Win32 systems:
The tutorial will help you installing and using WinCVS for sharing and
concurrent editing of your development project source files on Win32 systems.
This tutorial is for beginners (i.e. who have never heared of CVS before,
but have Win32 experience as a programmer or at least a power user), and it
is not exhaustive.

pts' tutorial for
simple i386 ELF binary patching using NASM:
The tutorial is for those programmers who would like to make small changes
to i386 ELF binaries which they don't have the source code available for, or
it is not feasible to recompile the whole source code.
The tutorial is work in progress.

Syncless:
an experimental, lightweight, non-blocking (asynchronous) client and server
socket network communication library implemented in Stackless Python 2.6.
Syncless contains an asynchronous DNS resolver (using dnspython) and a HTTP
server capable of serving WSGI applications. Syncless aims to be a
coroutine-based alternative of event-driven networking engines (such as
Twisted and FriendFeed's Tornado). Syncless is already about that fast, but
it has less features and it's less stable now.
[project page]

ETSHome: a version of ETS
(the web-based practicing system
of our Deklaratív Programozás (Declarative Programming) course),
which can be used at home, without internet. The user interface is
in Hungarian language.
[download for
Linux] (statically linked, libc-independent)
[download for
Win32] (works in Win98 and WinXP, doesn't work in Win95)

PTetriS game: classic Tetris game running as a Java applet in a web browser
[game]

sam2p:
sam2p is a UNIX command line utility written in ANSI C++ that converts many
raster (bitmap) image formats into Adobe PostScript or PDF files and several
other formats. The images are not vectorized. sam2p gives full control to
the user to specify standards-compliance, compression, and bit depths. In
some cases sam2p can compress an image 100 times smaller than the PostScript
output of many other common image converters. sam2p provides ZIP, RLE and
LZW (de)compression filters even on Level1 devices.
Download the newest version
[download, .tar.gz].
See the sam2p home page (in English)
[link].
Read some documentation:
EuroBachoTeX 2002 (PDF) (conference
proceedings in English);
EuroBachoTeX 2002 (PDF) (conference
slides in English).

dvdmenuauthor:
dvdmenuauthor makes it easy and efficient to author a DVD with menus in an
indirect (non-WYSIWYG) way. An XML project file drives the DVD authoring,
from which both menus and a dvdauthor XML file are generated, and dvdauthor
(and spumux) are used to author the DVD filesystem. Menu items (buttons and
static items such as images and text) can be specified conscisely in the
project XML file with LaTeX markup (to be processed by pdfLaTeX and rendered
by xpdf).
[download .tar.gz]

SafeWeb: SafeWeb is a personal homepage middleware environment for Apache (including
1.3 and 2.0) for UNIX. It provides page hit counting, detailed visitor
logging, server-side includes (SSI), safe setuid CGI (with or without
suEXEC) by installing appropriate CGIs and .htaccess for a single user,
without the need of becoming root or restarting Apache. SafeWeb is easy to
install and easy to use.
[CVS
snapshot download]

Prolog Web Container (PWC): a web application framework for dynamic web
page generation using the Prolog language. It is an environment in which the
web interface of Prolog expert systems can be developed -- without having to
involve another programming language. The API it provides for the web
applications is similar to CGI and Java Servlet. It has full Unicode
support, code persistence with FastCGI, CGI environment variables and
automatic reload if the code changes. A JSP-style preprocessor with beans,
session handling and an SQL database API are planned. It works with Apache
mod_fastcgi, and a tiny standalone webserver (written in Perl) is also included.
Only SICStus Prolog 3.12.x is supported. Most of PWC is written in Prolog,
the performance critical parts are in C.
[CVS
snapshot download]

pts-elfdisasm: i386 ELF disassembler, runs on i386 Linux and i386
FreeBSD. It is an extended and bugfixed release of elfdisasm-0.11.
[download .tar.gz]

pts-fakeroot-sqlite3 patch:
provides an SQLite3 storage backend to
fakeroot, which is a persistent, consistent and simultaneously accessible
fake file attribute store. Only the code of faked(1) is changed. Such a
store is useful for rsync-based backups where root access on the target
machine is not available. Use of the pts-fakeroot-sqlite patch is not
recommended, because the store is way too slow. For a working
and efficient solution, try rootpretender
instead.
[download the stripped-down version
of fakeroot 1.2.10][download .patch]

rootpretender:
is an efficient facility that enables special file operations (such as
creating block special and character special device nodes and unlimited
chown()ing of files) for non-root users of UNIX systems. Application
processes under rootpretender's control do not get special privileges (and
setuid is not needed either), but special file operations are faked (e.g.
chown() is not executed, and mknod() creates just regular files instead of
device nodes), and the faked operations are remembered, so next time a
process under rootpretender's control examines an affected file with
stat() or a similar system call, the fake information is returned.
rootpretender works with LD_PRELOAD for dynamically linked Linux
binaries, and patches to rsync 2.6.6 and rsync 2.6.9 are also provided
in the tarball (so rootpretender works with rsync even on UNIX systems
without LD_PRELOAD support). By running rsync under rootpretender's
control on the target host, it is possible copy file ownerships and
device nodes even if root access is not available on the target.
[download .tar.gz][download rsync-2.6.9.tar.gz]

smarthome.js:
Example JavaScript script for Kate 2.5.2 implementing a smart
<Home> key. It jumps to position 0 first, and if pressed again,
it jumps to the indentation (in front of the
first non-whitespace character in the line).
[download .js]

genmpeg.pl:
genmpeg.pl is a Perl script that generates a simple MPEG2 program stream
file from a series of input images and/or solid colors. The file will
also have two audio channels with simple sine waves.
Both PAL and NTSC and many aspect ratios are supported. The generated
MPEG2 file is suitable for direct DVD title and menu authoring with
dvdauthor, without
the need for reencoding. ffmpeg is requred.
[download .tar.gz]

movemetafs:
movemetafs is a searchable filesystem metadata store for Linux (with MySQL,
Perl and FUSE), which lets users tag local files (including image, video,
audio and text files) by simply moving the files to a special folder using
any file manager, and it also lets users find files by tags, using a boolean
search query. The original files (and their names) are kept intact.
movemetafs doesn't have its own user interface, but it is usable with any
file manager.
movemetafs also lets users attach (unsearchable) textual
description to files.
[download .tar.gz]

mosmle.static:
mosmle.static is the most compact standalone Linux port of Moscow ML 2.01.
It doesn't need any external files (except for its own executable)
to operate. It also runs from any directory.
It runs on Linux, and it is statically linked and libc-independent.
mosmltop and basic *.ui and *.uo are integrated into the mosmle.static
executable.
Loading .so or .dll files (modules written in C) is not supported.
The following modules are integrated and preloaded:
Array BasicIO Char CharArray CharVector List
Misc Nonstdio Option Strbase String StringCvt TextIO
Vector Word Word8 Word8Array Word8Vector Int.
The following modules are integrated but not preloaded: Real.
[download .zip][download .zip from MoSML official website][visit official website]

hello-linux-2.6-module:
A simple, dummy hello world kernel module with a Makefile
for Linux 2.6. See also The Linux Kernel Module Programming Guide
before writing your own Linux kernel modules.
[download .tar.gz]

rfsdelta:
rfsdelta is a kernel module for the Linux 2.6 series, which collects all
filesystem inode changes (recursively), and reports them to a userspace
process. It is similar to inotify, dnotify (but provides recurisve
notification, and only a single watcher process is allowed), fschange,
fsevent and rlocate (but also reports unlink(), rmdir() and st_*). rfsdelta
was based on the kernel module shipped with rlocate 0.5.5.
[download .tar.gz]

pts-mysql-local:
a local packaging and installation
of MySQL server (the GPL edition) for Linux i386. pts-mysql-local doesn't
need system-wide installation or root privileges, and it doesn't conflict
with existing installations of MySQL servers on the same host.
pts-mysql-local is designed to be run on machines used for software
development.
[download .tar.gz]

wavrp:
wavrp is a minimalistic Linux command line tool which can record and play
back uncompressed WAV audio files. It is the enhanced version of the wavr and
wavp utilities.
An external program such as aumix is necessary to set the volume.
[download .tar.gz]

pts-xclip:
Improved command line interface for reading and writing the X11 clipboard
and selection. pts-xclip is forked from xclip 0.08. In addition to
the features of xclip, pts-xclip supports Unicode (setting and retrieving
the X11 selection in UTF-8), it respects the locale (and converts the
selection to the locale charset), and it provides an infinite mode, in which
it runs indefinitely and emits a quoted line to stdout whenever the X11
selection changes.
[download .tar.gz]

pts-rdate:
Set the Linux system's date from a remote host, also with HTTP.
pts-rdate is a replacement of the BSD rdate(1) utility. Additional features:
read from HTTP, display time in GMT and local time, retry infinitely until
time server replies. pts-rdate displays and sets the local date and time
from the host name or address given as the argument. It uses HTTP and/or
the RFC868 protocol. (RFC868 is usually implemented as a built-in service
of inetd(1).) Accessing a HTTP server is a good choice, because it is
usually enabled in firewalls -- at least it is more accessible nowadays
than an RFC868 server.
[download .tar.gz]

pts-svnserve:
A patched svnserve 1.1.4 that can restrict --tunnel-user requests
pts-svnserve is a patch to svnserve (of subversion 1.1.4 found in Debian
Sarge), which gives the repository administrator control over users coming
through the SSH tunnel (--tunnel-user), so he can specify a list of allowed
users; everybody else will be denied. (The unpatched svnserve just grants
access to everybody coming with --tunnel--user.) The patch makes it possible
to host several repositories with SSH public key access on the same server,
but restricting access to certain repositories. (Newest svnserve versions
have similar functionality built in.)
[download .tar.gz]

pts-ftpd:
a small and easy-to-configure FTP server for UNIX. It is easy to
configure (it can run even without a configuration file). It supports
anonymous logins. It doesn't need
root privileges. It can do chroot. It can use zsh for better filename
globbing. It doesn't use UNIX users, but it has user--password pairs in the
configuration file. It can run standalone or in inetd. It can run in the
background or in the foreground. It can do continued uploads and downloads,
even for large files (i.e. files bigger than 2 GB). It doesn't support SSL
(or AUTH SSL). It doesn't need external programs such as /bin/ls. It can be
linked statically with uClibc. The
software is based on bftpd-11.0.24 with many bugfixes and improvements.
[download .tar.gz]

NanoSpell:
a very simple fake spell checker in Perl, implementing the
`ispell -a' protocol. It can be used to debug the implementation of
ispell-compatible interface of word processing applications. The full list
of good words are hard-wired to the script. NanoSpell gives suggestions
for wrong words, it understands Unicode and I/O charsets, it can check
HTML and plain text documents.
[download .tar.gz]

wavfix.pl: a Perl script that fixes the header of a PCM WAV file
after the process generating it has crashed and failed to provide proper
size information in the headers. It also makes the WAV file loadable
in GWC and normalize(1).
[download Perl script]

install_grubp.pl:
a Perl script that installs GRUB stage1 boot code into a
floppy disk or primary or logical hard disk partition containing a FAT
(FAT12, FAT16 or FAT32) filesystem, on an i386 system running Linux. Unlike
the standard GRUB `install' command, after the installation, stage2 can be
moved physically anywhere inside the partition. The mtools package is
recommend but not required by install_grubp.pl.
[download Perl script]

uncompress.pl: a Perl script that
autodetects the compression type on its STDIN, and then
uncompresses its STDIN to its STDOUT with the appropriate external program
(gzip(1) or bzip2(1)). uncompress.pl autodetects zlib (RFC 1950), gzip
(RFC 1952), compress and bzip2 file compression formats. uncompress.pl
converts zlib to gzip
format on-the-fly so gzip(1) can extract it.
[download Perl script]

a2ping.pl:
A Perl script that converts between EPS, PS, PDF, PCL5 and raster formats
conveniently and smartly. Uses external programs with appropriate
options and parameters and preprocessed input to do the hard work. Needs
a UNIX system to work properly.
[download Perl script]

jdisasm.py:
A Java class file disassembler implemented as a Python script. jdisasm.py
displays a java .class file in a human readable form, showing the
class name, the field names and types, the method names, types and codes
(including instruction mnemonics). For each item shown, the file offset is
prepended. (Neither javap or jad can display the file offset.)
[download .tar.gz]

ClassPublic.java:
A Java .class file converter which makes a Java class
public and non-final, its fields public and its methods public and
non-final. ClassPublic.java has a compact implementation, depending only
on a J2SE 1.5.0 or newer. ClassPublic.java can be used to increase
interoperability and code reusability of a .class file whose .java source
is not available or it is not feasible to recompile.
[download .zip]

pts_generator.rb: a working but simplified implementation
of generator.rb
for Ruby, which is not as buggy as the one found in Ruby 1.8.5.
[download .rb] And an example program
(prime number sieve): [download sieve.rb].

SpeedySu: a modification of SpeedyCGI (a.k.a. PersistentPerl) so that it
works with suEXEC-enabled Apache webservers. Both Apache 1.3.x and 2.y
running on UNIX systems are supported. SpeedyCGI speeds up Perl scripts (CGI
or not) so that they remain running persistently, thus the startup times of
subsequent executions are reduced. SpeedySu extends SpeedyCGI by allowing
~UserDir CGI scripts started by Apache execute with the privileges of their
owner user. SpeedySu contains other improvements in addition to suEXEC
support. Most SpeedySu features can be enabled and disabled in the
configure command line.
[download, tar.gz][download
CVS snapshot]

examplep.sty: LaTeX package that makes typesetting verbatim
examples and code excerpts easier. It supports dual view (i.e. the
(LaTeX-)source and the result are typeset side-by-side). It can emit the
examples to external files (to be included onto a CD).
[download, ZIP][download, LaTeX .sty from CVS head]

graphicp.sty:
GraphicP is a system that provides an easy, fast and reliable method for
including external images into LaTeX and plain TeX documents. The
\includegraphics macro of GraphicP is a drop-in replacement of the same
command of LaTeX graphics.sty and
graphicx.sty, but with many enhancements.
Input images are ususally in EPS or PDF format. Drivers for xdvi, dvips,
pdftex and dvipdfm are included. Perl scripts are provided for conversion
and faster bounding box manipulations.
[home page],
[download],
EuroTeX 2003 conference article
[PDF].

pts_enhu_keyboard_layout:
pts_enhu_keyboard_layout contains a combined US--HU keyboard layout
(US layout with Hungarian accented characters with AltGr) for
Windows XP and the X11 6x13 fixed font (FixedMedium.ttf), to be
used with PuTTY and Win32 text editors. The font is also useful on an X11
system with applications using only XFT fonts.
[download .zip].

Obfuscated source code

On the first day of Christmas... (xmas2006.c)

The C program source code below prints a well-known
Christmas poem. However, if you compile it in C++, it still works, but prints
the poem with a slight modification. Even more, the program is also a valid
Perl script, and prints the poem with a different small modification. If you
want to print the poem, compile the source code with plain TeX! If you
have problems copy-pasting it, you can download the
[source code]. The original C source is part of the
programming folklore ([source code]),
the C++ port and the Perl and TeX versions are my own work. Here it is:

The program that speaks ten languages (just_hacker.c)

The following program can be compiled in ten different programming
languages -- and it prints something different in all of them).
The languages: C, C++, Perl, TeX, LaTeX, PostScript, sh, bash, zsh and Prolog.
See the original, six-language version of the program here:
[link]