2010/08/23

How to write accented (capital) letters on MACOSX

It's usually not a problem for me to input accented letters directly with a 1-key press. But I'm used to capitalized accented letters correctly at the beginning of phrases, since in gnome or kde you must simply hit CAPS-LOCK and the accented letter key to get something capitalized (eg. È which is third person present for the verb to be in Italian). But MacOS does not change the capitalization this way.

So I had to watch out for alternatives: compositing keyboard. In Snow Leopard (at least) you can use ALT+8 or ALT+9 and the a vowel key to get respectively an acute or grave accent. Just before pressing the vowel key you'll get the accent alone underlined (as a prompt to press a letter key).

In addition, you can user ALT+O to generate german umlauts (eg. ü) or ALT+N to generate tilded characters (eg. ñ).

2010/08/11

Ext3 Under OSX

I recently got a replacement notebook, since my favourite MSI s271 presented quite a few disk errors on smart, and it's a while that this one has the usb nonfunctional.
After looking for a new notebook, in the 12"-13" range, I found with some disappointment that those niceties come at a premium price, and most of the time they are built on cheaper consumer-level standards.
So, after some research, I went for a refurbished MacBookPro, the newest model with a 13" screen.

Now the challenge is, reading all those external disks (or internal slices/partitions) which are unfortunately ext3 formatted.

I tried not to choose the straightforward path which leads to Paragon software, and instead go the MacFuse way. This post helps a lot and basically it's all you need: http://forum.archosfans.com/viewtopic.php?f=47&p=220020

The modification to the script is really needed only if you require r/w, which is basically not advised from the authors of fuse-ext3, my tests say they are quite ok.

Now I need a way to bypass the default users and permissions that macosx uses to be able to write/read the data both under linux and under osx without touching sudo or becoming root.

2010/07/22

Mutt and Imap

Yesterday I was having problems using the corporate webmail (yes, the one with three letters in the acronym), and lacked the chance to use a full-featured mail user agent.

So i remembered the old days :) when I used mutt and fetchmail to read my personal mail... and recalled mutt supported IMAP too. I started googling to find a tutorial and read a couple of nice pages (see below). In a pinch I was able to read imaps mailboxes in the console.

2010/07/15

Linux with no primary partitions left

I got a new company PC, an Acer Aspire 5372ZG, nothing to say about it, just yet another consumer notebook with a 15.6" 16/9 gloss display, very big and quite heavy, nice keyboard if you don't mind having the home and end key on the keypad only.

The problem is, the 320GB HD is partitioned into three partitions, two of them are hidden. All are primary partitions. No primary partition left to install linux. So I did my homework and discovered that unlike the lilo of old, Grub is able to boot quite nicely from any filesystem it is compiled to support.

2009/10/12

Ext2 under Windows

I finally had the definitive data loss on my (historical) FAT32 partition that I used to share between Linux, Windows and the odd other OS (sometimes FreeBSD, sometimes OpenSolaris). So I was looking for a way to share those data without the hassle of a yesterday filesystem. I was rather disappointed with the status of NTFS under linux, both native and under FUSE, not to speak about my mascotte ZFS.
Finally, I found this Ext2 driver with finely works under Windows, reaching near NTFS native speed, so I adopted it on the pc I switch OSes more, currently the Asus EEEPC 1101HA (yes, I finally got one).
The driver is nice, if you don't mind using your favourite ext3 filesystem in compatibility mode, which only means under Windows there's no journal, and you must bear the casual fsck when windows hangs, and the fact that you can't access your filesystem under windows if it has a dirty status on linux (the journal needs to be replayed). Of course you can simply make this filesystem a simple ext2 and get on with it.
By the way, you find everything here: http://www.fs-driver.org/

Note: remember to create the ext2/ext3 filesystem with the option -I 128, which means an inode size of 128, most moder distribution set this value to 256 which is not compatible with these tools.

Update: It works under Windows 7 too with some quirks. The first is that the installation requires Windows Vista compatibility mode (not an issue for me). The second is that the drive letter utility seems not to stick with the configuration done upon reboot. I'll investigate this further.

2009/07/02

Firefox 3.5

As usual, I upgrade the pc I use at work before anything else: I use it for more time and I usually have to fix issues quickly. It's a Mandriva 2001 Spring, of course, and firefox has been installed in /opt using the tarball from the Mozilla Foundation.

Apart of the usual addons that get disabled, everything seems fine. It seems pretty responsive too, in spite of the low specs of the machine (Intel P4 2GHz, 768 MB of Ram, slow ide disk). A couple of crashes hit the usability, but thery a mostly related with plugins, maybe they should be updated too.

