Linux User Group of Mauritius Promoting open source software in our beautiful island

6Oct/170

How to reduce the amount of disk space used by the systemd journal

Posted by Avinash Meetoo

We, Linux people, generally use systemd now and one of its components is the journal controlled by the journalctl command line tool.

As explained on the Arch wiki,

systemd has its own logging system called the journal. The /var/log/journal/directory is a part of the systemd package and the journal will write to /var/log/journal/

The journal is always appended and therefore grows in size. On my laptop, the journal was taking 1.8Gb of space and was full of details which, I believe, I’ll never need. So I decided to clear all old contents (which the systemd people call a vacuum). I issued:

journalctl --disk-usage
journalctl --vacuum-size=64M
journalctl --disk-usage

And the journal immediately became smaller. I then issued a

journalctl --verify

which made ma realise that some of the remaining journal files were corrupted (for some reason). There is no journal repair tool in systemd so I simply removed the offending files (with rm).

Now, I can easily check my journal entries for today and I know everything will be all fine:

journalctl --since today

15Mar/170

Open and not extract .docx, .xlsx and .pptx files in the latest Gnome 3

Posted by Avinash Meetoo

In the latest version of Gnome 3, a subtle change was brought to Nautilus, the file manager, to automatically extract the content of a ZIP file in a new folder when it is double-clicked on instead of open an application to do so. The problem is that Microsoft Office files (.docx, .xlsx, .pptx, etc.) are ZIP files. This means that double-clicking on a .pptx file extracts its content instead of opening the file in, say, LibreOffice Impress!

This makes life miserable for all those who need to open Microsoft Office files on a regular basis and, of course, this is a bug (as acknowledged by the Gnome people  and the Red Hat / Fedora people).

Fortunately, it is quite easy to make Nautilus become sane again. Open Preferences and in the Behavior tab, unselect “Extract the files on open” in the Compressed Files section.

Phew!

15Jun/160

Automatically raise windows in Gnome

Posted by Avinash Meetoo

20160615-automatically-raise-windows

I love Gnome 3… except when I am using a terminal, decide to launch Chrome by clicking on its icon in the Dash and not realising that the terminal still have focus despite Chrome being shown on screen. Consequently, typing, say, www.noulakaz.net and pressing enter only sends these keystrokes to the terminal (despite Chrome being shown) with potentially serious consequences.

But lo and behold, I have just found a solution. Just launch the Gnome Tweak Tool as shown above and put “Automatically Raise Windows” to ON.

I have regained my sanity!

21Apr/160

World Creativity and Innovation Day

Posted by Avinash Meetoo

20160421-panelists

Every 21 April, we celebrate the World Creativity and Innovation Day in Mauritius.

This year, the Mauritius Research Council organised a workshop on Creativity and Innovation and the the ICT Advisory Council, which I preside, was given a slot of 30 minutes. I quickly prepared a few slides like I like them to be (beautiful, memorable and witty) and I asked Logan Velvindron and Ish Sookun, both members of the ICT Advisory Council, to join me in a panel on Creativity and Innovation among Youth.

20160421-albert-einstein

The first topic was about having fun when learning and creating. I mentioned that school and teachers can be boring, especially in our age of having Wikipedia and YouTube in our pockets. I said that it was time for our education system to become fun again, where young people can enjoy creating and learning a lot of new things in the process. Both Ish and Logan explained how fun they have everyday at work and how important this is for them.

20160421-steve-jobs

The second topic was about not to be afraid to be different. In Mauritius, we have a culture of conformism. Women have specific roles to play. Kids also. And, of course, everyone should remain at his place. This is bullshit! Our world is created by people who think differently and who are not afraid to take risks and disrupt existing establishments… Logan and Ish told the audience how they discovered computers, decided to become geeks and do things differently from others. They were very thankful to have supportive parents who didn’t try to impose anything on them.

20160421-linus-torvalds

The third topic was about being a geek and the value of open source software for a country like Mauritius. I explained that open source software is free and this is very important for Mauritius which is not a very rich country. But I also explained how having access to the source code of software is essential for Computer Science teachers like me to create the new generation of top programmers which Mauritius will need in the future. Young people cannot learn complex programming just by reading a book or listening to a teacher: they need to see real source code of real complex software. Logan and Ish explained how they got involved in open source software and how we all now form part of organisations such the Linux User Group of Mauritius and Hackers.mu and the value those organisations have.

20160421-sheryl-sandberg

