Register | Login

Published News

postpicture

As described in an earlier article called ODF is a timesaver!, you can easily create ODF documents without even having the huge OpenOffice installed on your machine. This can save a lot of time. I got very interested in this topic and did some research around how you can use Python scripts to generate ODF.

After a bit of googling I found a python module called ODFPY. This package allows you to do lots of fantastic things with ODF using Python which is my favourite language.

After installing the package I found a bunch of examples which was extremely useful because I got a starting point to hack my way forward.

After tinkering a bit with the examples I come up with this basic code:

#!/usr/bin/env python
# -*- coding: utf-8 -*-

from odf.opendocument import OpenDocumentText
from odf.style import PageLayout, MasterPage, Header, Footer, Style, TextProperties
from odf.text import P

textdoc = OpenDocumentText() # init main document
pl = PageLayout(name="pagelayout") # creating a basic page layout
textdoc.automaticstyles.addElement(pl) # adding the layout to the text document
mp = MasterPage(name="Standard", pagelayoutname=pl) # creating a masterpage
textdoc.masterstyles.addElement(mp) # applying the masterpage to text document
h = Header()             # let's create a header!
hp = P(text="My header")
f = Footer()             # let's create a footer
fp = P(text="My footer")
pageText=P(text="Hello world!", stylename=boldstyle) # some text for our page!
h.addElement(hp) # connecting elements
f.addElement(fp)
mp.addElement(h)
mp.addElement(f)
textdoc.text.addElement(pageText)
textdoc.save("mydocument.odt") # saving everything in a file

There's much more to discover. The API seems to be very detailed. So I've already found a thing to tinker with next weekend :)


postpicture

A big advantage of the Open Document Format is the possiblity to generate documents automatically. You don't even need to have OpenOffice installed. You don't have to be a skilled programmer to write a useful script for generating ODF documents: text, spreadsheets or presentations.

You can generate ODF from sources written in your favourite editor. To me a big advantage is that I can use my favourite editor EMACS to edit the and then generate an ODF document to send to my colleague. I can store my data in a SQL database, access it with my scripts and retrieve data needed for the document. Last but not least, I've never enjoyed learning how to write macros. Perl or Python are much more enjoyable.

Some things where ODF can be very useful:

  • generating reports on website usage
  • putting together spreadsheets from SQL databases
  • template driven documents like invoices
  • schedules, TODO's
An interesting experiment would be to try to combine this with e. g. org-mode for EMACS.

Read more...


postpicture

According to Google the web has lagged print and even other electronic media in typographic sophistication. To remedy the problem Google developed a unique font platform that is sure to add more visual diversity and richness to the web. The novelty was presented at this year's Google I/O conference.

The fonts can be used in all major browsers. The exception are mobile platforms like Android and iPhone, iPad and iPod. The API supports CSS3 and HTML5 styles (shadows, rotation etc). The unsupported browsers show text using the next available CSS font stack which means that implementing the API won't cause any big trouble on unsupported platforms. Although browser behaviour may vary while fonts are loading.

All this can even be done without embedding Google-linked code into your webpages. The files can be hosted on your own domain. But Google offers you the opportunity to unload your server and save some traffic. Embedding a font into a webpage means a size increase of 50-70 kilobytes. A JavaScript library called WebFont Loader can be used to obtain more control over font loading.

Read more...


postpicture

According to Nokia's statement, Intel and Nokia "promise and guarantee" that MeeGo is safe from any patent claims, because of the huge size of patent portfolios the two companies possess. Last but not least, the authority of the two companies itself can be regarded as a protective factor.

This gives MeeGo a big advantage over other mobile operating systems such as Palm OS and Google Android which do not yet offer any similar kind of protection. An alarming sign in this connection was e. g. the agreement between Microsoft and HTC which hinged around the VFAT filesystem used in HTC Android phones.

Moreover, Nokia states that MeeGo is of high priority to the company. A great advantage of MeeGo is the possibility to develop native Qt applications and HTML/JavaScript based software. MeeGo is also using several common Linux components such as X-Windows and GStreamer.

Read more...
postpicture

Today it's been exactly five years since I migrated to Linux. My first distro was Debian Woody which I used for about a month until Sarge was released in June 2005. That was not my first attempt to try Linux. I had tried it in 2003 installing Red Hat 6, a fairly outdated distro which left me disappointed. Debian Woody and Sarge

