2011-06-27

Windows and the command line

If I remember correctly I was about 14 when I wrote my first MS DOS batch file. I can't say that I write many of them but from time to time I think a VB script is too much for just some little work.

On the other hand I began to really learn Linux shell scripting only about 6 months ago. After that I find the Windows batch file language a very poor thing. It has a poor feature set, a lousy documentation and it is buggy. And this still applies for Windows 2008r2 - so I am talking about the newest OS version.

Right now I lost about two hours investigating a problem to find out that the batch file I wrote, did not work. The problem was caused at a completely unexpected place where I had a few lines that I previously tested separately - on the command line.

Guess what: Behaviour may be different if I run a command on the commandline or from within a batch file!

Here is an example - try this on the command line:
set var1=fluffi
echo _%var1%_ _%var2%_
The result will be: _fluffi_ _%var2%_

And now put those two lines into a .bat or .cmd file and run it.
The result is: _fluffi_ __

A pretty difference, isn't it!

In my case I was passing a string like this "blablabla%muh%bla" as parameter to a called program and the parameter did not fully arrive in the batch file while it did when I tried on the commandline.

What's that?!?! - Is this the Microsoft logic? - I think so... one only has to look at the evolution of MS Word...

Oh - I guess you want a solution: In the batch file you have to escape % doubling it - %%.

Related Post: The Microsoft Logic 

2011-05-30

Microsoft & Skype

I guess you have not missed the news about Microsoft aquiring Skype. Although Microsoft told they will continue development on all versions of Skype I have my doubts - and so do others too.

Recently Digium, a company that develops an integration for Skype with Asterisk, had to give up because Skype/Microsoft is stopping the partnership - read here.

You are free with your own interpretations on this but I am already searching for a replacement for Skype.

The very sad thing these days is: As soon as a software got really good and really adds value and/or increases your productivity, it gets destroyed somehow - being prices getting too high or not being continued. This way we will never step out of the bronze age of IT...

What you can see here as an example: People often say that in Open Source world you don't have a guarantee that the software is supported and continued. As you see here, proprietary software is not different here. But in open source world there is always the option to fork (see OpenOffice->LibreOffice). This option is missing in proprietary world. So basically in Open Source world you are more safe!

Related post: The Open Source movement.

2011-05-24

OpenOffice and LibreOffice starts slow

Sometimes there can be even annoying problems with Open Source software.

A few days ago I got annoyed by OpenOffice starting slow. Then I decided to switch to LibreOffice and first thought it helped. Then a day after it was slow again.

Finally I found out that it starts slow whenever I have the VPN connection open (using SonicWall NetExtender).

After searching the internet a lot without finding anything that helped I landed at LinuxQuestions at this thread: http://www.linuxquestions.org/questions/linux-software-2/double-clicking-on-open-office-files-leads-to-very-slow-opening-808048/

Running
sudo tcpdump -nnl -i any -s 1536 dst port 53

on the commandline discovered that LibreOffice was searching for .(none) via DNS and the VPN inserts it's DNS servers right in front of every other DNS entry in /etc/resolv.conf - grmpf!

So similar to what is mentioned in the thread above, I had to add
127.0.0.1    myhostname.(none)

to the file /etc/hosts - done. This and some other small, but annoying changes in reality need to be done at each install of a new system. - Of course, there are even more of those annoyances on Windows, but it seems you can't get rid completely of those... :-(

Related posts: Ubuntu 10.04 & docking station part 1 + part 2, Locale configuration on Ubuntu, Firefox change default page format.

2011-05-03

IT fallout and buddhism

Today I had two thoughts about today's usual IT landscapes:

  1. Windows is like radioactive fallout on the IT level. People accept it and somehow knowing about the problems and then get killed (through stress and burnout for example) by the effects - slowly and without them either noticing.
     
  2. I need to take buddha as an example to accept the common IT flaws. Although he has seen the light, he returns in his free decision to this world to help people in their endless suffering. I somehow also feel to have seen the light because I see how things could be done better, but anyway I face Windows again and again at customers. I need to see this as an opportunity to assist people in their suffering. In most cases people are not able to finish their suffering and see the light... ;-)
Related post:  The truth about software.

2011-04-22

Thunderbird and the Outlook Global Address book

