Gutsy Gibbon Tribe 1

Installed OK and I was able to get the WPA working with broadcom card easily enough as per instructions in previous post regarding Feisty. A few things extra to remember – pasting into terminal is Ctrl-V AND Shift; and remember to grab the latest gutsy broadcom deb file. Plus install broadcom cutter BEFORE the final steps will work. Reboot to get card working.

Issues:

  1. Restricted driver loaded after checking out updates (none needed) but not allowing itself to be selected even after cold reboot
  2. Firefox system fonts tiny

Getting Feisty (Ubuntu 7.04) working

Clean install on partition
Step 1 – Install onto separate partitions from Windows (NB make main ext3 partition “/”)
Step 2 – Get broadcom wireless card working. Pull across bcm43xx-fwcutter_006-1_i386.deb and install it (do not automatically try to get file – see next step)
Step 3 – sudo bcm43xx-fwcutter -w /lib/firmware ~/Desktop/wl_apsta.o
NB drop files on desktop to start process. Delete both afterwards
Step 4 – Give wireless network the password and save it to the keyring
Step 5 – Run Update Manager and update anything needed (required to get proprietary ATI driver going it seems)
Step 6 – Use ATI video card driver, reboot, then set refresh rate to 90Hz
Step 7 – sudo aptitude install flashplugin-nonfree
Open Firefox and check out www.youtube.com as test.
Step 8 – sudo gedit /boot/grub/menu.lst and set pause to 7 (from 10) and default to probably 4 (XP for the time being)
Step 9 – Grab wallpaper from Windows partition.

Wishlist – flash installed in GUI way; dual monitors easy to set up; bug #91192 fixed so I can get newest Edubuntu onto kids’ computer, 3D ready to go in Chess game or easy to add using GUI.

Overall verdict – It all works and I’m looking forwards to Gutsy Gibbon ๐Ÿ™‚

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.

Creating modem applet for Xubuntu

Install xfapplet using synaptic. Add to taskbar. Configure to include modem. Right click to activate.

BTW being able to switch from Ubuntu (GNOME) to Xubuntu (XFCE) using logout, is very handy. Don’t even have to redo the wireless network connection.

[Update] – it wasn’t quite so smooth doing all this with my grandparents’ Dapper Xubuntu setup although I got there in the end. Issue 1 – needed to add a repository with xfapplet in it (it wasn’t there in my grandparent’s Dapper setup). Issue 2 – if you resize the pixel size of the icons on the XFCE taskbar, anything added on the Gnome panel doesn’t resize – and may even become invisible! ๐Ÿ™ Issue 3 – the taskbar was missing, and even if you ran xfce4-panel to restore it, it disappeared on relogin etc. Solution – looking at setting for sessions. Hid hibernate and sleep and made it automatically save session settings. Success! Phew!

Adding simple shapes to GIMP drawings

When working with screen dumps there is often a need to circle a button or put a red ellipse around something to draw it to the user’s attention.

The best way of doing this in the GIMP is not exactly easy to discover by accident!

I only found it out in “Beginning GIMP – From Novice to Professional” Akkana Peck, Apress 2006 pp.289-290.

Even then I had to work out how where in the interface I could get to gfig. Answer: Filters>Render>Gfig …

It might pay to resize the Gfig window so you can see all the controls.

There is a catch – basically the shape is not separately editable once it has been added to the graphic!

You can, however, save some standard images e.g. red ellipse from within the File>Save dialog of Gfig itself.

To select a shape click on the pointer on the toolbar and click on the middle of the shape. The selected shape should have a middle handle which is black, not white. Options are to drag the shape around or to reshape it depending on which button is selected on the toolbar. Not what I’d call intuitive but once you’ve got it it is simple.

Final point – the stroke for the shape is probably best to be a small fuzzy circle to prevent a pixelated effect. Making it slightly transparent is also good so it doesn’t obscure the details beneath (give opacity a middle setting).

Gfig

PLUS this only works if the image mode is RGB I think.

PyInstaller and making a Python program for deployment

http://pyinstaller.hpcf.upr.edu/cgi-bin/trac.cgi

