Friday, October 3, 2008

Kde3: emptying frequently used application list

In KDE3 Kicker, there is a nice option to have the topmost part of the K menu populated with the most frequently used applications.
As sometimes this list seemed to me to be messed or had some item I did not really like to have in it, I felt the urge to empy it. Although I found some other resource about this, I'm posting here a variation on the solution to this problem: first step, open with a text editor
~/.kde/share/config/kickerrc
and modify the line containing
RecentAppsStat=...
so that only "RecentAppsStat=" remains. Now, to have this modification applied, open a shell and
execute this command:
dcop kicker kicker restart
the kicker will be restarted, and you'll have your K menu with the frequent applications clear.
Beware: some systray application will behave strangely - skype for instance, sometimes loses the icon and some other icon will float - close or kill
these programs, and restart them.
In case you're lost, you can restart KDE anyway!

Wednesday, June 18, 2008

Announcement: new article on multi-touch

I began writing for the online weekly magazine Meltin'Pot on web. All articles will be in italian, if you are interested begin reading with this article on the new multi-touch technologies.
From now on, please find here the list of articles I wrote for this magazine.

Tuesday, June 17, 2008

OPNET install tips (UPDATED)

In today's post I'm going to insert some detail about OPNET tips in installation.
I think it's better to omit details about the actual installation procedure - OPNET's guide is complete in this part, and I think it's straightforward installing it. I'll refer as usual to version 11.5.A, using Linux OpenSuse 10.2.

So here's what I do after I have the software installed and the licenses set up.
First, I create a folder (e.g., op_prj1) in which I'll insert everything about a single project. I then create a batch file, opnet.sh, containing the line
modeler -opnet_user_home .
When executing this file (./opnet.sh using bash), I have opnet running in the op_prj1 directory. This allows me to separate files for different projects.

Then, after having executed ./opnet.sh, you'll have your instance of the OPNET modeler up and running. I then suggest adding the current directory (again, op_prj1) as the main model directory: go to the File menu, then Model Files, and finally Add model directory. The file selection dialog should open at the current directory. Click Choose, and then in the next dialog check Include all subdirectories and Make this the default directory, and then click ok.
From now on, your new models and sources will be created in this directory, so that you can easily make backups, avoid different projects having mixed files etc...

I also suggest changing something in the preferences (these will be saved locally, in your current directory). These can be accessed by the Edit menu, then Preferences. Search "beep" using the text area: I usually set beep_count_confirm and beep_count_error to 0, to get rid of those annoying beeps that warn you of some condition while simulating.
I also suggest modifying compiler flags in order to speed up your simulations a bit: there are many web sites discussing these things, refer to other sources in the web to optimize for your platform. You should modify comp_flags_common and comp_flags_optim. It's safe to add "-pipe" in comp_flags_common as this should only speed up the compilation a little bit, and to optimize for your specific architecture in comp_flags_optim (I added "-march=pentium4 -ftree-vectorizer-verbose=0 -ftree-vectorize" to optimize for my pentium4 cpu).

Furthermore, I modify the preference force_posix_locale to TRUE. This seems to fix some strange rendering problem I sometimes had when using the simulator.

The last thing to do, is set up temporary files cleanup. When working with the modeler, many log, temporary files and backups are generated and not automatically removed.
To have old files deleted, open the modeler, then click on the file menu, and "Delete Temporary Files...". In the dialog, you can setup your preferences, I suggest setting a lifetime of some day as I never had to recur to these files.

I hope this helps! I'll update this post if I find something else worth to be listed or if I receive some new suggestion.

Friday, March 28, 2008

How to browse ISO disk images with KDE

Today I'm writing about something interesting I found some day ago.
KDE is able to browse ISO images directly, without mounting them. So if you have a CDROM image suitable for recording, you can browse it with a click!
Anyway, this functionality depends on the iso:// URL format.
So if you have, for instance, a file named disk.iso in /tmp, you can browse it by typing iso:/tmp/disk.iso in the address bar of konqueror.
Anyway, you have to explicitly type this URL in the address bar. With a trick, instead, we will be able to browse images by simply clicking on their icon, just as what happens when compressed files.
To do this, there is a simple way. The simple way, download this file and copy it in ~/.kde/share/mimelink/applications.
Or, even better, copy the file /opt/kde3/share/mimelnk/application/x-iso.desktop
in ~/.kde/share/mimelink/applications.Then, open it with a text editor (vi, jEdit, your choice anyway) and add these few lines at the end of it:

[Property::X-KDE-LocalProtocol]
Type=QString
Value=iso

Now, reboot kde, and try opening a .iso file. Konqueror will transparently browse through it!

Wednesday, February 6, 2008

Cloning disk images with dd and cp, keeping them sparse

Today I'm writing a method (that I have not yet tested enough!) to make a copy of a partition using only the standard dd and cp commands (gnu version, I tested it on suse10.2 and xubuntu). It is recommended to copy unmounted partitions only, as a mounted partition could change when it is read!

1.$ mount /dev/sda1 /mnt/sda1 # mount the partition, e.g. in /mnt/sda1
2.$ cd /mnt/sda1
3.$ dd if=/dev/zero of=fill.txt # to fill the free disk space
4.$ rm fill.txt
5.$ umount /dev/sda1 # unmount the partition to be cloned
6.$ cd ~/disk_images # choose whichever directory you want
7.$ cp --copy-contents --sparse=always /dev/sda1 sda1.img
8.$ ls -lsh # will show you the real size of the cloned partition

Well I know it is not clear enough to whom doesn't know this topic, anyway you can find a lot of information and software on this topic, for instance this article on freshmeat.
The matter is, this method copies a partition efficiently, allocating space for the non zero sectors only, so it should be as efficient as most clone softwares, but relies only on standard linux commands.
Hope that helps, and if not, I hope I'll receive some comment!