As I mentioned in an earlier post, I have switched job and while I initially had to use the Outlook Web Access (OWA) in the version of 2010 to access my mailbox. At this point I want to be fair and say: Microsoft really improved the web client. You can work with it. I prefer that interface over several others (Hotmail/Live). The other option was to use the real Outlook over a terminal server session or using a virtual machine. I tried both (in version 2007 and 2010) too so I have used all variants. The result is: Outlook still completely sucks! I talked to other people who ever used something different than Outlook in their work (e.g. Thunderbird or Notes) and everybody confirms, that Outlook sucks. People often wonder why I have problems with Outlook when "the whole rest of the world" is fine with it. The reason is: Most people don't know anything else and they got used to suffer. But enough, I want to help out everybody who is in the lucky situation that IMAP protocol got activated in their Exchange branded workplace (in my case they activated it just for me :-) - this is cool). I tried several alternatives for directly accessing the Exchange server without success and I could not occupy the internal IT for hours to figure out, what goes wrong. Opening up the IMAP protocol was the simplest and straight-forward-option.

So I can use the loved Thunderbird again!

But opening up the IMAP is only half the way. You also need to get access to the address book. And here I ran against brick walls in the first step:
  1. Trying to open an LDAP address book pointing to the Exchange server failed in getting no connection (neither port 389 nor 3268 worked).
  2. I figured out the AD (Active Directory) server of the Windows world and used that. It connected immediately to port 389, however then had problems loading the contacts. As I know now, it is a matter of filtering to the correct entry set. However, after failing continously during my first attempts I tried
  3. exporting the global address list from within Outlook into ... well ... anything, I was about to even accept any CSV file, however styled. Completely failed in that too - you can export contacts but not the global address list. You can imagine how happy I was...
Fast forward to my final solution which now supports
  • directly using the global address book via LDAP directly from the server or
  • use a local copy (export+import which you need to do manually from time to time to be up-to-date).