PyInstaller packages Python programs into standard executables, that work on computers without Python installed. It doesn’t automatically create a subfolder structure and put things like images etc in there. That must remain a manual step.

The idea is to give someone a zipped up folder which they can unzip somewhere and it will work. They may not even have python installed, or the same version of python installed.

0. ********************************************

Install pyinstaller!

1. *********************************************

Run the following:

"C:\Python24\Libsite-packages\pyinstaller_1.2\Makespec.py"
--name="myVersion"
--onedir
--windowed
--out="C:\Backup\myVersion\Package"
"C:\Backup\myVersion\myVersionGUI.py"
"backup_classes_no_prompts.py"
"my_data.py"
"myVersion.py"
"myVersion_add_package.py"
"myVersion_package_details.py"
"myVersion_packages_list.py"

The series of scripts at the end is what is put into the executable.

–windowed (Use the Windows subsystem executable, which does not open the console when the program is launched. (Windows only))

(if too long, leave out a file and add it manually into myVersion.spec once made).

The goal is to get:

a = Analysis([os.path.join(HOMEPATH,'support_mountzlib.py'),
os.path.join(HOMEPATH,'supportuseUnicode.py'),
'C:\Backup\myVersion\myVersionGUI.py',
'C:\Backup\myVersion\backup_classes_no_prompts.py',
'C:\Backup\myVersion\my_data.py',
'C:\Backup\myVersion\myVersion.py',
'C:\Backup\myVersion\myVersion_add_package.py',
'C:\Backup\myVersion\myVersion_package_details.py'],
pathex=['C:\Python24\Libsite-packages\pyinstaller_1.2'])
pyz = PYZ(a.pure)
exe = EXE(pyz,
a.scripts,
exclude_binaries=1,
name='buildmyVersion/myVersion.exe',
debug=False,
strip=False,
upx=False,
console=False )
coll = COLLECT( exe,
a.binaries,
strip=False,
upx=False,
name='distmyVersion')

This can be manually edited etc.

2. **********************************************

NB all the syntax MUST be checked first (e.g. in DrPython).

Then:
“C:\Python24\Lib\site-packages\pyinstaller_1.2\Build.py” “C:\Backup\myVersion\Package\myVersion.spec”
3. **********************************************

Then manually add the following to the “distmyVersion” folder:

python_logo_only_39.xpm
python_logo_only_16.xpm

UPDATE: version 1.3 came out in Dec 2006. There is a great article about how to install and use it at: http://www.thescripts.com/forum/thread579554.html

UPDATE: Pyinstaller Round 2

UPDATE: Pyinstaller 1.5 with Python 2.6 (Round 3)

Apache and PHP on Windows XP (for Development Only)

Overview

Instead of allowing for all possibilities, the emphasis here is on providing a simple set of instructions that always work (fingers crossed). From this foundation, experimentation can occur in a controlled manner.

Step 1 – Get Apache 2.x.x installed (without PHP modules) – tested on 2.0.52 and 2.2.3
Step 2 – Get PHP 5.x.x working – tested on 5.1.4, and 5.2.0
Step 3 – Get mysqli module working (assumed to need MySQL) – tested on 4.1.9

Gotcha: in the Apache config file, change backslashes to forwards slashes – e.g “C:/PHP”. In the PHP config file leave backslashes as they are: “C:\Program Files etc”.

1 – Apache

Uninstall any previous version after backing up httpd.conf somewhere.

Install Apache (e.g. 2.2.2)

Having trouble finding a Windows binary? Check this out:

http://www.apachelounge.com/

Annoyed at how uncertain the process of getting a Windows binary can be? Read:

http://www.apachelounge.com/forum/viewtopic.php?p=1241#1241

Edit httpd.conf esp:

  • ServerAdmin webmaster@p-s.co.nz
  • ServerName localhost:80
  • DocumentRoot “C:/Projects” (or wherever you want to store web pages)
  • #
    # This should be changed to whatever you set DocumentRoot to.
    #
  • DirectoryIndex ………. index.php (usually index.html etc first)
  • # WINDOWS REQUIREMENTS ###
    EnableSendfile off
    EnableMMAP off
    Win32DisableAcceptEx
    ##############################

Make sure Apache is running BEFORE adding PHP functionality.

