NZ Government Could Better Support Local OSS

Just read an interesting press release from the New Zealand Open Source Society:

http://nzoss.org.nz/news/2009/press-release-nzoss-g2009-negotiations-microsoft

I especially agreed with the following:

“There are too many potential opportunities for New Zealand being missed. We need to re-examine why free software is not being picked up in a major way across the public sector.”

Small investments could yield large and ongoing returns.

SVG and the Future of Web Development

Sitepoint (Meitar Moscovitz) has an interesting article on SVG – SVG Is The Future Of Application Development. The blog item introduced me to the Sun Labs Lively Kernel project amongst other things. I have worked with SVG before – initially just making clipart in Inkscape, and more recently doing some geomapping. I found it clean and simple. Using SVG also meant I could develop my own tools for working with it which is what open standards is all about.

Which brings me to some of the comments on Moscovitz’s article. Some responses suggested that SVG was redundant because Adobe had shifted in another direction. The possibility of a single vendor abandoning a technology others have come to rely on is precisely why I think we should support open standards. We should support them in preference to proprietary systems unless the alternative is compelling (I have yet to find a good alternative to MS Access for some purposes, for example, but I am keeping an eye open). In addition to safeguarding against abandonment, using open standards increases competition in the tools space. MS IE 6 is an example of what can happen when a dominant vendor feels a lack of competition.

Other comments related to the lack of support for SVG in IE (for the foreseeable future). The argument was that if IE didn’t support it then there was no point using it. I don’t think it is that simple. IE is still dominant but there could be many cases where web application development could assume that a standards-compliant web browser would be used (e.g. kiosks; an intranet; a web application aimed at home users which the home users were highly motivated to use). Anyway, the future could surprise us. Who ever thought they would see Microsoft support ODF or portray itself as open-source friendly!?

I won’t be using this technology myself at this stage but I wouldn’t be surprised if it is something I need to add to my toolkit in 5 years time.

Windows XP Infested, Replace with Ubuntu Hardy Heron

The nasty virus infestation was the final straw and my father-in-law wanted to switch to Ubuntu. He wanted better security and peace of mind.

Step 1 – Use live CD to check that Ubuntu works OK with hardware (monitor, printers, keyboard, mouse, scanner, soundcard)

Step 2 – Transfer ALL files (including malware) from windows PC to my Ubuntu notebook using ssh

