abandoned bytes
[X] <- nail here for new monitor

Brave New World

January 16, 2010

People still went on talking about truth and beauty as though they were the sovereign goods. Right up to the time of the Nine Years' War. That made them change their tune all right. What's the point of truth or beauty or knowledge when the anthrax bombs are popping all around you? That was when science first began to be controlled - after the Nine Years' War. People were ready to have even their appetites controlled then. Anything for a quiet life. We've gone on controlling ever since. It hasn't been very good for truth, of course. But it's been very good for happiness.

— Aldous Huxley - Brave New World

0 comments. View/write comments  

OpenOffice mouse with 18 buttons and a joystick

November 09, 2009
OpenOffice-mouse with 18 buttons
OpenOffice-usability, engineered into a mouse

This mouse really demonstrates the usability of OpenOffice.

 

 

0 comments. View/write comments  

Do we need a new Internet, a new society or a new government?

October 07, 2009

This is my English homework for tomorrow: a comment on a New York Times article.

According to specialists' opinions, the Internet designed decades ago is not up to today's requirements and needs a major redesign, states the New York Times article "Do we need a new Internet?". The loss of digital freedom, however, is only mentioned marginally, and how experts want to design something today for the challenges of tomorrow remains unclear.

The Conficker worm is mentioned as an example of how catastrophic Internet security really is. While it is true that there are many security threats "out there", the example also shows that the widespread use of the Windows operating system without all security updates installed remains the main problem. Also, there are cases where Microsoft doesn't provide such updates on time. These are mainly problems of a software monopoly, though, not the Internet itself.

Furthermore, the lack of centralised control is criticised. It is interesting how so-called "experts" on the subject overlook that the decentralised nature of the Internet is its essence, the basic idea behind it. This is where the huge and widespread acceptance comes from: the fact that no-one can control or restrict who you are communicating with. Security-related problems like authentication or data security have successfully been solved by mathematicians and IT specialists, and people all over the world are using the technology to prevent computers eavesdropping on the route between source and destination. Of course, the decentrality is a thorn in the entertainment industry's side: they are helplessly trying to enforce their copying restrictions on digital media, while another fundamental idea of the Internet, the task that almost every network device is running, is the duplication of data.

Tracking global criminality is another issue raised by the text. Governments seem to be unable to track criminals on the Internet, thus they cry out for new regulations, leading to laws like the EU directive on data retention or the German "child porn" filter. It is needless to say that neither saving communication data nor making the public look away from child abuse will help fight crimes. Crimes can be fought by experts of the executive in the real world, and that is rather effective without the need for tracing everyone on the Internet. These laws are just good for establishing surveillance that will slowly become reminiscent of Orwell's 1984. Luckily though, politicians are not technicians, and as they are unable to find effective ways of pursuing criminals in cyberspace, they are also unable to create effective censorship on the Internet.

A recent law suit against "The Pirate Bay" (a large filesharing search engine), where plaintiffs demanded taking the search engine off the Net, showed that computers treat a disconnection on purpose just like a connection error and find another available path. Out of this reason, some people might now argue that this is a proof of the Internet's ability to support crime. On the one hand, governments and the industry should think about such dramatic changes in people's behaviour and respect, not prohibit their intention to share content. On the other hand, the executive needs specialists who are able to pursue crime without putting the whole population under general suspicion or the need for secret censorship.

As long as military computers are vulnerable to attacks from the Internet and government computers are hacked, we can be sure of the fact that governmental organisations need more and better security experts. As long as most people are submitting private data on a public website like Facebook, it is sure that people still need more time to adapt to the newly established informational society. Redesigning the Internet without knowing where the journey has to go, while the "old" Internet is still too new for most people, seems like a bad idea to me.

0 comments. View/write comments  

Windows 7 Sins

September 18, 2009

... Microsoft have deliberately crippled Windows 7, leaving netbook users at the mercy of Microsoft to control which applications they can use, as well as the number of applications that can be run simultaneously...

... This is not new, however. In 1996, a furor erupted over Microsoft Windows NT. At the time, Microsoft was selling two versions of its operating system: Windows NT Workstation and Windows NT Server...

... both the NT Workstation code and the license agreement restricted users to no more than ten concurrent TCP/IP (i.e., Internet) connections; while NT Server remained unlimited...

We call such limitations, antifeatures. An antifeature is functionality that a technology developer will charge users to not include — it is more difficult for Microsoft to limit Internet connections than it is to leave them unconstrained — and the limit is not something that any user would request.

Windows 7 Sins

0 comments. View/write comments  

The Pirate Bay offline for 3 hours

August 25, 2009

The good people at the MAFIAA decided to sue. Not TPB, not the owners of TPB. Not even TPBs ISP. They decided to sue TPBs ISPs ISP.

And you know what? They won. They made a court believe their #lies and they made them force the ISPs ISP to shut down access to TPB.