The last topic was about being a doer rather than a talker and that aiming for perfection, while sometimes a good thing, can sometimes prevent us from achieving. This is something I have noticed over the years in Mauritius: we love our committees. Doers are not revered though. This mentality has to change. I told the audience that we are as good as anyone from anywhere, whether it is the USA or France or India. But we should stop focusing on doing speeches. We should identify small but important problems and find feasible solutions for them.

After the panel, I got a question from Anibal Martinez who is collaborating with the Government to set up an incubator. He asked me how we can solve the Computer Science education issue in Mauritius.

I told him that in the short term, a lot can be done with ad-hoc training courses, such as the ones that I provide at Knowledge Seven. But this is not a viable model for the country. In the medium to long term, state-funded universities should find a way to revamp their Computer Science departments, which are absolutely substandard at this moment, to produce an adequate number of very competent computer scientists every year. The industry is ready to move up a level but there are not enough competencies.

Thanks to Ish and Logan for participating in the panel.

20Nov/140

Creating an RPM file for XMind

Posted by Avinash Meetoo

20141120-xmind-on-rpm

I am a big fan of mind-mapping software and, for years, I’ve been using Freemind.

I’ve noticed that a lot of people are moving towards XMind which, for some peculiar reason, is only available as a Debian (.deb) package. This is a bit problematic as I run Fedora and CentOS which are both based on RPM (Redhat Package Manager). Here is how I managed to convert the .deb package into an .rpm which can then be easily installed with a yum localinstall:

(1) Download the Debian package

(2) alien -r –scripts package.deb

This command (alien) converts the Debian package into an RPM and makes sure that any scripts (pre- and post- installation) will run when the RPM file is installed. See this for more info.

(3) The issue is that the RPM will fail to install as there is a conflict with three directories: /, /usr/bin and /usr/lib. The solution is to install rpmrebuild and use it as follows:

rpmrebuild -pe xmind.rpm

Remove all lines for /, /usr/bin and /usr/lib in the %files section and you should then get an RPM. See this for more info.

Have fun with XMind ;-)
20Nov/140

Creating an RPM file for XMind

Posted by Avinash Meetoo

20141120-xmind-on-rpm

I am a big fan of mind-mapping software and, for years, I’ve been using Freemind.

I’ve noticed that a lot of people are moving towards XMind which, for some peculiar reason, is only available as a Debian (.deb) package. This is a bit problematic as I run Fedora and CentOS which are both based on RPM (Redhat Package Manager). Here is how I managed to convert the .deb package into an .rpm which can then be easily installed with a yum localinstall:

(1) Download the Debian package

(2) Create the RPM

alien -r --scripts package.deb

This command (alien) converts the Debian package into an RPM and makes sure that any scripts (pre- and post- installation) will run when the RPM file is installed. See this for more info.

(3) The issue is that the RPM will fail to install as there is a conflict with three directories: /, /usr/bin and /usr/lib. The solution is to install rpmrebuild and use it as follows:

rpmrebuild -pe xmind.rpm

Remove all lines for /, /usr/bin and /usr/lib in the %files section and you should then get an RPM. See this for more info.

Have fun with XMind ;-)
12Nov/140

Using jigdo to rebuild a Linux ISO image

Posted by Avinash Meetoo

20141111-little-by-little

A few years ago, Internet was very slow in Mauritius (and some will argue that this is still the case…) Downloading a Linux DVD (or, more precisely, an ISO image) took ages.

Now the Internet is way quicker but downloading a 4Gb ISO image still takes a long time.

A few years ago, a Debian guy invented Jigdo, a tool which I’ve been using for some time now to only download the few files I don’t have when a new Linux release is made and reconstruct the ISO locally. The steps to follow are documented in this post but are basically:

(1) Download the full ISO on a server where Internet is very quick (I do that on a VPS I have in the middle of the Silicon Valley where I routinely get 250Mbit/s). Let’s call the ISO image Centos-Linux-6.6.iso

(2) Use jigdo to create a .jigdo and a .template set of files. Before that it is important to mount the ISO on the distant server so that the individual files in the ISO can be accessed directly by jigdo. I generally do:

mkdir Centos-Linux-6.6

mount -t iso9660 -o loop Centos-Linux-6.6.iso Centos-Linux-6.6

jigdo-file mt -i Centos-Linux-6.6.iso -j Centos-Linux-6.6.jigdo -t Centos-Linux-6.6.template Centos-Linux-6.6/

(3) On completion, Centos-Linux-6.6.jigdo and Centos-Linux-6.6.template (which are generally small) need to be downloaded locally.

(4) The final step is to reconstruct the ISO locally. This is done by:

jigdo-lite Centos-Linux-6.6.jigdo

