How To “Sell” Ubuntu To Friends…

The title might be a bit misleading but the quotation marks are intentional. Windows 8 and the learning curve for its new user interface that is not everyone's taste offers an interesting opportunity to introduce some Linux goodness to those asking for advice when buying a new computer. Arguments such as Linux/Ubuntu being open source and users not being taken hostage by one software company or another are nice but usually do not stick with normal users. Fortunately I have accumulated a number of other arguments that I thought I'd recap in this post.

Boots fast: One of the main complaints I often hear is that despite Windows reacting strangely people are reluctant to reboot until it is really really necessary as shutting down Windows and rebooting it takes several minutes that seem to stretch into eternity while starring at the "welcome" message. Ubuntu on the other hand shuts down and reboots significantly faster. Not that it is often needed anyway.

Suspends fast: One of the things I find rather strange is that Windows 7 sometimes takes several minutes after closing the lid before it finally suspends to RAM and sometimes fails to do so at all. This is especially nerve rattling when you want to catch that plane or train or want to leave a place and you have to resort to putting the notebook in your backpack while the hard drive is still spinning and without knowing if it might just not suspend at all and dangerously heat. Ubuntu on the other hand suspends in a number of seconds. No guesswork.

No Viruses: Perhaps the biggest advantage is the absence of viruses. Not that the platform is invulnerable it's just that nobody cares. A strong argument for those having become infected before with all what it entails to get rid of the Trojan or virus afterward.

Network Manager: Windows 7 has done a lot to make Wi-Fi configuration quick and easy. But as soon as 3G USB sticks come into play third party management tools are required and mess up the process. Also, I have noticed over the years that Windows 7 seems to have a problem when switching between several Wi-Fi networks. At some point the driver hangs up and even disabling / enabling the hardware driver doesn't help. Only a reboot fixes things. Compare this to Linux/Ubuntu where everything is integrated into the network manager and things are straight forward with Wi-Fi, 3G and VPN connectivity all managed from a single drop-down list.

Skype stability: I use Skype a lot and over the years they haven't been able to develop a Windows version that doesn't crash after a while when frequently changing networks and VPNs, which is the case when you are mobile and want to be secure. What's even worse is that Skype hangs in such a peculiar fashion that it can't even be killed via the task manager. Only a reboot can fix the situation. On Linux/Ubuntu it crashes very very seldom and if it does it can be killed and restarted without a reboot.

Word/Open/LibreOffice: A number of years ago, this was a sore point as most people insisted on using Microsoft Office. But things have changed with Mac's having become more popular, people using OpenOffice/Libre Office a lot more and Microsoft Office versions now using several file formats. Document exchange has become a mess anyway due to formatting often being altered due to file format conversions and editing or correcting text by several people with different word processors. So resistance to move away from Microsoft Office is much lower than before. And one can of course take Microsoft Office to Linux / Ubuntu and use the license of the old PC there, either via Wine or in a virtual machine.

External devices just work without minutes of driver installs: Another irritating thing is that when Windows 7 is confronted with a new USB flash memory stick or hard drive it usually spends a long time installing drivers. What for? In Linux/Ubuntu the device is plugged in and a few seconds later the file manager pops up.

Updates do not reboot the computer: A frequent complaint I hear from Windows 7 users is that programs and the operating system constantly update themselves and require restarts. Ever had a monthly Windows security update that didn't require a reboot? Have you ever gotten stuck with an old Flash player because it has it's own update routine that is only invoked on reboot? Gone are the problems with Linux/Ubuntu that uses a central update facility for all programs including the web browser, flash and other programs constantly being updated. And unless a new kernel gets installed, no reboot is required. And even if, it doesn't nag you about it every hour.

Let's see if these reasons are enough to convince the uninitiated. I will keep you posted.

The Long Wiki Odyssey: From Woas to MoinMoin

Over the years I've been using a cool Wiki called Wiki on a Stick (WoAS) that was based on a self modifying XHTML / Java Script web page to store my notes that do not end up on this blog. The advantage of using a Wiki over other forms of notes taking for me is the search functionality and fast accessibility. All was well until Mozilla decided at some point with Firefox 16 or 17 that they no longer support self modifying pages. So one day after innocently upgrading Firefox, WoAS suddenly stopped working. There we go, the pleasures of updating. But I've accumulated a lot of useful notes in the Wiki so I had to find a solution. This is how the following Odyssey began:

