Often I needed to convert a set of files (audio files to different format, text files to different encoding, …) in some directory structure and save results to a new destination while retaining directory structure. In order to walk through directory structure we can use find command, but if we are to create output in new place, subdirectories have to be created, which is where find command line gets bit complicated (especially if we have to consider spaces in files/directories names). So here is an example for converting text files encoding:
Some types of web applications require to start long running tasks – like import of file, compilation etc., but user still needs to have real time updates about progress of the task, eventually some error messages, warnings from the task (cannot import particular line, compilation error). There are existing robust solutions like Celery, but it is aways fun to reinvent the wheel 🙂 In this case we focus on simple solution, without need for request broker in middle, which enables immediate/ real time updates on running tasks to client browser.
I do like maps. Recently I was looking at some digital maps and got into more details and found several nice open source tools about which I’d like to write in this article. As in any area open source provides interesting alternatives to work with digital maps and geographical data and what is also very interesting there are now free sources of good quality geographical data, which can be used freely by everybody to create their own maps. In this article I’m explaining how use data from Open Street Maps (OSM) project for creating maps in QGIS and how to use PostGIS to store geographic informations and have fun playing around with their different features of map data and tools. This tutorial is focused on linux (debian based – ubuntu 12.04 resp. mint in my case) desktop and assumes some basic knowledge of your linux desktop administration. Continue reading Playing with maps (QGIS, PostGIS, OSM)→
Recently I’ve updated TheTool to support also AppIndicator3 interface so it can show icon in Unity panel. Although the documentation is not saying it, you can use absolute path to PNG image as icon-name ( apart of stock icon name). I was trying to add application specific stock icons, but is somehow did not work well (only possibility is to use xdg-icon-resource install --novendor --size 32 picture.png icon-name, but python code for creating application specific icons with Gtk.IconFactory was not working for me – see this post on stackoverflow). Continue reading AppIndicator3 – how to use custom icons→
While adding more capacity to my Ubuntu 12.04 based server I decided to use two disks in RAID 1 – although the whole topic is well discussed and described, it still took me some time to put all pieces together, so here I’d like to share my experiences. Plus there are couple of decision point on the way, so I’d like to explained my decisions, based on informations I read. Continue reading Software RAID 1 And LVM→
Recently I decided to revamp my linux HTPC and this time to do it properly – there is no disk and all media are on separate server (or NAS – I prefer server, because I’d like to run some other things there, which might be problematic to run on pure NAS box). New PC should boot from from common USB stick – 8GB – value around 5 EUR (I thought it would be more convenient to build system and I did not have any server yet to boot from network only – actually old HTPC would become server, but first new HTPC has to be created). To overcome two major issues of common USB stick – limit on number of write operations (too much writes decrease lifetime of the stick) and slow write operations speed I decided to use overlays file system (or sometimes called union file system), where (once all system is set up) all writes go to memory – this is similar to linux live CDs or USB sticks. In order to be able to do some user customizations after installation and that user can save various data his home directory, the home directory is hosted on server/NAS and shared via NFS. The recipe described below is for xubuntu 12.10. Continue reading Diskless PC (booting from USB stick) with Ubuntu→
Almost all APEX applications I’ve been working with recently are used across multiple timezones, where many timezones uses DST (Daylight Saving Time) – that is basically almost all Europe and North America. The natural requirement is that users can see date+time information in their timezone time, reflecting if DST is active or not. Timezones and time conversions are always bit of mess and APEX is not supporting this completely out of box, but with small effort we can make our applications really global. Continue reading Timezones and DST in Oracle APEX→
I’ve have been working with Javascript here and there – always small pieces – as I know Java, C, Python I though that I do not need to learn anything special about Javascript, that I should be able to manage right away – In fact I somehow did, but I’ve been always bit struggling with some strange behaviours. Having to write couple of Firefox add-ons recently I decided to read some book about Javascript to shed a light on those anomalies – I found this book very good – Javascript: The Good Parts by Douglas Crockford.
It relatively small book – I’ve read it in a few hours, but it gives you very good overview of all features of the language and show you how to write good and maintainable code in JS. Now I know that Javascript is very expressive language, where I can use some powerful features like functional programming, prototypes etc.
Normally Xen is deployed with plenty of of public IPs, so it can use bridged networking and each virtual machine can have it’s own public IP. However in my case I was limited by only 1 public IP, but I wanted to run several VMs with services accessible from outside. Solution was to modify XEN networking scripts.
Idea is to use an internal bridge with hidden IP subnet and to use NAT and port forwading so particular services on VMs can be reached from outside (on public IP, which is assigned to DOM0).This solution works for me successfully on Debian Squeeze. Continue reading Xen 4 – Combined Bridged And NAT Networking→
Mozilla has provided nice high level API in its Add-On SDK, where one can relatively easily write an extension, without need for any special knowledge about internals of Firefox – the general knowledge of Javascript, HTML and CSS plus very nice and detailed documentation of the SDK are basically enough.
However there are some functionalities, that are not available in SDK and then more effort is needed and XPCOM components have to be used via their JS interfaces. This requires bit more research, so I’d like to share one useful snippet of code – how to save string to file, which user has chosen via standard file picker dialogue: Continue reading Writing to file in Firefox Extension→