TPB can be compared to the organisation that builds the roads for cars to drive on. The ISP can be compared to the organisation that creates the asphalt for the roads. The ISPs ISP can be compared to the organisation that creates the tools needed to the asphalt to be created. You would normally not sue that organisation if a car speeds.

The Pirate Bay

0 comments. View/write comments  

Back from IOI 2009 (Plovdiv, Bulgaria)

August 16, 2009

Well, I haven't won a medal at the IOI 2009, but I've gathered a lot of experience - and had a lot of fun! The event was thoroughly organised - including, for example, the presence of the President of the Republic of Bulgaria, Mr. Parvanov, at the opening ceremony, and police escort to the Black Sea ;-)

Maybe I will have more luck next year in Canada. Congratulations to Henadzi Karatkevich from Belarus, who has won the competition while only being 14 years old!

0 comments. View/write comments  

PHP + AJAX Chat

June 25, 2009

I've written a minimalistic, proof-of-concept AJAX chat in PHP. If anyone is interested in a basis for further development, see this.

The only funny part in coding this was finding out that PHP sessions are mutually exclusive (and such, if a client is AJAX-waiting for a PHP script which is delaying on purpose, the session can't be accessed from another script. You need to close the session in the delaying PHP script).

Download: ajaxchat01.zip

0 comments. View/write comments  

Image downscaling algorithm

June 19, 2009

Lately, my father needed some image scaling code for an application (yep, he is a software engineer). You would suppose that there are many libraries for scaling images, as there are a whole bunch of algorithms like bilinear, bicubic etc. Lots of googling, however, leads to another impression: There are quite a few libraries, but with enormous dependencies themselves, one even requiring the whole GTK+ library!

The project my father is working on is being written in Borland C++ Builder (yuck!). The Borland C++ toolkit itself doesn't support anything other than scaling with the nearest neighbor algorithm, which looks very ugly (pixely). Tired of googling, I wrote a small image scaling code which doesn't depend on anything else (than a standard C++ compiler). I've made my own considerations on how to scale down an image, but the nearest thing to it is the bilinear interpolation algorithm (I really don't like the mathematical approach on Wikipedia by the way. I'm a more a programmer than a mathematician!)

The downscaling is done, self-explainingly, by the scale() function. The code is an optimized version including macros, which unfortunately is not very readable. I suggest you just use it ;-) You could also bug me to make a nicer version.

