Sunday, November 24, 2013

Minimal Xubuntu 13.10 Desktop installation

[Image]

I have performed a clean install of the newest Xubuntu distribution and I like the result. They have reacted to the bug reports I posted and fixed dependencies to the bloatware and spying packages that were not possible to avoid during Xubuntu 13.04 installation. I have also spent some time trying to figure out the minimum set of packages for the network-manager to work. Here's the installation procedure:

Thursday, September 12, 2013

Multimonitor support in Xubuntu 13.04

One new feature planned for the Xubuntu 13.10 release is the multi-monitor support integrated into XFCE desktop. Previously one would have to use xrandr to adjust monitors settings and now it should also be possible with the updated Display Settings dialog. But it is also possible to use this feature in Xubuntu 13.04

Tuesday, September 3, 2013

Javascript vs Perl vs Python vs Lua speed comparison

I have previously compared performance of the three most popular interpreted languages - Perl, Python and Lua (part1, part2). The next question was - how do they compare to the Javascript? Unlike the above mentioned languages it was quite unusual to use Javascript outside of a browser sandbox but with developing of the node.js this became possible.

Saturday, August 10, 2013

Redirecting terminal output into any X application

Sometimes I want to redirect bash output directly into an X application for further editing. Normally this is done using a temporary file where the bash output is saved and then it is opened by an application. There's a way though to start an X application and paste the bash output into its window automatically.

Tuesday, July 23, 2013

Python vs Perl vs Lua - speed comparison. Part 2

As far as people show interest in this topic I decided to perform an additional measurement to the one I performed in Part 1.

This time I wanted to compare floating point numbers operations performance because my good friend Anonymous worried about it. He said that I shouldn't have abused lua interpreter with basic arithmetic operations on integers because it's not good at it. He said that I should have tried floating points numbers instead to let lua interpreter shine. I was a bit skeptic about it to be honest but Anonymous's logic was sound.

Monday, July 22, 2013

OpenGL Core Profile and an overlay with the QPainter

[Image]
I've played recently with the OpenGL Core Profile and QGLWidget to see if I can render a scene with only core profile functions and shaders. Everything worked well until I decided to add an FPS counter using overlaid text drawn with the QPainter.

Thursday, July 4, 2013

Improving pm-utils power management scripts for pci devices

By default pm-utils changes power control parameters only for a subset of device classes. The classes id's are hardcoded into the /usr/lib/pm-utils/power.d/pci_devices script. Unfortunately it is not possible for a user to define his own set of classes to be treated by the script.

Tuesday, May 14, 2013

Python vs Perl vs Lua - speed comparison

I have written the base64 encoding algorithm in Perl, Python and Lua to compare the performance in basic arithmetic and file-io operations. Perl implementation was written a long time ago and it supposed to be a one liner. That's why the script looks so obfuscated:

Saturday, May 11, 2013

Using ssmtp to send email notifications

I've been using ssmtp for a long time to send automatic notifications from all my embedded systems like routers or NASes and also to send anything from a command line to a desired email address. The program is only 8K (whereas mutt is 3.5M) but it can handle secure TLS/SSL connections to SMTP servers. Setup is very easy as only one file has to be adapted. Please read this tutorial to set the ssmtp up.

To make it easier to use I have written a bash script that handles email header creation and adds a simple command line interface:

Monday, May 6, 2013

Minimal Xubuntu Desktop installation

 [Image]

Edit: I strongly recommend to continue with the Xubuntu 13.10 installation because many steps described here are obsolete.

I spent a day building a minimum Xubuntu installation to avoid bloat-ware installed by default. I was installing Xubuntu on a small 16GB SSD that was used previously as an ExpressCache drive on Windows 7 and that's why I wanted to install minimum set of software for the Desktop to work.
As the basis for the system I've chosen Ubuntu 13.04 mini.iso. My first attempt was to install Debian Sid branch but software there is already outdated! And installing new software from experimental branch is not possible as apt-get would completely destroy installed Sid system.

Monday, April 15, 2013

Vacuum cleaning of $HOME to back it up


I've started with a simple script to compress Firefox's sqlite databases before creating a backup of my $HOME directory

alex@xubuntu:~$ cat bin/vacuumFirefox.sh
#!/bin/bash

[ -n "$(pidof firefox)" ] && {
  echo "ERROR: firefox is still running, close it first!"
  exit 1
}

counterBefore=0
counterAfter=0

for i in ~/.mozilla/firefox/*/*.sqlite; do
  fileSizeBefore=$(du -b $i|awk '{ print $1 }')
  counterBefore=$((counterBefore + fileSizeBefore))
  sqlite3 "$i" vacuum
  fileSizeAfter=$(du -b $i|awk '{ print $1 }')
  counterAfter=$((counterAfter + fileSizeAfter))
  echo "$fileSizeBefore $fileSizeAfter - $(basename $i)"
done
echo "Bytes saved: $(( counterBefore - counterAfter ))"

Here is a sample output:

Thursday, March 28, 2013

Ubuntu with the NetworkManager as a NAT gateway


Sometimes I use my Xubuntu notebook as a NAT gateway for my Windows 7 computer because its WLAN interface works in 5GHz band and Windows computer works only in 2.4GHz. So I connect my Win7 computer to my Xubuntu notebook using a crossover Ethernet cable and turn it ito a NAT gateway using a bash script.

Saturday, January 5, 2013

USB to Serial TTL cable

[Image]

I was looking for a cheap USB to Serial TTL cable that would have a 3,5mm audio plug on its end. Such a cable can easily be found on Amazon for 23,27€ which is just a road robbery. Having an old audio plug the same cable can be constructed for only 6€ and here is the algorithm: