Sat, 14 Apr 2012
My New Bike
Several months ago, I have written about choosing a new bicycle. Here is the outcome:
Introducing my new AZUB Apus. I have rented and extensively tested several recumbents from AZUB (20" Eco with above-seat steering, 24" Max with under-seat steering, and 26/20" Apus with above-seat steering), and I have decided to go for Apus with under-seat steering.
The next thing to decide was gearing. After testing 24" Max with 48-38-26 chainrings and 11-34 sprocket (about 570% ratio) I've got the feeling that I could occasionally use even slower gear (and with 26" rear wheel of Apus the 26/34 gear would be a bit faster than on a 24" wheel), and I can definitely use more faster gears. Recumbents are fast, especially going downhill, because of lower aerodynamic drag. So I wanted gearing with ratio larger than 570% and with the slowest gear slower than 26/34. This is hard to achieve with current components, so I went for triple gearing: I have got SRAM DualDrive in-hub planetary gearbox (three speed gearbox and 8-speed derailleur), combined with tree chainrings, giving me 3x3x8=72 gear combinations and over 920% ratio. One of the biggest advantages is that the gearbox gears can be changed even without pedaling, for example after having to stop unexpectedly.
After five months with Apus, I am still excited with it. I really enjoy being faster on flat surface and on downhills, being able to pedal even while turning, having excellent view with zero neck, wrists and backbone pain, being able to brake without the danger of falling ahead, sitting lower in case of fall, and so on.
The drawbacks are worse view when entering street crossings, being slower uphill, and not being able to jump over obstacles higher than about 10 cm). And the front suspension of the SASO carbon fork is not as good as I expected. I plan to try softer coil spring.
If I had to choose again, I would buy the same bike, possibly with not-so-steep sprocket (11-28 instead of 11-32). Also, having used really narrow tyres on my previous (road) bike, I did not pay much attention to the brakes - I have got V-brakes on my Apus, and I am not able to make the front wheel slip even when braking really hard (on asphalt roads). So probably next time I would get disc brakes instead (at least on the front wheel). Anyway, watch this guy's commute riding Apus on forest paths:
Fri, 18 Nov 2011
Google Authenticator
For some time, I have been considering adding two-factor authentication to my systems in order to prevent break-ins in case somebody's workstation is compromised (which is a common attack vector these days). One of the systems for one-time passwords is Google Authenticator.
G-A has an application for many smart-phone platforms (Android, iOS, Blackberry), and has a PAM module, which is even packaged in Fedora. It stores users' secrets in a file in the home directory, and uses 6-digit time-based passwords and 8-digit emergency scratch passwords. The configuration in Fedora is pretty straightforward:
yum -y install google-authenticator- In
/etc/pam.d/system-authandpassword-auth, changepam_unix.sofromsufficienttorequired, and after that line, add the line which reads "auth sufficient pam_google_authenticator.so". - Install the G-A application to your smartphone.
- Generate a new key using the
google-authenticatorcommand. - Add the key to your smartphone, either directly or using a QR code.
- Profit!
There are several problems with SSH-daemon, though:
- With SElinux enabled, it does not work.
- When public key authentication is allowed in
sshd_config, it also does not work (use "PubkeyAuthentication no" in/etc/ssh/sshd_configand restartsshdif you want to test it).
Especially the second problem is pretty serious, as I wanted to allow also public key + one-time password authentication there.
So, my dear lazyweb, what kind of two-factor authentication do you use?
Mon, 03 Oct 2011
Dear Customer,
[...] we would also like to inform you about the following change
in your network: a new address has been assigned to you:
2001:4cc8:...::/64.
Netbox apparently supports IPv6 now. Yay!
Mon, 18 Jul 2011
Which Bike?
The 30 years old frame of my bike broke several weeks ago, so I will need a new bike. We have already decided to buy a new bike for my wife, so I have took the frame of her present bike, and remounted some components of my former bike to it. So I don't need a new bike right now, and I have more time to decide what I want.
My previous bicycle was road bike with drop handlebars. I ride on paved roads mostly (altough many roads in Brno resemble off-road riding :-), and we occasionally do touring as well. I am considering the following options:
- Using the frame of my wife's bike until it breaks :-)
- Buying a cyclo-cross bicycle, which is essentially a road bicycle with hardened frame and different tires.
- Buying a touring bicycle, something like Author Avion, which even has a carbon frame.
- Something really different. Last week I rented a recumbent bicycle, AZUB ECO. It was really interesting, very comfortable, yet a bit difficult to drive. I would like to try a bigger one with under-seat steering, like AZUB 5 as well. The only problem with recumbents is that it is not possible to use them with trail gator tow bar.
So, my dear lazyweb, do you have anything to recommend?
Wed, 15 Jun 2011
High-Performance HTTP Servers
Yesterday I have read about Apache Traffic Server. My dear lazyweb, do you use something like that (or Nginx)? What is your main reason for using it? I wonder why use user-space solution, when IPVS works pretty well for load balancing.
Fri, 03 Jun 2011
Citroën Xsara
It has been seven years since I have bought my Citroën Xsara. At that time, I have considered several models, looking for an estate car for my family. Having used several Škoda Felicia cars in my previous job, I have definitely wanted a car from some other manufacturer. My opinion was "the car can have its problems, but at least let it be different problems than Škoda have".
That said, I have never considered Citroën, and in fact I did not know much about Citroëns. When I have been offered a 4.5 years old imported Xsara, however, I have found it "good enough" for me to buy.
Subsequently, I have been pleased to find out how comfortable my Xsara was, and how well equipped compared to the cars of similar age and class it was. It provides enough leg room in back seats (especially when compared to Octavia), and the 82 kW engine provided enough power for most of my needs. During almost 100,000 km in seven years I had only few malfuncions, the most serious one was a broken exhaust pipe because of corrosion.
Even though I did not originally considered buying Citroën at all, the next car which I have bought and which I use these days is also Citroën. So, my dear lazyweb, is anybody in your social network interested in buying a cheap, well-equipped, used car? If so, look here.
Tue, 24 May 2011
Mysterious Source Code
About a month ago, I have spotted a two-page listing of source code in our printer room/kitchenette. I have glanced over it briefly, and during subsequent visits to the room, I became more and more fascinated by it. Finally, about a week ago, I have grabbed it for myself, because nobody seemed to care about it anymore. So here it is, in all its glory:
Click the thumbnails for full-size images. Sorry for not providing a plain text version, and sorry for the Czech language in the comments. I have two reasons for which I find it really fascinating:
- There are two pages of source code, which does literally nothing. It only wraps an existing class with a new one with marginally different API (two exceptions joined into one exception, and retrying in case of failure). Nobody sane would write these two pages by hand, so I expect the code has been at least partially generated by some IDE. Obviously nobody can expect the code to be read by a human (actually, not read, but carefully examined for traces of some non-trivial application logic, should there be any). So I wonder what the present meaning of "the source code" phrase is, when it is no longer written nor readable by humans.
- The only real "application logic" is the
for-cycle near the end of the second page. And even this has been totally destroyed by the "every block should have only one exit point" mantra of the programming theoreticians. Adding a simplereturnstatement when the message sending finally succeeds would save them the following:- a boolean variable
- a complicated condition in the
for-cycle - an
ifstatement when the maximum number of tries is reached
I can only hope this is some kind of a silly example and not a real assignment given to the students of the Programming in Java course. I think the students have to be taught that mid-layers are root of all evil, and not some highly theoretical (read: impractical) rules like "goto is evil" or "a single exit point only".
Mon, 23 May 2011
Lost GUI features
Contemporary GUI applications have several problems which, if I remember correctly, previous systems did not have. I wonder whether somebody else also considers it being a problem:
- Creating a new file
- Almost every TUI text editor (like
vim) happily accepts a non-existent file
as a command-line argument, and the straightforward interpretation is
"user wants to start working with a new file". On the other hand,
most GUI applications simply complain that the file does not exist,
and some‒like OO.org‒exit after that
message. Other GUI apps,
like Gnumeric, present
a warning, but then open a new work with the default file name
(
Book1.gnumericin the case of Gnumeric) instead. - Working directory
- The file open/save dialog of contemporary GUI apps does not offer
by default the working directory from which the application has been started,
and uses some silly default (such as
~/Documentsin case of OpenOffice.org). Even gThumb needs to be explicitly told that the user wants to browse the current directory with the "gthumb ." command line. - Iconified applications
- Once upon a time, in a stone age of GUI computing, there was a twm window manager. When the application window was not needed on the screen, twm could be used to iconify the application. All applications, and all instances of them, could be iconified and then restored back the same way. Then Windows 95 happened, and it started to minimize the applications to the bottom panel instead of iconifying them to any place in the desktop. It also reused the desktop icons as application shortcuts instead of representing the minimized running applications. Unfortunately, the panel was too small for so many running minimized applications. Users stopped expecting to be able to restore the application after minimizing it. The applications which required to be minimized and restored back frequently (music players etc), developed their own means of minimizing, the notification icon area. So we have the iconification back, only not usable from all applications, and with each application implementing it in its own crappy way.
So what other important features of the "desktop of the past" do you consider missing from the present GUI systems?
Update - Mon, 23 May 2011: Iconified Apps
I have just discovered that XFCE4 in Fedora 15 allows the desktop icons to be switched between the Application launchers/shortcuts and Minimzed applications modes. Yay!
Fri, 20 May 2011
GNOME 3
After installing Fedora 15 in a virtual machine, I have decided to give GNOME 3 a try. Firstly, it is really slow over VNC. While GNOME 2 has been pretty usable for testing various new applications in a virtual machine, under GNOME 3 it is almost impossible. Here is a screenshot on which I will demonstrate my problems with GNOME 3:
Firstly about the file manager. I use mostly command line for managing
my files, but using a file manager is sometimes handy nevertheless. One
of the features I often use is the "Places" list. In GNOME 3, it is presented
differently in the Places menu and in the file manager itself, which
is a clear usability bug. When I wanted to add another directory there
(I often use ~/tmp as my sandbox),
it took me at least 10 minutes to discover
that "Bookmarks" is what I probably want. And even then, the newly added
bookmark is added to a submenu instead of the main Places menu.
Also, I did not found any way how to remove those useless predefined
directories like Videos, Music, etc.
from the left sidebar. Even when I have deleted them from my home directory,
they still remain in the sidebar.
Another ugliness is that the new window manager does not decorate the windows properly, and instead relies on the applications themselves to provide things like resizing handle in the lower right corner (see the gnome-terminal window). Not only it looks ugly as hell, it also obscures the space the application expects to be visible. I will probably file this as a bug report when F15 is officially released, but I expect in a truly GNOME-ish fasion it to be solved by removing the "scrollbar on the left side" option :-/.
Anyway, it seems that XFCE+Sawfish combo works as expected, so I am definitely leaving GNOME when I install F15 on my workstations.
Tue, 03 May 2011
Rethinking Cron
cron(8) is one of the oldest tools in UNIX. Despite of that,
I think cron is not something to be proud of. In my opinion, it
falls to the unfixable designs
category.
The recent attempts to fix it (factoring out atd(8),
a dirty hack that is anacron(8), etc.) show some of the problems
of cron. My recent experience confirms it:
This is the load average graph from our server, which runs periodical jobs of
IS MU. Around 2 pm, I have rewritten the
main crontab joining several similar tasks to one line, and adding several
seconds delay between their startup. The groups of tasks are now started by a
simple Perl script which handles redirecting STDOUT and STDERR, and handling
the return code. The Perl script is started using exec in the
crontab line, saving one more process.
This way, I have managed to get the number of jobs which are
simultaneously started in the peak minutes of an hour from 155 to 13.
The system does exactly the same amount of work as before, but most of the
work is evenly distributed across the whole timeframe, not started in parallel
the first second of a minute.
This is one of the big weaknesses of cron. I think the future
cron will need to support the following use cases:
- Starting jobs approximately in a given period, but not exactly at the beginning of a minute.
- Starting jobs the given period after the previous instance has finished (and maybe warn if the previous instance keeps running for too long time).
- Run the job weekly, near the beginning of the weekend (not at some random
time as
anacronand/etc/cron.weeklydoes). See Fedora bug #671076. - Start a job several times in parallel (depending on number of CPUs or something like that), and restart them after some of them finishes.
What periodical and semi-periodical tasks scheduler do you use? Will
systemd
be the answer to these problems?
Fri, 01 Apr 2011
git-diff(1) Dark Color Scheme
The default colored output of git-diff(1)
and other commands is a bit ugly in my terminal with dark (green-on-black)
color scheme. Here is how to fix it:
git config --global color.branch.current 'yellow bold' git config --global color.branch.remote 'cyan bold' git config --global color.diff.new 'yellow bold' git config --global color.diff.old 'red bold' git config --global color.diff.meta 'cyan bold' git config --global color.diff.frag 'white bold' git config --global color.diff.commit 'white bold' git config --global color.status.added 'yellow bold' git config --global color.status.changed 'cyan bold' git config --global color.status.untracked 'red bold'
Hope this helps - I had to read the source code to find out where the color of the commit ID in git-log(1) is set. The above can at least serve as an example (after all, I don't expect you to have the same taste for colours), and for my future reference.
Fri, 25 Mar 2011
man(1) Surprise
Hello, this is your editor speaking, welcome to the "lesser known Linux feature
of the day" series. Today we will cover an interesting feature
of man(1) that your editor has just ran into. Try running
the following command:
$ man git log
The manual page of git-log(1) is displayed on my Fedora 14 system.
How does man know that git
provides a "log" sub-command in addition to the equivalent
git-log standalone command?
The man page says:
By default, man will try to interpret pairs of manual page names given on the command line as equivalent to a single manual page name containing a hyphen. This supports the common pattern of programs that implement a number of subcommands, allowing them to provide manual pages for each that can be accessed using similar syntax as would be used to invoke the subcommands themselves.
And it even goes into an example using - guess what - git. That's all for today, see you next time!
Wed, 23 Mar 2011
XFCE
The first alternative to GNOME I have decided to try is XFCE. In the LWN discussion, Jon Masters presented it as a viable replacement to GNOME. Also, it uses GTK+ like GNOME, so many applications can be the same (including, I have hoped, my window manager of choice, Sawfish. XFCE is definitely usable and configurable for power-user. Most (but not all) properties can also be set using their Settings manager, and thus XFCE should also be mostly usable for ordinary users. So far the problems include:
- The keyboard configuration allows the user to set multiple layouts (for
example English and Czech/qwerty), but I did not find how to set layout
options, for example the layout switching hot-key. Adding a
setxkbmapcommand to the startup script is trivial, though (#5487). - The touchpad settings such as edge scrolling are not remembered
and cannot be set in the Settings manager. The solution is another startup
script, running
synclientwith the appropriate parameters (#5300). - The window manager cannot be chosen in a GUI. I had to remove the
default
xfwm4from the session and add Sawfish there instead (that said, I have nothing special against the default WM, I am just more used to Sawfish right now). - The Terminal application does not have
Ctrl +andCtrl -hotkeys for increasing/decreasing the font size (I sometimes use it, for example when more than one person is looking at the window). When the font size is set in the terminal menu, the physical window size remains the same, which means the number of rows and columns changes. Not good. I have solved this by choosinggnome-terminalin Preferred applications (#5605). - Moving applets inside a panel is not intuitive, and I have not found out yet how to reorder the launchers on a panel (#7142).
- Changing the orientation of a panel to vertical requires several non-trivial configuration steps. However, I have managed to configure the date/time applet (the only text applet on my panel) to fit a 48 pixels wide vertical panel, and I will probably keep the vertical panel orientation, as for most apps, the screen is more crowded in the horizontal direction (#7434).
XFCE is tightly related to both GTK+ and GNOME, and can incorporate various parts of GNOME (some notification area applets, keyring manager, etc). So I guess I would be able to use it as a replacement, if not for the whole GNOME, then at least for the central parts like GNOME Shell.
Tue, 22 Mar 2011
GNOME in the Shell
Yesterday, after reading The Grumpy Editor's GNOME 3 experience article at LWN, I have decided it is time to at least make an attempt to move away from GNOME, which (much like KDE 4) decided to use revolutionary instead of evolutionary development, and apparently continues in their feature removal crusade in the name of so called usability. Also, this might be a good chance to move away from Galeon after so many years.
I wonder what makes the GNOME developers think the existing users would
welcome a completely new desktop with very limited means of customization.
GNOME 2 has only recently reached a moderate level of usability (except
gdm, which is still not usable for many purposes since the
last rewrite).
It would be very sad to move away from GNOME, because I think I am not a typical conservative user, and I welcome occasional new features, provided they do not hurt productivity and power-user usability. However, apparently GNOME Shell provides neither, and the so called fallback mode is not complete enough (virtual desktops in a single row, seriously?). Also I would rather use the same desktop envionment as some non-computer-savvy users to which I occasionally provide technical support.
So I have decided to experiment a bit on my laptop, but keep GNOME and Galeon both on my home and work workstations for now. More on it in a few days.
Note: I am sorry, the above mentioned LWN article is subscribers-only for now. It will become freely available in several days. Alternatively, you can ask me for a link in a private e-mail.
Wed, 09 Mar 2011
New Odysseus
We have got a new hardware for our FTP server to replace our seven years old server. It is amazing how the old hardware is still in many aspects on par with state-of-the-art "average workstations". The old system had 12 GB of RAM, 8 TB of disks, and dual GbE. It was one of the first 64-bit x86 systems here at Faculty of Informatics. So, which principal improvements in server hardware the last seven years brought (apart from speed, of course)?
- Hardware virtualization is a standard now. This has allowed me to put www.linux.cz and www.cstug.cz to separate virtual servers, in order to tighten the security of the main server even more.
- Hot-plug disk slots are more-or-less standard now.
- Redundant power supplies. According to my experience, UPS-related downtimes are relatively frequent (be it scheduled in advance or not), and having one power supply in a circuit without UPS backing can help.
- Server management. Almost all server boards now have IPMI BMC on-board. The Tyan S2882 mainboard from seven years back had IPMI as a relatively expensive option, so we have decided to spend money on disks instead.
- Parallelization everywhere. The old Odysseus was one of the first x86 multi-CPU systems here. The new one has 16 cores, but only 33 % higher clock rate. The Neterion 10GbE card in the new server has 16 hardware queues, so it can keep all sixteen cores of the server busy (well, not exactly, because there are 8 RX and 8 TX queues, and our server does mostly TX, but it still helps).
Anyway, both the original and new configurations are described on the Odysseus statistics page (in Czech). Let me thank CZLUG and CSTUG for sponsoring some of the disks for the new server. We will see whether the new hardware can also keep running for at least seven years.