apache OK
If you see a red dot instead of a green triangle, apache is not running successfully.

If you have problems check out:

http://www.apachelounge.com/

2 – PHP

Create a “C:\PHP” folder

Extract the PHP windows binary file (preserving folder structure) to “C:\PHP”

Do NOT use the windows installer, just the zip file – extract to C:\Program Files\PHP maintaining the folders.ร‚ย  All dlls are correctly brought across (unlike installer).

Save “php.ini-recommended” as “php.ini” in “C:\PHP”.
“13. How do I know if my “php.ini” is being found and read?

It seems like it isn’t as my changes aren’t being implemented.

To be sure your “php.ini” is being read by PHP, make a call to phpinfo() and near the top will be a listing called “Configuration File (php.ini)”. This will tell you where PHP is looking for “php.ini” and whether or not it’s being read. If just a directory PATH exists then it’s not being read and you should put your “php.ini” in that directory. If “php.ini” is included within the PATH then it is being read. If “php.ini” is being read and you’re running PHP as a module, then be sure to restart your web server after making changes to “php.ini” http://www.php.net/manual/en/faq.installation.php

Anyhow, you need to edit php.ini, esp:

  • display_errors = On (NB this machine must only be used as a development machine)
  • include_path = “.;c:\php\pear” (NB the . tells PHP to look in its own folder first – don’t overlook it!)
  • extension_dir = “c:\php\ext”

Edit httpd.conf, so it will run PHP as a module:

  • # PHP ##########################
    LoadModule php5_module “c:/php/php5apache2.dll”
    AddType application/x-httpd-php .php
    PHPIniDir “c:/php”
    ###############################

The location of the loaded modules seems to result in numerous problems for people. Sometimes it is not because a file is missing, but because the file needs a companion file to operate. The Apache error message is probably misleading.

PHP searches for php.ini in the following locations (in
order):

* PHPIniDir directive (Apache 2 module only)
* HKEY_LOCAL_MACHINE\SOFTWARE\PHP\IniFilePath
* The PHPRC environment variable (possibly only relevant for CGI)
* Directory of PHP (for CLI), or the web server’s directory (for
SAPI modules)
* Windows directory (c:\windows or c:\winnt)

If you are running Apache 2, the simpler option is to use the
PHPIniDir directive

NB set the PATH in Windows to look at “c:\php”. Set this in Control Panel> System> Advanced> Environment Variables> System Variables> Path.

Plus set the PHPRC variable:

  • Go to Control Panel and open the System icon (Start -> Settings -> Control Panel -> System, or just Start -> Control Panel -> System for Windows XP/2003)
  • Go to the Advanced tab
  • Click on the ‘Environment Variables’ button
  • Look into the ‘System variables’ pane
  • Click on ‘New’ and enter ‘PHPRC’ as the variable name and the directory where “php.ini” is located as the variable value (e.g. “c:\php”
  • Press OK and restart your computer

A reboot is needed for this to take effect. This will enable PHP to locate files such as “php5ts.dll”

“NB the order of the paths in “Path” will be the order in which Windows looks for files. If you have multiple versions then make sure the correct version will be found first. Depending on your setup there is a good chance php.ini, or php5apache2.dll in “C:\Windows\System32” will take precedence over the one in “c:\php” if you have multiple.

One possible gotcha – if you have put copies of files such as php5apache2.dll, libmysql.dll, and php5ts.dll in “c:\Windows\System32” or “c:\Windows” in previous installation attempts, you will need to remove them (reboot in Safe Mode using F8) or overwrite them with newer versions. It seems that only files from the same PHP installation should be used in conjunction with each other.

“Don’t mix up your installation with DLL files from different PHP versions. You have the only choice to use the DLL’s and extensions that ship with your downloaded PHP version.”

http://www.php.net/manual/en/install.windows.apache2.php

Although lots of bulletin boards recommend putting files in the WINDOWS or SYSTEM32 directories, don’t.

“Previous editions of the manual suggest moving various ini and DLL files into your SYSTEM (i.e. “C:\WINDOWS”) folder and while this simplifies the installation procedure it makes upgrading difficult. We advise you remove all of these files (like “php.ini” and PHP-related DLLs from the Windows SYSTEM folder) before moving on with a new PHP installation. Be sure to backup these files as you might break the entire system. The old “php.ini” might be useful in setting up the new PHP as well. And as you’ll soon learn, the preferred method for installing PHP is to keep all PHP related files in one directory and have this directory available to your systems PATH.”

“The PHP manual used to promote the copying of files into the Windows system directory, this is because this directory “c:\Windows”, “c:\WINNT”, etc.) is by default in the systems PATH. Copying files into the Windows system directory has long since been deprecated and may cause problems.”