Type into terminal sshd
Follow the (extremely simple) instructions to install ssh server on notebook so we can send it files
Connect PC and notebook with ethernet cable (NB modern network cards probably make it unnecessary to use a special crossover cable)
Set wired connection on PC to static IP
Reboot (not sure if always or even usually necessary but it can remove some problems
Set wired connection on notebook to a different static IP
Reboot (probably not necessary but doesn’t take long)
On PC ping self in terminal e.g. ping own_IP (Ctrl-C to interrupt)
On notebook ping self in terminal e.g. ping own_IP (Ctrl-C to interrupt)
Ping each machine from the other e.g. on notebook ping PC_IP
If all pinging works, run the following (NB assumes drive mounted as drive 1):
scp -pr /media/disk1 username_on_dest@notebook_IP:~/savedpc
(scp http://linux.about.com/od/commands/l/blcmdl1_scp.htm)
At the end check that the same number of files etc made it across.
Then set the permissions for the oldpc folder (and all its contents) to read only etc

NB wipe ssh server off notebook to reduce attack surface. sudo apt-get remove name_of_ssh_server_package

Step 3 – Perform guided installation of Ubuntu wiping entire hard drive

Step 4 – Set up Ubuntu (see http://p-s.co.nz/wordpress/?p=28
NB we need internet access so we can temporarily switch from static IP for the wired connection to DHCP.

Step 5 – Transfer all files back into a folder called oldpc

Type into terminal sshd
Follow the (extremely simple) instructions to install ssh server on PC being rebuilt so we can send it files
Run the following:
scp -pr name_of_folder_to_shift_back username_on_dest@PC_IP:~/oldpc
At the end check that the same number of files etc made it across.
Then set the permissions for the oldpc folder (and all its contents) to read only etc

Step 6 – Enable remote access into PC from notebook
NB initially we are setting this up with the PC in the same room sitting on the same network as the local notebook. Once everything is set up and we install the PC where it actually belongs we will need to use a different IP address. Vinagre’s Find method will no longer work because it works on the local network.

6.1 Set up ADSL modem to allow packets from obscure port through to ssh port (22). Some modems have it as a NAT rule, some as port forwarding (basic) etc.
6.2 On PC go System>Preferences>Remote Desktop and Allow other users to view your desktop and Allow other users to control your desktop (NB ignore command suggestion – we’ll just use Vinagre).
6.3 Create new user via Administration>Users and Groups. This user will be the only one we allow to ssh in. Give that user administrator rights
6.4 Change ssh settings to ONLY allow that new user access to the PC via ssh

sudo gedit /etc/ssh/sshd_config
add new line on end and a blank line after it. May need to reboot (may not). NB sshd not ssh.
The new line is AllowUsers new_user_name_here
6.5 Open ssh tunnel (port forwarding) on notebook. NB format is port:host:hostport. When you connect to that port on the notebook it is directly connecting you to the hostport specified.

ssh -L 5900:localhost:5900 new_username_on_dest@PC_IP

NB I will need to do this each time I wish to use Vinagre to connect to the PC. I open an ssh tunnel, and then use Vinagre to reach across it. I will also need the following on the end of the command:
-p obscure_port

6.6 Open Vinagre on notebook
Applications>Internet>Remote Desktop Viewer>Connect
Host: localhost
Port: 5900
This works because I am directed to port 5900 on the remote computer (via the port forwarding I just set up in the terminal) and localhost is localhost on the PC of the host port.

6.7 Do whatever is needed on the remote PC

6.8 Close Vinagre (NB F11 to toggle in and out of fullscreen)

6.9 Close ssh tunnel with
exit

Step 7 – Setup PC in actual location with ADSL modem etc
Having trouble connecting to the internet. Able to connect to the ADSL modem from the PC using http://gateway_IP_address_here/ so the ethernet connection, the power, and the modem are all working fine. But pinging out doesn’t work. Fixed that. Odd setting required. Printer and scanner installed extremely easily. Much better than competing OS’s ;-).

Step 8

8.1 Thunderbird files
Copied old thunderbird folders across from windows (it worked!). Use sudo cp … and copy and paste the location. To copy all contents of a folder use -r or -R and “path name/with gaps/”* Will find everything in Ubuntu in /home/user_name/.mozilla-thunderbird/gobbledegook.default/Mail. Ctrl H to see hidden folders etc.

Even if a folder does not have subfolders, you must use the -r. Otherwise you get something like cp: omitting directory yadda yadda. http://www.tuxfiles.org/linuxhelp/dirman.html

NB copy and paste the gobbledegook because it can be hard to get it exactly right just by reading it – example reason – Lowercase L (l) not = numeral one (1) even though in some fonts they are very similar!!!!!!! The windows location is Documents and Settings/user_name/Application Data/Thunderbird/Profiles/gobbledegook.default/Mail. It may be necessary to unlock the folders copied across so use sudo chmod 777 -R path_to_unlock_recursively

8.2 Thunderbird address book
Copy the file abook.mab from … oldpc … /Documents and Settings/user_name/Application Data/Thunderbird/Profiles/gobbledegook.default/” to /home/user_name/.mozilla-thunderbird/gobbledegook.default/

8.3 Firefox 2 bookmarks into Firefox 3
This only required opening Firefox 3, Bookmarks>Organise Bookmarks>Import HTML and importing the stored bookmarks.html file from … oldpc … /Documents and Settings/user_name/Application Data/Mozilla/Firefox/Profiles/gobbledegook.default/”. Restart Firefox.

ROUTINE USE:
open secure shell in:
ssh -L 5900:localhost:5900 new_user_name_on_dest@PC_IP -p obscure_port
The PC_IP address will frequently change so try the last one and then ask user to visit www.showmyip.com and tell you the new one. The obscure port was set in step 6.1.
First time with any new IP address will need to say yes (not y, Y etc) to RSA key creation.
Otherwise just need password for new_user_name_on_dest.
(NB to exit when finished)

NB can work from the CLI for file management tasks etc. Only open remote desktop viewer if seeing the screen (or user interaction) useful.

The open remote desktop viewer (Vinagre) Internet>Remote Desktop Viewer
Connect:
localhost
5900

NB performance not so good so use desktop when you have to and actual shell itself when you can.
To get cursor I think it is is Ctrl-Alt. NB fastest often to set desktop background to a colour while working on it and restore wallpaper at end.

Fix for Firefox 3 Annoyance

Firefox 3 is great overall, even (especially) the Awesome Bar, but there is one annoyance. If you accidentally untick “Do not ask next time” when closing Firefox with multiple tabs open (e.g. by clicking anywhere above the buttons you do want – an easy mistake), it won’t ask you to “Save and Quit” again. The ability to Save and Quit is one of the great new things Firefox 3 has introduced.

Fortunately, you can recover. But only if you know what has happened and what to do.

Tools>Options>Main>Startup>When Firefox starts – Set to Home Page
Make sure Tools>Options>Main>Startup>Tabs Warn me when closing multiple tabs – TICK

Kexi review (Access bruiser but not Access Killer yet)

After my disappointing experiences with OpenOffice Base last year I was worried that Kexi wouldn’t be much good. But it was – within its limits. The interface seemed excellent and intuitive and even though it wasn’t anywhere near as familiar to me as the Access interface (many thousands of hours) I found myself getting quite fast at it quite easily. My real issues relate to scripting. It was exciting to see that I could use python with Kexi as my scripting language but it is not clear yet how to add lots of sophisticated functionality e.g. when I update this field I want to check 3 other values and some data in the database and enable, disable some widgets and produce some messageboxes. This may well be easy (someone please correct me) but I don’t have lots of time to gamble on this if it is not ready. If I can get that sorted (including lots of good documentation on how to control and read from the widgets using python), I will take the next step and check out Kugar – the reporting part of Kexi. If all these parts work, and there is at least one decent book on Kexi in English, we might actually have an Access Killer. Kexi + MySQL + Kugar could be a winning combination for rapid application development – especially by non-programmers.

[update version 2.2 is released and looks promising – http://www.koffice.org/news/koffice-2-2-released/]

PyInstaller Round 2

Round 1 was nearly 18 months ago (PyInstaller1.2) and enabled me to successfully deploy a GUI application as a folder (although the XP button styles weren’t quite right – solved below).

Round 2 lasted about 8 hours and involved pyInstaller 1.3 on XP with python 2.5, wxPython 2.8.7.1, and win32com 2.1.0. If I’d had these tips at the beginning it would have taken 20 minutes max ๐Ÿ™ :

  1. Don’t name any folders “python”. It shouldn’t matter and usually it doesn’t but sometimes it does. Use mypy or something similar instead. That could have saved 6 hours right there ๐Ÿ˜‰ . If a module was referred to as python.msaccess, for example, the python part would be treated as a module and expected to have an __init__ method. NB everything worked fine except when it was processed into an executable by pyinstaller.
  2. When testing the build process of a spec file, set console to True (or 1) and debug to True (or 1).
  3. When running the build process from a batch file, add the command
    pause
    as the final line. Then you can see all the errors, if any, and have a chance at fixing them. Can also add something like raw_input(“Hit Enter to continue”) at the end of Config.py etc to ensure files like upx are configured successfully.
  4. To identify problems with the executable, run it from a batch file, and include pause as the final command on its own line. NB make the exe with debug=True and Console=True for these steps (revert when issues fixed).
  5. Set console=False (or 0) so that XP buttons look more attractive than the older, rectangular form.
    Rounded XP buttons
                     vs
    Rectangular XP buttons

    XP and wxPython and XP buttons etc
  6. If doing a single file executable, remember to add a.binaries after a.scripts
    a.scripts, a.binaries,
    and set exclude_binaries=False
  7. It really is quite easy to edit a spec file – it is just python after all.
  8. Scripts should be without comma separation and with single backslashes in the makespec process (Batch file), and with commas and double backslashes in the python spec file.
  9. Icon images etc can be kept in the same folder as the executable for ease of portability. Inside the script they should not have an absolute path.
  10. Start with a simple HelloWorld test as per the very helpful http://www.thescripts.com/forum/thread579554.html to check all systems are working before tackling a more complex, real-world example which will require getting down and dirty with the spec document.
  11. python “…Build.py” “…..” won’t work on my system – need “C:\Python25\python.exe” “etc …”

There is excellent documentation available at PyInstaller Manual

UPDATE: got a mysterious error on a script that worked well until it was processed by pyinstaller. Without all the gruesome details, it was because I had the wxPython application set to not redirect its output AND I had some print statements tucked away in some code. At some point (when the printed output reached 4096 bytes?) up popped an [Error 9] Bad file descriptor error. In future, diagnose by making an output.txt file and setting redirect to true. What is in the output file?

UPDATE: Use the -w parameter to skip the DOS window during execution.

UPDATE: Pyinstaller 1.5 with Python 2.6 (Round 3)

Real Interoperability

A recent Computerworld article “Microsoft loses appeal against EU antitrust ruling” contains some very good news for IT consumers everywhere. OK it took legal force, a massive fine (รขโ€šยฌ497 million), and it was resisted every step of the way, but Microsoft is finally going to enable genuine interoperability.
http://computerworld.co.nz/news.nsf/news/53A9FEF5880B1C7DCC25735900739D2F?
opendocument&utm_source=topnews&utm_medium=email&utm_campaign=topnews

How is this good? It means competitors to Microsoft finally get a fair go. Monopolies are bad for consumers and bad for innovation. It’s as simple as that.

From Computerword –

Carlo Piana, FSFE’s legal counsel, described the court ruling as “a milestone for competition. It puts an end to the notion that deliberate obfuscation of standards and designed lock-in is an acceptable business model, and forces Microsoft back into competing on the grounds of software technology.”

Also check out:

http://blogs.cnet.com/8301-13505_1-9779529-16.html?part=rss&tag=feed
&subj=TheOpenRoad

http://commandline.org.uk/more/microsoft/
eu-microsoft-decision-upheld-2007-09-17-11-00.html?showcomments=yes

This is especially good for Samba:

The Court of First Instance’s judgement, like the commission’s before it, sees Samba as the means for competition, in the Work group server space (i.e. file servers, print servers, etc). All potential competitors to Microsoft are using Samba, (the commissions own research found that 98% of competing products in this space use Samba), so it is good that the commission and the CFI are keen to get the documentation from Microsoft in a form that open source projects such as samba can use.

http://yro.slashdot.org/comments.pl?threshold=5&mode=thread&
commentsort=0&op=Change&sid=299827

Microsoft doesn’t deserve free advertising

Both major TV channels in New Zealand ran major stories on the launch of Microsoft Vista a few months ago. The TV One version was basically a wide-eyed and breathless advertisement for the product. TV3 provided something slightly closer to news (as opposed to advertising).

Microsoft should have to pay for its advertising like everyone else. There are other organisations much more worthy of charity treatment. And it is not as if there is a shortage of actual news stories involving Microsoft. For example:

EU official: Microsoft’s behavior ‘unacceptable’
Commissioner bashes Microsoft for continuing to gain market share using tactics outlawed in 2004 antitrust ruling
http://www.infoworld.com/article/07/03/22/HNmsunacceptable_1.html

European competition commissioner Neelie Kroes hit out at Microsoft in comments to European parliamentarians Thursday, saying it is “unacceptable” that the company continues to gain market share using tactics that were outlawed in the Commission’s 2004 antitrust ruling against the software vendor.

Three years later Microsoft still hasn’t complied with the main demand imposed by the European antitrust ruling: that the company share interoperability information inside Windows at a reasonable price to allow rival makers of workgroup servers to build products that work properly with PCs running Windows.

“Microsoft is constantly gaining market share and that is what is worrying in the workgroup server operating market,” Kroes said, referring to server operating systems used to allow a team of people in an office to sign in, print and share files.

She told the parliamentarians that Microsoft’s market share in this sector has continued to rise since the 2004 antitrust ruling. When the Commission began its antitrust investigation in 1999 Microsoft held between 35 percent and 40 percent market share. By 2004 it rose to around 60 percent and now it stands at between 70 percent and 75 percent.

“That’s unacceptable,” Kroes said.

Withholding the interoperability information is an illegal competitive tactic, the Commission said in 2004. Offices full of PCs running Windows are easier to connect together using Microsoft’s workgroup server, than using the server of a rival such as Sun Microsystems Inc.

This unfair advantage would eventually result in Microsoft taking over the workgroup server market, the Commission predicted at the time of the ruling. The latest server market share figures appear to confirm that analysis.