There seems to be a workaround by using Java functionality to store changes to the WoAS file. This was out of the question for me as Java is so riddled with security issues that I decided long ago to uninstall it. Also I thought about using an old Firefox version in a virtual machine for the Wiki but decided that this is not practicable in the long run to always have a VM running for just this application. For some time I hoped a fix would be found or the functionality would be put back in Firefox, perhaps disabled by default. But to the best of my knowledge this didn't happen even to this day and I needed another solution quickly anyway.

The first solution I used was to convert the WoAS Wiki into HTML pages and from there to a Word Document. This worked rather well but left me with a 350 page word document. For some time this worked to some degree. However, only being able to search linearly compared to page searches in a Wiki with a results page for multiple hits became too limiting so I set out to find another solution.

There are a number of good Wiki platforms out there but most of them focus on providing public services to more than one person. What I wanted was a simple to install solution for personal use and no access from the outside. Then I remembered that a long time ago I experimented with MoinMoin Wiki, a file and directory based platform that is easy to configure and to back up. While it can run on an Apache web server to serve as a public Wiki it also brings its own built in web server that can be restricted to localhost, i.e. no data is accessible over the network. So I checked out MoinMoin and found that it is still maintained and developed. Great!

Obviously a 350 page word document with about 250 Wiki entries can't be copied and pasted by hand into individual Wiki pages, so a different solution was required. Fortunately, the WoAS to HTML to Word conversion (!) left the original formatting intact so each page started with the page name in a specific style and indentation. Also, font formatting (bold, italics, etc.) and code snippets were all there as well. So I decided to program a Visual Basic Macro in Word to go through the document and create a MoinMoin compatible directory structure with pages for each entry. Obviously I also wanted to preserve the formatting in  the entries as well so I had to figure out how to analyze the formatting of each paragraph in Visual Basic and convert that to MoinMoin Wiki commands. Also it turned out that MoinMoin is quite picky on the characters used for filenames and the text contained in the files. Special characters used by word for quotation marks, dashes, etc. needed to be converted to plain ASCII characters as otherwise MoinMoin would just refuse to display a page and crash during a full search operation if even only one of those characters was encountered during the search. Quite an adventure but eventually I managed to convert almost everything with a Visual Basic script to the liking of MoinMoin and only had to manually convert characters in a few pages.

I cold have put that into the program as well but converting the 350 page document took well over half an hour. The process starts quite quickly but for some reason Visual Basic slows down significantly the further it went into the document. At some point I was wondering if it would ever finish. But it did and I am glad I have a fully working personal Wiki again with all my WoAS content and everything I added in Word afterward preserved.

As I am sure I'm not the only one with this problem, I've attached the code to this post. I am not sure how many people it will help due to the many conversion steps I did between WoAS and MoinMoin. However, even for a direct conversion from the WoAS file or HTML export to MoinMoin the script should contain good information on how MoinMoin expects the directory structure to be created and how the text formatting needs to be changed. If you give it a try, good luck and have fun!

Sub convertmoinmoin()

Dim sDirectory As String
Dim bIsFileOpen As Boolean
Dim bInCourierNewBlock As Boolean

sDirectory = "C:Dokumente und EinstellungenmDesktopwiki-export"
bIsFileOpen = False
bInCourierNewBlock = False

'find first new page paragraph
For iFirst = 1 To ActiveDocument.Paragraphs.Count
  If ActiveDocument.Paragraphs(iFirst).Range.Style = "Überschrift 1" Then Exit For
Next

