TL;DR Nothing significant. Upgrading doesn’t bring any benefits. I’ve done binary analysis on tasm32.exe version 5.3 (2000-01-30, part of C Builder 5 and C Builder 6) and version 5.4 (2013-12-08, part of RAD Studio XE5, first published on 2009-01-14 as part of RAD Studio 2009), and I’ve found that no functionality has been added, removed or changed (and there were no bugs fixed), except for the…
This blog post is a beginner-level tutorial explaining how to use HSQLDB , an SQL relational database system (RDBMS) written in Java. HSQLDB supports both the client-server model (i.e. the server opens the database files) and the embedded model (i.e. opening the database files directly). In both cases we mean use the term client meaning the process which initiates the SQL statement. Each HSQLDB…
This blog post explains how to download and use Docker on Linux amd64 without installing it, and how to clean up afterwards. It complements the official instructions , and contains some copy-pasteable commands. You will need to start dockerd as root, so we assume that you can run commands as root with sudo . Visit https://download.docker.com/linux/static/stable/x86_64/ , and choose a Docker…
This blog post explains how to use Digital Mars C Compiler 8.57 on Linux with Wine to cross-compile to EXE files of 16-bit DOS, 32-bit DOS and 32-bit Windows (Windows 95 -- Windows 10). The actual program compiled is quite dumb (it doesn't matter), the focus is on installation and command-line flags. Please note that Digital Mars C Compiler hasn't been ported to Linux, so we need to run it in…
This blog post explains how to use OpenWatcom 2.0 C compiler on Linux (i386 or amd64, any distribution) to cross-compile to EXE files of 16-bit DOS, 32-bit DOS, 16-bit Windows (Windows 3.1), 32-bit Windows (Windows 95 -- Windows 10), 16-bit OS/2 (1.x) and 32-bit OS/2 (2.x). The actual program compiled is quite dumb (it doesn't matter), the focus is on installation and command-line flags. All…
This blog post gives some examples how much faster in-memory algorithms are in scripting languages than in C. Before writing this blog post I had the general impression that the speed ratio between code in a scripting language and code in C for the same CPU-bound algorithm is between 5 and 20. I was very much surprised that for LZMA2 decompression I experienced a much larger ratio between Perl and…
This blog post explains how to use recursive Perl regular expressions (regexp) to match substrings with balanced parentheses. Recursive regular expressions is also available in Ruby (with a different syntax) and in the regex extension of Python (but not in the built-in re module), but it's explicitly not available in RE2 . Let's suppose the input file in.txt contains lines like: a = EQ(x + 6, 42);…
This blog post gives various recommendations on how to copy files securely between computers running Linux or Unix. All the recommendations below copy the file in an encrypted way, protecting against eavesdropping and protecting partially against man-in-the-middle attacks (i.e. a thrid party tricking the receiver to accept forged file contents). If both computers run either of Chrome or Firefox,…
This blog post explains how to force the OpenSSH client to log in with a specific password or public key. This is useful if some of the SSH client config files ( /etc/ssh/ssh_config , /etc/ssh/ssh_known_hosts , /etc/ssh/ssh_known_hosts2 , ~/.ssh/config , ~/.ssh/known_hosts ) or the ssh-agent are in a broken state, and you want to try whether login works independently of these client-side issues.…
This blog post documents the quest I'm undertaking to find a fast enclosure for multiple SATA 3.5" hard drives, supporting both USB 3 and eSATA, and the ability to read from both hard drives at the same time with at least 275 MB/s total speed. So far I haven't found a fast enough enclosure, so the quest is till ongoing. I'll keep updating the blog post with speed benchmark results. The maximum…
This blog post explains how to update the BIOS to version 3.24 (released on 2012-12-16, latest release as of 2018-04-21) on a Lenovo T400 laptop. This instructions below don't seem to work, I get an Operating system not found error when booting from the pen drive. Unfortunately I don't know how to fix that. You will need a working and charged battery pack for the BIOS update, so install the…
Various terminal emulators on Linux (e.g. xterm, gnome-terminal, rxvt) have word selection: when you double-click a character, it selects the entire word containing the character. This blog post explains how to customize which characters are part of a word in xterm. The various defaults are for ASCII characters (in addition to digits and the letters a-z and A-Z): gnome-terminal: # % & + , - . / =…
This blog post explains how a user on a Unix server can be restricted to file transfers only over SSH. The restriction is implemented by specifying a login shell which imposes a whitelist of allowed commands (e.g. rsync , sftp-server , scp , mkdir ), and Unix permissions are used to restrict which files can be read and/or written by these commands. Implementation using a custom login shell First…
This blog post is a comparison of encrypted Git remote implementations. A Git remote is a combination of storage space on a remote server, remote server software and local software working together. An encrypted Git remote is a Git remote which makes sure that the storage space on the remote server contains the Git objects encrypted. It is useful if the Git repository contains sensitive…
This blog post is a tutorial explaining how to run Windows XP as a guest operating system using QEMU and KVM on a Linux host. It should take less then 16 minutes, including installation. Requirements: You need a recent Linux system (Ubuntu 14.04 LTS will work) with a GUI, 620 MB of free disk space and 550 MB of free memory. If you don't want to browse the web from Windows XP, then 300 MB of free…
This blog post explains how to avoid unnecessary copies when appending to a C++ std::vector , and recommends the fast_vector_append helper library , which eliminates most copies automatically. TL;DR If you are using C++11, and your element classes have an efficient move constructor defined, then just use push_back to append, it won't do any unnecessary copies. In addition to that, if you are…
This blog post explains how to make backups of your WhatsApp chats and photos safely on your Android device, and how to restore your backups. By safely we mean that you won't lose data unless you remove some backup files manually. WhatsApp saves all chats to the WhatsApp/Databases folder on the phone's storage (sdcard), and it saves all photos and other media files to the WhatsApp/Media folder.…
This blog post explains how to check whether a filename is safe for overwriting the file contents on a Unix system, and it also contains C code to do the checks. The use case is that an archive (e.g. ZIP) extractor is extracting an untrusted archive and creating and overwriting files. The archive may be created by someone malicious, trying to trick the extractor to overwrite sensitive system files…
This blog post explains how to fix Python SSL errors when downloading web pages using the https:// protocol in Python (e.g. by using the urllib , urllib2 , httplib or requests . This blog post has been written because many other online sources haven't given direct and useful advice on how to fix the errors below. How to fix SSL23_GET_SERVER_HELLO unknown protocol This error looks like (possibly…
This blog post explains how to compile Lepton , the recently released JPEG lossless recompressor by Dropbox without autotools on Linux. You'll need a fairly recent C++ compiler with the development libraries installed. g++-4.4 is too old, g++-4.8 is good enough. Compile with the following command (without the leading $ ): $ git clone https://github.com/dropbox/lepton $ cd lepton $ # Optional: git…
This blog post explains how to back up photos on Google Photos and Google Drive as is, keeping the original images files, bit-by-bit identical, without any scaling or reencoding. TL;DR If you want to keep the original image files, upload the photos to Google Drive, which keeps the original files (bit-by-bit identical as uploaded), and their size counts against your Google storage quota (see your…
This blog post explains how to install Hungarian spell checking and hyphenation for LibreOffice and OpenOffice on Linux. The instructions were tested on Ubuntu Trusty, but they should work well on other Linux distributions as well with small modifications. The installation consists of downloading the right files, copying them to the right location, and restarting the LibreOffice and/or OpenOffice.…
This blog post explains how to disable (reject) any root password on Debian and Ubuntu, thus rejecting login attempts as root. Becoming root with sudo (by typing the calling user's password) or ssh (using a public key) remains possible. TL;DR Run as root: passwd -d -l root How to become root if password-based root logins are (or will be) disabled? Before disabling password-based root logins, make…
Please disregard this post, it's a cryptographic proof checked by keybase.io/pts . ================================================================== https://keybase.io/pts -------------------------------------------------------------------- I hereby claim: * I am an admin of https://ptspts.blogspot.com * I am pts (https://keybase.io/pts) on keybase. * I have a public key with fingerprint 537D…
This blog post is to announce statically linked binaries for Linux i386 of MicroPython . MicroPython (Python for microcontrollers) is an open source reimplementation (see sources on GitHub ) of the Python 3.4 language for microcontrollers with very little RAM (as low as 60 kB). The CPython interpreter is not used at all, MicroPython has a completely separate implementation in C, supporting the…