readpng() and the PNG library are only needed to provide some sample image input, which you should replace by some other form of getting pixels. (Yes, yes, I've promised it is without dependencies. I just needed a sample image source, and BMP was out of question, because it just sucks to write a program supporting all the different formats of bitmaps available).

At the moment, the code only supports downscaling. It seems that a few % upscaling is no problem though.

Download: scaledown.zip

Last modified: August 30, 20090 comments. View/write comments  

Backup with dump

May 15, 2009

dump is a rather aged, but still very useful Unix tool for backuping ext2 and ext3 filesystems. I use it for complete backup of my home partition, which is useful to restore it completely after a disk crash, stolen laptop etc.

For those who don't want to read the whole manpage to grasp how to basically call dump, a short explanation:

dump -3u -h 0 -f - /home | gzip > /path/to/backup/directory/backupfile.dump.gz

The first number, 3 here, is the dump level used for incremental backup - you need to increase it every time if you only want to do incremental backups (which I do daily); the appended -u means "update the list of backups". The -h 0 option tells dump to "honor the nodump flag", meaning that files marked with the attribute "nodump" will not be backuped at dump levels at or above 0 (hence, they are never backuped - I use this flag for videos, pretty pictures and other files I don't need essentially). See later for the dump flag.

The -f - tells dump where to store the backup file, which in this case is the standard output (-). The final parameter is the file system (device or mount point) which will be backuped.

I let dump output to the standard output, which I pipe into gzip to get the backup file a bit smaller. I use an NFS mount point for the target backup file, which means the file is stored on my server. You could, of course, give a filename after -f, and omit the piping to gzip.

nodump flag

This is an ext2/3 filesystem attribute, which is used by dump (when you tell it to) to determine whether a file or directory needs to be backuped at all. I use this to flag files and folders that are not essentially needed, but are rather large, like videos or picture folders. The attribute is set with:

chattr +d <file or directory>

You can also clear the attribute with the same command using -d. You can also view ext2/3 attributes with:

lsattr

The syntax of the lsattr command is quite similar to the syntax of the well-known ls command.

Shell script

You should do a full backup every so often, otherwise you will need ALL backup files to restore completely. You will also need to do a full backup before being able to backup incrementally. You can do a full backup with -0u (use the full argument to the script).

Below I present a small shell script I use for daily incremental backup. The basic idea is to count the backup number automatically, and to create backup files with the backup date appended to a prefix. Use the script at your own regard:

#!/bin/bash # LAST_BACKUP="/etc/last_backup" BACKUP_PATH="/mnt/public/David/_bak/laptop" BACKUP_MOUNTPOINT="/home" sudo smbmount //LINUX/PUBLIC /mnt/public sudo umount "$BACKUP_MOUNTPOINT" if [ "$1" = "full" ]; then if sudo dump -0 -u -h 0 -f - /home | gzip > "$BACKUP_PATH/home-full-`date +%Y-%m-%d`.dump.gz"; then echo 0 | sudo tee "$LAST_BACKUP" > /dev/null exit 0 fi exit 1 fi lb=`cat "$LAST_BACKUP"` nb=`expr $lb + 1` if sudo dump -$nb -u -h 0 -f - /home | gzip > "$BACKUP_PATH/home-`date +%Y-%m-%d`.dump.gz"; then echo $nb | sudo tee "$LAST_BACKUP" > /dev/null fi sudo mount "$BACKUP_MOUNTPOINT"
Last modified: September 07, 20091 comments. View/write comments  

sftp annoyance - or how to log in to an sftp server with password from a script

May 10, 2009

The default sftp program Linux (at least Ubuntu) uses is written with security in mind, instead of the user's wishes. Stating that "writing your password into a script is insecure" (which it obviously is, I fully agree!), they restrict the password input to the terminal, and somehow the smart-ass programmers managed to find the terminal even when all standard I/O (stdin, stdout, stderr) are passed through pipes.

Obviously, this is a pain in the ass if you want to upload stuff to Sourceforge automatically, as the only solution for automated logins is to use ssh key files. Uploading ssh keys to Sourceforge, however, is not possible, thus, I strived for another program providing better functionality.

Being an ex-Windows-user, PuTTY promptly came to mind. psftp provides nice functionality: it is able to read the password as a parameter and even hides it in the process list output (I guess it must have forked to achieve that). Now, the familiar unix style known from automating ftp sessions can be used to script it:

psftp user@host.com -pw password <<EOF
cd /some/folder
put some.file
exit
EOF

0 comments. View/write comments  

Ubuntu dist upgrade

April 28, 2009

As you may have noticed, support for Ubuntu 7.10 Gutsy has run out. I had this distro installed on my server and was wondering why I couldn't install any new packages (404 errors everywhere). So I was forced to make a dist-upgrade:

do-release-upgrade

... updated nicely to 8.04 Hardy in about 45 minutes (on a 1 GHz machine...). There were absolutely no problems, only some config file conflicts which are nicely diffed and you can choose to do something about them. Yay! (I had already prepared the backups)

0 comments. View/write comments  

Native GCC on the Openmoko FreeRunner

April 13, 2009

Credit: this short howto is based on a mail from Shawn Rutledge to org.openmoko.lists.device-owners.

The whole pile of development stuff won't fit in the flash of the FreeRunner, so you need to create a partition on a microSD card and mount it to /usr.

Let me know if I have missed something.

0 comments. View/write comments  

Dismantling and repairing a Ford radio 4000 RDS or the smashed rotary button

March 29, 2009
Ford Radio key

Ford Radio - repaired front pcb

Question: What can you do if, in an accident, someone smashed the volume "button" of a Ford radio, and the volume doesn't work anymore?

Answer:

0 comments. View/write comments  

Yaomp - Yet Another Openmoko Music Player

February 06, 2009
Yaomp player

I'm sick of pythm, so I've written myself a decent, finger-friendly audio player for my Freerunner. Yaomp is based on Qt and GStreamer and will be available for download as soon as more features are implemented and the code is cleaned up.

Edit: Seems like the development of this program has died! This is a pity, because it had some cool ideas (weighted-random playlist, turning off the screen when playing, and pausing/resuming playback on a call. I should work these features into Intone at the very least.

Last modified: August 30, 20090 comments. View/write comments  

Layer 8 error at Google

February 02, 2009

For a good hour, Google was marking every result website, including their own, as "potentially harmful". For details, see e.g. Slashdot.

0 comments. View/write comments  

Binary clock

November 14, 2008
binary clock
Binary clock showing 22:19:59

After having bought quite a few blue LEDs for a reason I don't know any more, and inspired by the blue PCB I got (I actually ordered a green one...), I decided to build a binary clock (like the ones from ThinkGeek). As usually, I've used an Atmel controller, an ATmega8 for that. It is a TQFP version because that is smaller and surface-mounted. The rest of the parts could have been SMD too, but I only had them in through-hole versions. Nevertheless I tried to arrange them in a way that looks nice.

The display is actually in BCD (binary coded decimal) format because that is easier to read.

A timer interrupt counts the time, while another does the multiplexing (one of the four rows is selected by the driver transistors on the right side of the PCB). I can provide the assembly source files if you want them - just drop me a note via mail (see Impressum). The EAGLE files for the PCB have disappeared into digital nirvana while moving from Windows to Linux.

Last modified: October 20, 20090 comments. View/write comments  

© 2009 by David Madl. Impressum | Home (English) | Home (Deutsch) | Processing time: 0.585 s

abandoned bytes (en)
User:
Pass: