All items...           Popular tags: Linux (8), Hack (6), Debian (4), DIY (3), Other (3), Retrocomputing (3), Electronics (2), Database (1)


Programming PICs with Willem Programmer

2016-08-31 22:52:31,  In: DIY, Electronics

After replacing laser I needed a Modchip for my 20-year-old PS1 console. Following the "DIY" principle I downloaded an archive from Eurasia.nu with dumps of MultiMode 3 mod chip for PIC12F629. It contains even source code! I obtained a blank PIC chip and tried to program it in Willem programmer PCB v. 3. Of course Willem has no support for them. But it is still possible to write to the chip.
The first rule when programming PICs in Willem is to avoid Willem software. It is not well prepared for programming PICs. First of all, PICs have not only configuration bits (like AVR's Fusebits), but also factory-configured last 16-bit word called OSCCAL word. This word is used to calibrate internal RC oscillator and is set separately for each chip in factory, where RC characteristics are verified against real timing. So to program a PIC, you have to read it first, get OSCCAL value and program a new dump with old value good for the particular chip you have in programmer. It's really easy to erase OSCCAL with Willem...

... Read More


Using dead multimedia keys in Linux.

2016-08-20 20:46:22,  In: Linux, Keyboard, Hack

For years I was using a KeyMaestro keyboard connected to PS/2 port. This keyboard is a normal AT keyboard with a set of multimedia/Internet keys. When I switched to Linux, I decided to still stick with it as most multimedia keys were working OK.
But not all the keys. Let's try to make them all running.
First, you should know how the keyboard is used in Linux. The user presses a key, then the keyboard emits the code. Driver in Linux kernel emits the SCANCODE, and Linux program responsible for keyboard mapping maps it to KEYCODE. The keycode may be then used by the system (to be translated to letter as keysym, but we don't go up this level). This way many different keyboards for different platforms may be used by only altering the scancode-to-keycode translation method.
To make key do things we want, we must get its keycode. The most simple method is to use xev and, after seeing the window, pressing the keys. In the console, you will...

... Read More


Perl::Tk and "is not a hash" error

2016-08-09 19:23:13,  In: Linux, Perl, Debian

In Debian 8 (Jessie), after installing Perl::Tk, all scripts return the following error whenever Perl::Tk main loop is called:
2773678 is not a hash at /usr/local/lib/x86_64-linux-gnu/perl/5.20.2/Tk/MainWindow.pm line 53.
Line number may be different depending on Tk library version. Path usually will be different too (your architecture may differ), the most important thing here is this is not a hash error. The source of this problem is with using legacy form color parameter. In earlier X Window versions, colors responsible for window theming were stored as X Window system resources. This was never done completely in Linux, and the last desktop which done it in larger part was CDE from 1990s, and most Linux software just ignored parameters if there were any. However, some definitions survived until few years ago X have been updated. But Perl::Tk still needs some colour definition in order to generate a dialog window - it needs to know the background color.
To solve this problem, edit (or...

... Read More


Making a professional-looking stickers

2016-08-01 16:43:38,  In: Hack, DIY

Again I got an old computer with a sticker missing. This is quite frequent, especially in machines which were used in schools - everyone wanted to have a piece of computer and stickers were stolen in the beginning. If the sticker was molded using non-flat form, then there is a problem as they are not easily made at home (but still possible using e.g. silicone forms and polymer resins). But if the problem is a flat sticker, it can be made very simple way. You need:

1. 1:1 scale print-out of the sticker.
2. Transparent sticky tape
3. Two-sided sticky tape. Do not use foam tapes, use flat ones. You can find it in home improvement stores as tape for fixing carpets or doormats.
So first of all, print the sticker proper way. Use a good vector graphics program like Inkscape to make your sticker, as it allows to get the true scale of the image, lossless rescaling of vector graphics and its CMYK has black. If you put a black-background bitmap on black-background vector, you will get two black colors: From...

... Read More


Mountable, compressed full disk backup in Linux

2016-07-20 14:50:16,  In: Linux, Hack

The biggest problem with compressed full-disk backups in Linux is "all or nothing" philosophy. If you make an image by streaming dd's output to GZip, making a ".img.gz" file, you will end with file which needs decompression before any processing. Want to extract one file - decompress everything! And you need storage for it.
As a help, we can use SquashFS - a compressed file system used in embedded device systems. To start, let's boot the computer off you favourite distro not to run from disk under backup and mount the drive which will be backed up (in this example it's mounted in /mnt/custom).
Then let's fill the empty space up:
root@sysresccd /mnt/custom % dd if=/dev/zero of=/mnt/custom/rubbish.tmp bs=16384
According to your drive you can use smaller or larger block sizes (bs). When it finally ends, we will get a drive filled to the maximum. Remove the file we created:
root@sysresccd /mnt/custom % rm /mnt/custom/rubbish.tmp
This way, we've completely blanked a free...

... Read More


Hello world... again

2016-07-20 14:23:17,  In: Other, rants

Hello again, this time from another hosting. The free hosting which was used for the last 5 years decided to shut down a large part of their servers and stick head in the ground pretending nothing happened. In free hostings' land there is probably no other alternative except sites which try to sell paid hosting by terminating the free one.
In this page a small, usually practical pieces of text will be written. Too small or too modern to be published in Hacks section, but still useful and worth noting. Topics will cover sometimes old computers, Linux, Open source software or just opinions and information about things. As this "Publishing system" has been created in one night (based on my "lab notebook" code) don't expect comments or similar fully-featured things. Well, I care about users' privacy and I don't feel like hogging users' CPUs with tons of JS code nor constantly patching a state-of-the-art CMS made to be maintained by specially hired Open-Source code...

... Read More



Older posts...       Main page       Newer posts...