http://www.php.net/manual/en/faq.installation.php

Restart Apache from the Apache Service Taskbar icon in the tray so it will take on board the changes to the Apache and PHP config files.

Create a small file with as the contents, and save it as “c:\projects\testphp.php”.

In your browser type in “http://localhost/testphp.php” and enter. Hopefully, you will see the phrase “PHP is working – Phew!!!”.

3 – MySQL

Add the following to php.ini:

extension=php_mysqli.dll
extension=php_mcrypt.dll (nothing to do with MySQL but I usually add it for encryption needs while I’m there!)
mysqli.default_host = localhost

mysqli.default_user = xxxxx (whatever your user is)

Ref: http://www.php.net/manual/en/install.windows.extensions.php

PHP >= 5.0.0, requires “libmysql.dll” (libmysqli.dll in PHP <= 5.0.2) (bundled) PLUS: 2. COPY (do not move) libmysql.dll into the Apache2\bin directory (Even though there's no reference to this file in ANY error message I or my students have received, I have spent an interminable amount of time over the past seven weeks chasing this particular problem. All the references are to missing mysql functions when called from a PHP script and, literally, the only "mysql" dll that was not available in the extension_dir was libmysql.dll, so we tried putting libmysql.dll into the php\ext directory with no mas. Then, we put it into the Apache2\bin directory and we had connectivity! This goes against my natural inclinations to have a tidy installation, but it works, so I've passed it out to my students and the folks at the local LAMP that I've helped with their installations.) HTH. drj http://www.notestips.com/80256B3A007F2692/1/TAIO-64MEGD

Migrating to Open Source

Access/SQL to MySQL

If it is decided to shift from Access to a more robust, SQL-type database, MySQL and browser-based technologies provide a solid platform. The solution is scalable too, without the substantial licensing costs common in this area. Grant Paton-Simpson has been developing in Access for over a decade, and with SQL for several years. A recent project involves migration from Access/VBA to PHP and MySQL.

FrontPage/Dreamweaver etc to PHP

When upgrading a website it can be the ideal time to change the underlying technology. Usually it is possible to carry over large amounts of the previous website e.g. photos, smaller graphics, logos, content etc, while making the switch. One important benefit is the assurance that the website will work across the entire world wide web, not just on Microsoft browsers and operating systems. And if the website grows in complexity it is good to know that licensing costs won’t balloon prohibitively.

MS Office to OpenOffice (documents, spreadsheets, slideshows)

OpenOffice contains high-quality alternatives to the standard Microsoft products รขโ‚ฌโ€œ at no cost. OpenOffice is also highly compatible with MS Office. It is easy to open, edit, and save MS Office files e.g. a Powerpoint presentation, from within OpenOffice. OpenOffice has its own Basic-type macro language (StarBasic) which allows power users the get the most out of their office software.

Why use browser-based databases?

All a user needs on their PC (or thin client for that matter) to run a browser-based database is a password, user name, and a web browser such as Firefox, Netscape Navigator, or Internet Explorer. This makes it easy to add new users to the system, even if they work in remote locations e.g. in a satellite clinic. Furthermore, there are no installation issues to consider – any machine, be it an Apple, Windows PC, or Linux computer, will work. And upgrading the system can happen once, centrally. The nightmares associated with deploying desktop software (which version of Windows 98 are they running? Did they install SP2? Is there a conflict with an existing Access installation?) can simply be sidestepped.

A web client-server architecture allows the administration tasks to be centralised with experts – which means that backups happen, virus protection is kept up-to-date etc.

Paul Graham puts the web services concept into clear relief in The Other Road Ahead.