Migrating from Windows necessitated me to solve quite a few challenging problems. First of all, I needed dictionaries. I studied linguistics and a bunch of foreign languages at that time. My big need were dictionaries that had already come to Windows, but were absent for Linux. I simply could not do without them. I used my computer a lot to do the university assignments.

The problem got solved. I created some grabber scripts on Windows, dumped all dictionary data to text files and wrote some Python scripts to create dictionaries for the dict server. That sounds like a trivial task for any Linux user worth his salt. But I had to learn some Windows automation tools, Python, regular expressions. All this knowledge proved very useful to me later on.

One thing that holds many back from migrating to Linux is specific software that is non-existent under Linux. Wine and VirtualBox are great but sometimes they fail to meet your needs. I had one big addiction: Supermemo - a program which I intensively used for my studies. All my success I had to thank to that wonderful software that allowed me to cram foreign words in hundreds and thousands which contributed a great deal to the success during my third year at university after two failed attempts. I could not do without Supermemo. I even considered to resign all thoughts of migrating to Linux, because there was no Supermemo. To sort out this problem, I found first some awkward solution: running Supermemo in Windows 98 within VMWare. My brand-new machine with 640 Mb of memory allowed that luckily.

But I realized it was a waste of resources. Moreover, despite being a wonderful program, Supermemo had a horrible interface. I grew more and more used to Linux and command line. Eventually my patience was over. I decided to solve the problem radically. Some basic knowledge of Python made me believe in my skills. I also had learned some things about databases, MySQL and Postgres. After three weeks of hacking I had a minimalistic console program with extremely convenient interface. It had all functions of Supermemo I needed and proved to be very flexible: I became much more productive with my homespun software than I was with Supermemo. Today I am aware of some major design flaws of this little program. Nonetheless, I've been using it for over four years now and it never failed me.

I've never been a fan of Linux GUI. Not because I like the command-line interfaces so much, but because I dislike GUI in Linux. In most cases they are too clumsy for me or simply do not provide the desired functionality. This led me to using CLI more intensively. I finally even refused from much of the GUI windowing functionality by setting up GNU Screen.

There are still challenges I would like to cope with. I own a US-1641 USB 2.0 sound interface which is not yet supported in Linux. Who knows? Someday I probably start solving this problem as well.

So I've been a Linux user for five years. The most important practical thing I've learned is programming, simple casual programming that comes in handy everyday. I learned to rely on my own skills and do things myself. I am not exaggerating: Linux has been my big lesson of creativity and always will be.


postpicture

The /proc filesystem lets the user communicate with the system kernel and running processes. It is no real filesystem and is sometimes called pseudo-filesystem. It is only dynamically created in RAM. Most files in this filesystem are displayed having no length, i. e. being equal 0 bytes.

Most files of the /proc filesystem are read-only. Some can be written to, in order to change system parameters.

Amount of physical memory available: cat /proc/meminfo | grep MemFree

Which kernel modules are loaded? cat /proc/modules

Which parameters where passed to the kernel before it started? cat /proc/cmdline

Here's how you can write to /proc files to adjust your system settings. Change your hostname from command line using only one line of code: echo www.example.com > /proc/sys/kernel/hostname

Your kernel version including compile date: cat /proc/version

Find out which processor your machine has: cat /proc/cpuinfo | grep name

Which command was used to start a process? cat /proc/[process-number]/cmdline

How long has your machine been running? cat /proc/uptime

Show your machine's average system load: cat /proc/loadavg


postpicture

DNS is a simple UNIX/Linux lookup utility. It lets you interrogate DNS servers in an extremely flexible way.

The most basic syntax for dig is straightforward: just give the domain name you'd like to look up. dig google.com

Looking up the IP addresses of a domain: dig google.com

doing a reverse lookup - converting IP address to domain name: dig -x 199.239.136.200

More on dig man dig


postpicture

Ubuntu 10.04 interface has its minimize/close window buttons in the left part of the screen which causes inconvenience for some users who are used to the more traditional interface with the buttons in the right part of the screen.

There's a pretty simple solution to make your Ubuntu 10.04 look traditional. You have just to run gconf-editor and set up apps/metacity/general hierarchy to be equal menu:minimize,maximize,close.

Run this in your console: gconftool-2 --type string --set /apps/metacity/general/button\_layout "menu:minimize,maximize,close"


Sort News
Username:

Password:

Remember:
byteDay is a social network for people interested in free and open software news as well as open technology.