For i = iFirst To ActiveDocument.Paragraphs.Count
                                   
    '————————————————————-
    'select the next paragraph and then get all properties for it
    '————————————————————-
           
    ActiveDocument.Paragraphs(i).Range.Select
           
    'The paragraph text is here
    sText = ActiveDocument.Paragraphs(i).Range.Text
           
    'Style indicates new topic – new page "Überschrift 1"
    Style = ActiveDocument.Paragraphs(i).Range.Style
                                   
    'formatting of the whole line, 99999 if several formats are used…
    Bold = ActiveDocument.Paragraphs(i).Range.Bold
    Italic = ActiveDocument.Paragraphs(i).Range.Italic
           
    'Font name courier new hints at program code to be treated specially
    Font = ActiveDocument.Paragraphs(i).Range.Font.Name

    '0 if not a list, other if list
    ListType = ActiveDocument.Paragraphs(i).Range.ListFormat.ListType

    'Indent is >0 if the paragraph is indented! (NOTE: also for bulleted lists!)
    Indent = ActiveDocument.Paragraphs(i).Range.ParagraphFormat.LeftIndent
           
    '—————————————————————-
    'now analyze the paragraph
    '—————————————————————-
           
    'If a new entry is found, create a new subdirectory and topic file
    If ActiveDocument.Paragraphs(i).Range.Style = "Überschrift 1" Then
              
        'remove trailing line feed'
        sText = Left(sText, Len(sText) – 1)
       
        'replace a number of characters in the filename as MoinMoin
        'does not accept them
        sText = Replace(sText, Chr(147), "x")
        sText = Replace(sText, Chr(148), "x")
        sText = Replace(sText, Chr(150), "x")
        sText = Replace(sText, "-", "x")
        sText = Replace(sText, "/", "x")
        sText = Replace(sText, ",", "x")
       
        'Filename must not contain blanks, replace with "(20)"
        sText = Replace(sText, " ", "(20)")
              
        'only create a wiki page if line is not empty
        If Len(sText) > 1 Then
       
            'close the previous wiki page file
            If bIsFileOpen = True Then
              'if the previous wiki page file ended with a coding section
              If bInCourierNewBlock = True Then
                 Print #1, "}}}"
                 bInCourierNewBlock = False
              End If
             
              Close #1
            End If
       
            FileSystem.MkDir (sDirectory & sText)
            FileSystem.MkDir (sDirectory & sText & "revisions")
              
            Open sDirectory & sText & "current" For Output As #1
            Print #1, "00000001"
            Close #1
              
            Open sDirectory & sText & "revisions0000001" For Output As #1
           
           
            bIsFileOpen = True
        End If
                             
    Else 'the paragraph belongs to the current file
      
       'remove trailing line feed'
       sText = Left(sText, Len(sText) – 1)
      
       'Word uses special quotation marks, replace them with the ASCII character
       sText = Replace(sText, Chr(147), """")
       sText = Replace(sText, Chr(148), """")
      
       'Word uses special – sign, convert to ASCII character
       sText = Replace(sText, Chr(150), "-")

       '—————————————————————————–
       'Treat blocks in Courier New first (program code, no formatting to be applied)
       '—————————————————————————–
       If ActiveDocument.Paragraphs(i).Range.Font.Name <> "Courier New" Then
          If bInCourierNewBlock = True Then
             Print #1, "}}}"
             bInCourierNewBlock = False
          End If
       End If
      
       If ActiveDocument.Paragraphs(i).Range.Font.Name = "Courier New" Then
          If bInCourierNewBlock = False Then
             Print #1, "{{{"
             Print #1, sText
             bInCourierNewBlock = True
          Else
             Print #1, sText
          End If
      
       '———————————————–
       '…And now the rest of the formatting
       '———————————————-
      
       ElseIf ListType > 0 Then
          'paragraph is a bulleted list
          Print #1, " * " & sText
         
       ElseIf Bold = True Then
          Print #1, "'''" & sText & "'''"
      
       ElseIf Indent > 0 Then
           
          'if indent and italic
          If Italic = True Then
             Print #1, " . ''" & sText & "''"
          Else
             Print #1, " . " & sText
          End If
         
       Else 'just put the paragraph in the wiki file as it is
          Print #1, sText
       End If
      
           
    End If 'paragraph belongs to current file
Next

If bIsFileOpen = True Then Close #1

End Sub

A Bad 3G Network Is…

While I was full of praise for the great Internet connectivity at the hotel I stayed when I was recently in St. Petersburg in Russia I also have to say a few words about the devastatingly bad 3G Internet connectivity of Beeline, one of mobile network operators in St. Petersburg.

To also be connected while on the move I had a local SIM card on a good data tariff that promised speeds up to 14 Mbit/s. In practice, I never saw more than one Mbit/s in the downlink direction and about half a Mbit/s in the uplink direction which is still good and usable if it was reliable. Unfortunately, while there was coverage and good signal strength in most places I was, getting IP packets through the link most of the time didn't work at all or only very slowly.

After a few days and trying the SIM card in a few devices to ensure this "non connectivity while having good coverage" is not the result of a device incompatibility, I gave up frustrated and just did what everyone else seemed to have done as well: Use the free and totally open Wi-Fi hotspots provided by most restaurants and cafes in town.

Quite frankly I wondered what the point is of rolling out a 3G network and then having such a crappy service? Sorry Beeline, that was the first and the last time I used your network. I wonder if MTS or other competitors would have been better?