I don't use many of the new features, so I don't comment on them.

2009/06/25

Resume sftp transfers

Of course there should be some way to resume transfers done via sftp.

Technically the way presented here is not sftp compliant (uses curl or, better, rsync --inplace).

But it's a way to start.

Note that I don't know if sftp subsystem supports resuming natively...

2009/06/23

Heartbeat and two-nodes clusters

Heartbeat (from http://www.linux-ha.org/heartbeat/) is a nice software to manage linux high availability clusters. When you are in need to use a two-nodes cluster you want to prevent a situation known as "split-brain": when a node does not communicate with the other but neither two know which is the failing node.

This can lead to having the cluster drop all the services or having both nodes with the services on (in case of shared storage, this will lead to corruption unless the filesystem is clustered and supports multiple writes from multiple nodes). To make a long story short, split-brain is bad.

To counter this effect, you can use a ping host. Ping hosts are fake cluster members used by heartbeat to use the network connectivity as a mean to break ties in cluster node weight computations: if a node pings a ping host and the other doesn't, the hosts which pings is the winner. To make this configuration successful, you need an additional link between the nodes. This additional link could be serial or another ethernet.

To use ping hosts, this is the bare minimum configuration:

ping 10.10.10.10 # insert the ip of the ping host.
respawn hacluster /usr/lib64/heartbeat/ipfail # use /usr/lib on 32 bit hosts
apiauth ipfail gid=haclient uid=hacluster # this is for process security


But which ping host to chose? Use a reliable ping host; this can be the default gateway (if it's a router which has a very high uptime) or a local layer 3 switch. Don't use a server o a workstation!

Use hearbeat reload to configure the ping host without stopping the cluster and lose resources.

2009/06/12

Linux first support for usb 3.0

The interesting news is that Linux could be the first mainstream OS to support Usb 3.0. Really, the support is already there if you mind building your own kernel.

The good news is that finally some female hacker comes to the surface. I felt rather fed of seeing Linus or Andrew Norton faces on articles (not minding Richard Stallman's). :)

2009/06/05

Flashblock in Opera

I tried successfully the following operations to activate Flashblock in Opera (it worked with Opera 9.64 on Linux):

1. Download this file http://lexi.ucoz.ru/userjs/FlashBlock.js and put it in a directory of your choice
2. Go to Tools|Preferences|Advanced|Content|Javascript Options|User Javascript Files|Choose and choose the directory where you downloaded the javascript file.
3. Try it ;)

Note to Italian Opera users: you must use Strumenti|Preferenze (CTRL+F12)|Avanzate|Contenuti|Impostazioni per Javascript|Cartella dei file Javascript dell'utente|

2009/05/29

Comparison of Enterprise Unix OS

Here's a nice feature-to-feature comparison and quick start of major Enterprise OS. IBM Aix, HPUX and Sun Solaris are covered.

It's worth noting that only Sun Solaris is currently fully supported in x86 environment and AIX lacks any type of support for architectures different from POWER.

The article comes from IBM so maybe is a bit biased.

2009/05/20

Get a list of most populated tables in mysql

If you are a sysadmin and do not have a fellow mysql dba, you should learn some tricks to look for big tables or tables used very much.

This query (and modified versions of it) accomplishes the task:

mysql> SELECT table_name, table_schema, engine, table_rows, data_length FROM information_schema.tables where table_schema not in ('information_schema', 'mysql') order by table_rows desc limit 20;

This searches for every table which is not part of 'information_schema' and 'mysql' (that is every user database).

The result is similar to this one (names and schemas removed to protect the innocents ;))


+-----------------------+--------------+--------+------------+-------------+
| table_name | table_schema | engine | table_rows | data_length |
+-----------------------+--------------+--------+------------+-------------+
| | | MyISAM | 2828398 | 162470312 |
| | | MyISAM | 1609232 | 131429376 |
| | | MyISAM | 1195717 | 218651496 |
| | | InnoDB | 574491 | 43581440 |
| | | MyISAM | 565128 | 10737432 |
| | | MyISAM | 480290 | 26981100 |
| | | MyISAM | 380521 | 22509908 |
| | | MyISAM | 280128 | 8536752 |
| | | MyISAM | 227324 | 18714388 |
| | | MyISAM | 210842 | 17857596 |
| | | InnoDB | 201526 | 45694976 |
| | | MyISAM | 177225 | 10055608 |
| | | InnoDB | 123960 | 5783552 |
| | | MyISAM | 119143 | 9524852 |
| | | MyISAM | 99960 | 10038104 |
| | | MyISAM | 97712 | 8010128 |
| | | InnoDB | 94167 | 8404992 |
| | | MyISAM | 93962 | 16401252 |
| | | MyISAM | 91817 | 1836340 |
| | | InnoDB | 84424 | 4734976 |
+-----------------------+--------------+--------+------------+-------------+
20 rows in set (0.18 sec)

2009/05/19

Multipath and partitions on linux

If you have a multipath device, you can partition it. This can have many purposes, typically to use some space differently if you have a cluster and only a LUN to use as quorum disk and for data.

Sometimes, you partition the multipath device with fdisk, but the device is "in use" by the kernel and partition devices (mpathXp1, mpathXp2 and so on) don't get created.

Simply use kpartx to create those devices in "userspace":

root# kpartx -a /dev/mpath/mpath0

If you are not sure, leave the -a to preview the results.

Unison on Windows

Since we are moving from one place to another (still in Rome), i needed to sinchronyze files between my current linux workstation and the notebook I was given. For me, the obvious tool is unison, and I went looking for instructions to make it work on windows, as on the notebook it's installed a windows-only VPN software.

The process turned to be fairly complex, as usual due to dll/path hell which is the doom of windows machines when dealing with a no-installer software.

1. Getting Unison and prerequisites.
The unison Homepage points here: , where I downloaded the gtk-enabled windows executable.
Unison needs the gtk library, the page suggests using those provided by Pidgin. I already had Pidgin installed, so I did nothing.


2. Putting Unison where it would find gtk dll
The page also advise to append the gtk library directory to the %PATH% variable. I opted instead to move the Unison-2.27.57 Gtk+.exe executable in the GTK directory ("C:\Programmi\File comuni\GTK\2.0\bin" in my system). This is more straightforward and easier to do and lets me have more than one GTK installation if need arises. Note that you cannot register the dll to be automatically found (I don't know why, but a dialog tells me so when I use regsvr32 on libgtk-win32-2.0-0.dll.


3. Getting ssh.exe plink wrapper

From this page [http://www.wischik.com/lu/programmer/unison-ssh.html] I downloaded the plink wrapper (I googled for unison windows ssh and it was the first hit). I put in the same folder that the unison executable. It has a bug and it does not work with a plain password (I planned to use a private key anyway)


4. Generating private key to use with plink

It's easy, use puttygen (you should have it if you installed putty with the standard windows installer, otherwise grab it here). Note that the Putty links points to the most current version of Putty, but it may change, so peek at the download page for updates.
As usual, generate a new key (I prefer to generate a fresh key for automated task, it's easier to revoke if it gets compromised as it does not have usually a passphrase) and publish the public key on the linux box which will act as a "unison server" in the authorized_keys file (usually ~/.ssh/authorized_keys, change the permissions to rw------- before doing anything else if you create a new file)


5. Configuring the key in the unison profile

Using the ssh plink wrapper, you need to modify the unison profile file. Create a new profile, select the local directory to configure, select the remote directory (using ssh), insert the host and the user that you granted access by publishing the public key.
Then locate the profile file (in C:\Documents and Settings\\.unison on my windows system) and add these lines:

sshcmd=ssh.exe
sshargs=-i path\to\privatekey_file_on_windows.ppk
ignorecase=true

you can add also perms=0 since most of the times the permissions will be totally screwed from a unix fs to ntfs (god forbids using FAT32 nowadays!)
Note: the path you specify with the sshargs option must not contain spaces.


6. Run and test

Now run Unison and verify that it detects differences in the files and that it makes good suggestions on which file is newer on which system.

Troubleshooting
The only thing you can do wrong is the public key stuff, check with cmd, cd to the directory where you have copied ssh.exe and try ssh manually:

C:\somedir> ssh -l username -i path\to\privatekey_file_on_windows.ppk hostname

and see if you can login.
Otherwise you screwed something up; check the authorized_keys name, permissions and position on the filesystem (and if it contains the right public key).

2009/05/04

Updated Mandriva 2009 to spring

The update did complete successfully, but only after manual intervention.

The update process looped on trying to install mplayer (mandriva version) while it conflicted with mplayer plf version. I had to remove the mplayer plf rpm manually from the console before the script went on.

When the notebook rebooted for the new kernel, X did not start; but mandriva offered a text mode dialog to reconfigure (and test) it.

I still have to see a linux distro upgrade flawlessly; but this time mandriva quite did it, if I did not tinker with plf, everything should go on in an acceptable way.

So the vote on the update process is 7/10.

2009/05/03

Upgrading Mandriva 2009 to spring

Tonight I started the automatic (i.e. graphical) upgrade of my notebook to mandriva 2009.1 (a.k.a 2009 Spring)...

More info to follow after upgrade.