jigdo-lite will prompt for folder names with existing content. For example, when I used jigdo yesterday to reconstruct the latest Centos 6.6 ISO image, I already had a Centos 6.4 DVD and all the updates released since. I only had to point jigdo-lite to these existing folders and, voilà, in a few minutes I had the latest Centos 6.6 ISO image ready.

To be complete, jigdo-lite complained that one file was missing (python-paste-script-1.7.3-5.el6_3.noarch.rpm) which I had to download manually. It was just a small file so no big deal.

All in all, jigdo, even if the software is now in maintenance mode, is still a lifesaver for me. I hope it becomes one for you too.

Have fun ;-)

12Nov/140

Using jigdo to rebuild a Linux ISO image

Posted by Avinash Meetoo

20141111-little-by-little

A few years ago, Internet was very slow in Mauritius (and some will argue that this is still the case…) Downloading a Linux DVD (or, more precisely, an ISO image) took ages.

Now the Internet is way quicker but downloading a 4Gb ISO image still takes a long time.

A few years ago, a Debian guy invented Jigdo, a tool which I’ve been using for some time now to only download the few files I don’t have when a new Linux release is made and reconstruct the ISO locally. The steps to follow are documented in this post but are basically:

(1) Download the full ISO on a server where Internet is very quick (I do that on a VPS I have in the middle of the Silicon Valley where I routinely get 250Mbit/s). Let’s call the ISO image Centos-Linux-6.6.iso

(2) Use jigdo to create a .jigdo and a .template set of files. Before that it is important to mount the ISO on the distant server so that the individual files in the ISO can be accessed directly by jigdo. I generally do:

mkdir Centos-Linux-6.6

mount -t iso9660 -o loop Centos-Linux-6.6.iso Centos-Linux-6.6

jigdo-file mt -i Centos-Linux-6.6.iso -j Centos-Linux-6.6.jigdo -t Centos-Linux-6.6.template Centos-Linux-6.6/

(3) On completion, Centos-Linux-6.6.jigdo and Centos-Linux-6.6.template (which are generally small) need to be downloaded locally.

(4) The final step is to reconstruct the ISO locally. This is done by:

jigdo-lite Centos-Linux-6.6.jigdo

jigdo-lite will prompt for folder names with existing content. For example, when I used jigdo yesterday to reconstruct the latest Centos 6.6 ISO image, I already had a Centos 6.4 DVD and all the updates released since. I only had to point jigdo-lite to these existing folders and, voilà, in a few minutes I had the latest Centos 6.6 ISO image ready.

To be complete, jigdo-lite complained that one file was missing (python-paste-script-1.7.3-5.el6_3.noarch.rpm) which I had to download manually. It was just a small file so no big deal.

All in all, jigdo, even if the software is now in maintenance mode, is still a lifesaver for me. I hope it becomes one for you too.

Have fun ;-)

4Nov/140

Pygame with Fedora and Python 3

Posted by Avinash Meetoo

20141104-pygame

I’m having some fun with pygame, a library to create games in Python.

The exact steps to follow to have pygame in Python 3 on Fedora Linux are detailed in the Python Fun blog. In essence:

  • yum install python3 python3-tools python3-devel
  • yum install SDL SDL-devel portmidi portmidi-devel ffmpeg ffmpeg-devel
  • cd /usr/lib64 && ln -s libportmidi.so libporttime.so

This takes care of all dependencies needed (minus smpeg which does not exist in recent Fedora Linux distributions). Then:

  • Get the pygame source code (e.g. hg clone https://bitbucket.org/pygame/pygame)
  • python3 config.py
  • python3 setup.py build
  • python3 setup.py install

That’s it! Test by running python3 and importing pygame.

Have fun creating games ;-)

4Nov/140

Pygame with Fedora and Python 3

Posted by Avinash Meetoo

20141104-pygame

I’m having some fun with pygame, a library to create games in Python.

The exact steps to follow to have pygame in Python 3 on Fedora Linux are detailed in the Python Fun blog. In essence:

  • yum install python3 python3-tools python3-devel
  • yum install SDL SDL-devel portmidi portmidi-devel ffmpeg ffmpeg-devel SDL_image-devel SDL_mixer-devel SDL_ttf-devel libjpeg-turbo-devel
  • cd /usr/lib64 && ln -s libportmidi.so libporttime.so

This takes care of all dependencies needed (minus smpeg which does not exist in recent Fedora Linux distributions). Then:

  • Get the pygame source code (e.g. hg clone https://bitbucket.org/pygame/pygame)
  • python3 config.py
  • python3 setup.py build
  • python3 setup.py install

That’s it! Test by running python3 and importing pygame.

Have fun creating games ;-)