How it is done:
  1. Get the Apache Directory Studio or another LDAP browser tool of your choice that supports an LDIF export. In the Apache Studio case, just extract the package and start it (yes, it's that simple, it's a Java application that runs on Linux and Windows). You need this to first test your LDAP access, if you are not sure about the correct criteria.
  2. Now you need to find out where the AD is hosted. In my case I promised not to ask boring questions to IT (they were already nice enough to open up the IMAP just for me), so I had to find out on my own. I simply checked in to the Terminal Server Session and wrote a little batch file (directly going to the console is forbidden in the terminal server session due to security policies) of the content:
    set
    pause

    and just double-clicked it to find the entry "LogonServer", "UserDNSDomain" and "UserDomain".
  3. Now start the Apache Directory Studio and create a new LDAP connection. The connection parameters would be something like:
    hostname=fulldnsmachinename

    (using the information from LogonServer and UserDNSDomain, so e.g. "myserver.mycompany.com").
    Port = 389

    (default LDAP port).
    Logon with UserDomain\yourUserName and your password.
    Click on "Fetch base DNs" to find out the base DN to use - or guess it, it usually is:
    dc=yourCompany,dc=internetsuffixlikecomnetorgetc

    so for example dc=microsoft,dc=com.
  4. Now you would find a lot of stuff browsing through the AD (assuming you have enough read permissions). To find the entries that are displayed in the Outlook address book, you need to filter the information. To do so, create a new search using the base DN above and the following search filter (click on "Filter Editor..." for better formatting):
     (&
    (showInAddressBook=*)
    (mail=*)
    (mailNickname=*)
    (|
      (objectClass=person)
      (objectClass=group)
      (objectClass=groupOfNames)
    )
    )

    Here is the filter again as one-liner - this is how to use it in your Thunderbird:

    (&(showInAddressBook=*)(mail=*)(mailNickname=*)(|(objectClass=person)(objectClass=group)(objectClass=groupOfNames)))

    In the Apache Directory Studio you can now set the option to "Follow referrals manually" or ignore them completely. Leaving it to automatic can produce errors - especially if AD not well configured (in my case loops are generated when automatically following all referrals). Search scope should be the complete subtree. Check the results by executing the search.
  5. Start Thunderbird and create a new IMAP account (if you didn't already) and create a new LDAP address book (Tools-Address book; File-New-LDAP Directory). Enter Hostname, Port, Base DN as in step 3 and in the "Advanced" tab choose subtree and enter the one-liner version of the filter as in step 4.
    Now you have the direct access version. You now could change settings in Thunderbird (Edit-Preferences-Composition-Addressing) or even configure it for a single account (under Composition and Addressing) to use the LDAP directory for autocompletion, but I found that to be annoying because of the slow Exchange server in my particular case (YMMV). Hence I did not do this but pressed F9 in a new mail to show the contacts sidebar. There I switched to the LDAP address book and can now search and choose addresses if they are not already among my collected addresses. This is BTW the same you get, using Outlook - only those addresses, you already used get auto-completed and the others you need to search manually. A second annoyance is that Thunderbird takes a longer time to really disappear from memory when the LDAP search was used during runtime. So I was not really satisfied with that solution.
  6. Just for performance and to have all autocompleted, I wanted to have a local copy of the address book. I found that the Apache Directory Studio offers an LDIF export feature, which is really the best you can get. Even phone numbers and other properties from the LDAP directory finds the way into the imported address book in Thunderbird. Just right-click the search (it's in the tree on the left-hand side) and choose "Export-LDIF" from the context menu within the Studio and in Thunderbird you go to "Tools-Address Books" and choose "Tools-Import..." - done.
Now you have both - full autocompelete and you can actively search the current LDAP at the server for the case new employees joined the train without the need to export-import all the time. However from time-to-time it makes sense to do a re-import just to have the current entries in the local cache. Fortunately the search is saved in the Apache Directory Studio for later reuse. Thanks to the Apache team for this great piece of software!

Oh, BTW: The local download of the LDAP directory did not work for me (it started but never finished - maybe because of the internal loops).

Hope this helps!

Related posts: Ignorance of the different, Popular Ubuntu Desktop myths, Apple worse than Microsoft, Outlook Calendar meetings, Maintaining multiple calendars.

2011-03-02

Popular Ubuntu desktop myths

Some opinions around Ubuntu on the desktop - or Linux in general seem to be never dying although they should be really outdated. A few are:
  1. Linux/Ubuntu is only for PC freaks.
    This is simply not true. Ubuntu/Linux is at least easy to use as Windows. For the normal user it is less painful for sure: You are faster up and running (because after installation also many apps are already there), you don't need to search your shitty licence code you probably already thrown away accidently a year ago, you don't get penty annoying questions when first starting your browser, you can install easily whatever language you need for whatever family member or friend who might visit you and you want to share the computer with, you can buy Ubuntu already installed on a USB stick that you can carry around and use it on whatever computer you go, you can easily use any file as a template and many, many more.
  2. Installation of applications is difficult (need to be compiled).
    There are distributions that compile everything from source, but even there you don't need to do it on your own. Anyway, most distributions don't require compiling things on your own (however, this is always an option you have, even if mostly not recommended). - Installation of software is usually simpler than on Windows: You start a program (menu entry) which contains a list of available applications, you can search, scroll through the list, just tick the checkbox in front of the application(s) you like to install and click "Apply". Download and installation done automatically then. For uninstall - guess what: Just uncheck and apply again. If you are funny, you can search the internet for a more up-to-date installation package or other application not in the repositories and install it by double-clicking it after download just as you do it on Windows. What is so difficult then? Even a trained monkey can do it. ;-)
  3. Everything must be done on the command line.
    Most things nowadays can be done through a graphical user interface also. One reason why much is done on the commandline: It is far easier in a forum or blog post to respond to a question with a few commands that just need to be pasted to a terminal window than it is to explain it with plenty of clicks and menu items (with the ribbons situation is even worse). For the person that receives the help it is also easier. And other than on Windows, everything you can do on the graphical environment you can also do on the commandline. That does not mean you have to do it that way.
  4. Linux looks old-fashioned on the desktop.
    Look yourself and decide: http://www.ubuntu.com/desktop/why-use-ubuntu, http://www.kde.org/screenshots/, http://www.xfce.org/about/screenshots, http://lxde.org/image/tid/1, http://www.linuxmint.com/screenshots.php, http://www.gnome3.org/, http://www.enlightenment.org, - All this can be used in Ubuntu - you can choose!
    Oh, you want Mac-style toolbar on the bottom - or Windows 7 like - look here for example: http://www.omgubuntu.co.uk/2010/04/you-choose-the-best-dock-for-ubuntu-poll/ - again: You choose, what you find efficient and cool!
    What is true, that some older applications are looking ugly because they use old interfaces (sometimes when searching in the repository and try new apps I happen to get such an old-style thingy), but the major part looks very nice.
  5. There are so many variants (of Ubuntu itself and even more if you look at other Linux distributions) so there will be never be a standard.
    The core for Linux is the same for all and the most differences are not in the system but just in the desktop environment or GUI presentation. But this is for your freedom and you can anyway start multiple applications using different GUI frameworks. Keep in mind that all people like to work differently. Everybody has his own preferred way of doing things. Hence should be you computer: It should support you by doing the work they way you like!
  6. Ubuntu is not compatible with Windows.
    This can't be said so generally. It is applications that are not compatible, file formats or protocols and you have to look at those separately. For example: Many widely used file formats (as JPG, PNG, TIFF, PDF, RTF, MP3, AVI and many more) can be handled without problems on Ubuntu. Even the DOC, XLS, PPT Formats can be handled quite good in the meantime. It is Microsoft that continously invents new formats and changes existing formats (see the latest DOCX which is different in MS Office 2007 and 2010, so that you need to save it in a compatible form from within 2010 if you want it to be displayed in the same manner with 2007 - .docx is not .docx!). Ubuntu better supports more open standards than Windows does (e.g. look at the MIME-Format - this is the format used to send e-mails over the internet - and look what you get from Outlook)!
  7. Ubuntu is developed only by students in their spare time.
    Canonical is the company behind Ubuntu, but Ubuntu is based on Debian (look in particular at http://www.debian.org/partners/ for example) and that all is Linux. And many big companies are contributing to Linux! So, if this ever was true, it is not any more since quite a while (see http://www.techrepublic.com/article/linux-standard-gains-big-name-backers/5365462 for example).
  8. Ubuntu is free and hence must be very buggy.
    Wherever software is developed, bugs are introduced. There are not more or less bugs in Ubuntu than on Windows - IMHO. Windows is used by more people and companies and hence there is a higher probability that bugs get found but for Ubuntu it is extremely easy to get involved, report bugs and get in touch with the developers and hence get the bugs fixed. So I think we are pretty at the same level here and there although I think, Ubuntu is more stable (of course ;-) ). And why it is free is because of the Open Source idea where people pay for work being done (new features, bugfixes,...) and not for ... (yes for what?). See "The Open Source idea" for details.
These are just the first examples that come to my mind.

Related posts: Document file format, The community, Going Linux, The Open Source idea, Why companies do not use Linux on the desktop, Distribution choice, Outlook Calendar Meetings, The individual desktop, Efficient desktop environment, A few Linux related videos.

Ignorance of the different

I haven't written since a while. The reason is: I changed job and it has been a stressy time for me.

Fortunately I found a company that accepted that I work on Ubuntu on my desktop. Of course there is Windows stuff to do - which I will do from a virtual machine or via remote desktop.

During my job search and at other occasions I wondered about the big ignorance (it is not always plain unawareness) of people working in the Windows and Microsoft environment. The vast majority of users, IT staff and managers still cannot accept, that the era of the Microsoft-only IT environment will be history in a few years.

Many young people are using Macs (even if it is just because they want to be different or cooler than others in a few cases) for example. I have customers where users are using Macs in the office on their productive workstation - yes, today (I am not talking about a single case only).

And BTW: I don't know a single real person who really tried Mac or Linux and then switched back to Windows. The contrary is true, most I know, didn't look back after two weeks on Ubuntu for example. I am not talking about forum entries of people who tell they switched back to Windows - I don't give much on them after I have seen sooo many forum posts that are so evidently fakes (or paid comments - yes, there are companies where you can pay for manipulating the public opinion through forums, blog comments etc).

Oh, and I have seen people selling Android phones and when I mentioned Linux, they never heard of it - hey it runs on the thingis, you sell!

There are a few things, that are really super-annoying and I start to get angry, when:
  • people assume, that everything other than Windows must be crap (without either looking). How can somebody have such opinion about something they never heard of yet?

  • I report a problem with a website or a service and people ask me what OS I am using (or worse: "What Windows-Version are you using?") and then tell me automatically it must be a problem with my machine or client - even if that has nothing to do with the OS that I am using.

  • when I ask people for help (e.g. just tell me the proxy, I have to use, when I want to use the internet), they see my machine and they immediately tell me - hell, what is this - I cannot support this. - Hey, it's maybe just a DNS or PROXY ip address I want to know - is this really so difficult? I don't ask them to configure my machine for me - I can do it myself.

  • people treat me like a fanatic or fundamentalist, just because I have pretty good reasons to not like Windows and prefer something else. I do accept that other people do not have enough problems with Windows to seriously consider a switch (if you take care you can keep even a Windows system quite stable and performant over a longer period of time - so with good people maintaining the Windows in a company, work can be quite painless with Windows either).

  • especially Windows developers, who think, they know all, and in reality never looked around what is used outside their small world. The vast majority of big sites does not use neither Windows nor MS SQL Server nor .net. Some of the Windows(-only) developers I know seem to be really brainwashed.
These are a few examples. Sometimes I get really tired of trying to legitimate the use of something different.

In reality it would be sufficient to be just accepted, but if I look more deeply into it: I am working to improve customers IT experience since I was about fourteen. And from the deep of my heart, I want to serve the best for the customer. From the current view, it simply does not make sense to write new applications that only runs on Windows if there is a chance to write it in a platform agnostic way. If the application is available for other platforms also then the vendor and customer can be independent from future trends. Even very Windows centric companies nowadays allow iPhones attaching to their networks for example.

So, honestly, I must recommend using Linux, Java or any other open technology and open standard over any proprietary one. - TIFF or PDF for example has not just been adopted by accident. Documented and open standards win in the long run, such as SMTP, IMAP, SSL, MIME and plenty others, that are well established.

Related posts: IT investment, The Open Source movement, Document file format, Data file format.