Playing with maps (QGIS, PostGIS, OSM)

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)

AppIndicator3 – how to use custom icons

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

Software RAID 1 And LVM

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

Diskless PC (booting from USB stick) with Ubuntu

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

Timezones and DST in Oracle APEX

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

Good Book About Javascript

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.

Xen 4 – Combined Bridged And NAT Networking

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

Writing to file in Firefox Extension

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

Quick And Dirty Oracle Backup

I have an Oracle 11g installation running in virtual machine (under Xen). Oracle is used for APEX development and some host few local applications for our team. From time to time I need to do cold backups – to keep data around or to move them to another VM on different server, which is running identical version of oracle  and can be used as cold backup eventually.   The backup device is an USB disk with FAT32 filesystem (FAT32 was chosen a while ago for compatibility reason – to be able to attach it to almost any OS) and the disk is attached to other server. FAT32 means that there is a limit on file size, so the database backup need to be split to chunks (backup is 10-15 GB). Of course RMAN can do proper job, but since I’m no real DBA I want to have something quick ( data are not mission critical and also it is no problem to bring DB down) – so warning do not apply this procedure for important databases – no guarantee that it will work in all circumstances and you may loose your data . Continue reading Quick And Dirty Oracle Backup

GSettings – Flexible Configuration System

GSetttings is the standard way how Gnome 3 applications store their configuration. GSettings is the front-end interface for application, actual values are stored by back-end – standard one is called dconf. We can then use the tool dconf-editor to easily browse all stored configurations for all applications. Thanks to GObject introspection we can also work easily with GSettings from python. Continue reading GSettings – Flexible Configuration System

My Digital Bits And Pieces