Personal tools
You are here: Home English

English


How to get Orange UK's "Internet Everywhere" to work on Linux Ubuntu 8.04 with Option modem

Filed Under:

Summary: Use this guide, and use "orangeinternet" as APN.

A couple of months ago I purchased an Orange Internet Everywhere subscription with an Option modem. I have been using it with Windows XP but problems have been mounting more and more with flaky connections and non-working drivers according to the Windows Browser. These problems are solved with a restart, but the problem resurfaces again within 5hours to 10 minutes of running. I believe this may be caused by a decomposing XP installation, but there is really no way to know. Since my laptop is dual boot I really would prefer to use Linux where it is easier to see and trouble shoot, not to mention reinstall. My laptop came without XP CDs, with the OS preinstalled.

Besides, my work makes it easier for me to use Linux than Windows, since the tools I use work better on Linux. When I got Internet Everywhere in late May, the guide I found for Linux was this French one. I never managed to get out on the Internet with it and gave up after a number of attempts and hours of trying.

Since the situation with my XP is getting grave, I decided yesterday to scour the Internet again and found this guide at pharscape. It uses a newer Interface to the Option modem. I followed the guide and everything worked with these cautions:.

  • Be careful to not have spaces in your directory names when doing the install. "make" will fail.
  • Use "orangeinternet" as APN in the HSOConnect preferences. "internet" did not work for me
  • Coming from CentOS I wasn't sure first on how to install the .deb packages. The syntax is "sudo dpkg -i filename.deb"

I am writing this blog post on the HSO connection :-)

I am not sure if it supports the 7.2 Mb/s speed on Linux.

Update 15:48

I think I do get good connection speeds because HSOConnect says "UMTS" in the screen shot. However I am blocked from lots of web sites by some kind of filter at Orange:

"Orange Safeguard has classified this page as only suitable for people over the age of 18. You currently have Orange Safeguard turned on. If you wish to turn this off then please call Orange customer services by dialling 150 on your Orange phone..."

Apparently Ubuntu support forum pages are not suitable for young eyes.

My guess is that the APN I have chosen is different from the one I use on Windows, because I do not get these blocks when using the service there. However it seems impossible to figure out what that APN name would be. I have called the 07973 100 150 number with Orange but all paths in their voice computer system leads to a "Sorry we cannot take your call" (or similar). Maybe their system is down. I cannot cal just "150" as the blocked page message says, for the obvious reason that I am using an Orange Internet modem, not a phone.

Update 21:07

The connection is now flaky on Linux as well. However it doesn't crash the drivers or make a hard reboot necessary, so I've got that going for me which is nice. The flakiness therefore must lie outside of the computer, either in the modem, the base station, or in temperamental coverage of central London.

 

Update 2008-08-15

The connection went back to stable again, and everything works fine. I got rid of the Safeguard block by strolling down to my local Orange shop and called from there. There seems to be a timeout on http connections, but I have solved that by tunneling those requests. I cannot for some reason connect to Google Talk, but ssh works well; Google Talk worked on XP. I wonder what the difference is...

How to format a table of contents in OpenOffice 2.1

Filed Under:

Summary: A lot of the formatting, such as tab stops cannot be done from the normal stylesheet editor. The settings you set there will be overridden. Use the context menu item edit index/table instead. The menu item is available when you right click directly at the table of contents in your document:

See below for a guide of how to use it in Open Office.

I'ven been trying to get my table of contents to look good, and previously failed. The table of contents of my document has style sheets, called "Contents 1" and "Contents 2". However changes I make there, particularly tab stops, seem to be ignored.

It turns out that there is another place to change the formatting of the table of contents and that is in the edit index/table context menu:

.

Once selected you get to a tabbed dialog where one of the the tabs shows the following:

It contains a rather weird widget that helps you format the table of contents entry for a particular level. It is a row of cells where every second cell allows for inserting verbatim text, and every second is a place holder for entry text, page number or a tab stop.:

You can only have a page number place holder once ("#"), and the same goes for entry text ("F"). You assign a placeholder to a cell by clicking at the cell so that it looks depressed, and then click at one of the below buttons:

In the above picture two of the buttons are greyed out, beacuse theses placeholders have already been assigned to cells in the row. To get the buttons back to the active state, select the cell that contains the page number or entry ("#" or "F"), and replace it with a tab entry instead by clicking at the tab button.

For each tab entry you make, you can format it by selecting its cell, and then format its position and other things:

For each text entry or page number, you can format it with a character style sheet:

In the above screenshot I have made a BigNumber character style sheet for the page number, that together with other settings makes my table of contents look like this:

Sometimes when updating the table of contents, OpenOffice.org will lose the formatting and you will need to reapply the formatting.

Why is it fashion to have smaller and smaller side windows on cars?

Filed Under:

Cars, like every other consumer item, varies in the way they look with fashion. One thing I have never understood is why new cars (not to mention concept cars) look like armoured cars with side windows whose height is probably soon closing down to few inches, just enough to observe what is going on outside and stick a barrel out.

 

Armoured car

armored car.jpg

Photo by hellochris

The new Audi

a3.jpg

Photo by Khamid

 

The fashion may actually come from somewhere else than the military or riot police, from Hot Rods:

hotrod1.jpg

Photo by BWJones

 

hotrod2.jpg

 

Photo by MyBarina

To make Hot Rods appear a bit mystical the roof is chopped and lowered. (Mystical is my interpretation).

Still this fashion in ordinary cars makes you feel like your traveling inside a tank.

 

If you get tired of the fashion of making ordinary cars' windows smaller and smaller, have solace in the fact that there is always the Fiat Multipla:

multipla.jpg

Photo py ebeth

I'd like to see a Multipla parked next to one of the new Bentleys...

If people reject religion, are they bound to reinvent it but poorly?

Filed Under:

In The Guardian, author John Gray argues against atheism in the best way I have seen so far from that "camp". But there are still places in his text where I think he misses the point. Gray's main point is basically, that when people free themselves from religion they are bound to reinvent it, but poorly. He argues for that a lot of the world's more recent woes have sprung from ideologies that have called themselves scientific. He admits that they were in fact pseudo scientific, but seems to argue that humans in general can never hope in the long run to do anything else than pseudo science from science in a religion rejecting society.

First, his argument that rejection of religion can lead to dangerous pseudo scientific beliefs I think is well founded. The communist societies that declared themselves atheist indeed had lots of religious patterns, that they seem to have been too blind to see. So he has a point there.

Secondly he seems to believe that humans cannot hope to develop into science-trusting rational beings, but that religion is needed to fill the "hole in our souls". Here he is on shaky ground indeed. Science can be seen as two things: facts and the scientific process.

  • When adhering to a religion it is very easy to discard facts that are not in tune with the religion. If the facts have been well tested (scientifically) they would do people a lot of good, since accurate information tends to lead both to a better life for that individual and a better behaviour against other people. This is true for all people, regardless of the potential size of their "hole in the soul" and indeed it does not matter that the facts came from science. The quality of information is of crucial value.
  • The scientific process is important since pseudo science can be discarded quite easily with it, since pseudo science does not follow the scientific process. Knowledge of the scientific process is therefore an insurance against it.

There is however another problem with science that Gray barely touches upon, and where I think he could find fertile ground. Science and scientific facts are often narrow in scope. What you choose to study and what problems you are formulating will therefore have a large impact. Science does not have a built in ability to balance itself in that regard. We have seen this with big pharmaceuticals only publishing the results in favour of their drug. In this way we will not know the conditions that would show something else. For more honest scientific studies the scientists will be blind to some of the assumptions that set them into a certain direction of inquiry.  For science as a whole, we do not know what implicit conditions we start with.  Gray does cover one assumption he believes atheist are blind to that hey have: The underlying assumption that society is ever improving.

One interesting part of the text is where he notes that suicide bombers happened in communist movements before islamic ones. But I see commuism as religion so that is for me not all that strange. His tracking of where the rituals actually came from is nevertheless elucidating:

But Islamists owe as much, if not more, to the far left, and it would be more accurate to describe many of them as Islamo-Leninists. Islamist techniques of terror also have a pedigree in secular revolutionary movements. The executions of hostages in Iraq are copied in exact theatrical detail from European "revolutionary tribunals" in the 1970s, such as that staged by the Red Brigades when they murdered the former Italian prime minister Aldo Moro in 1978.


Läs mer: The atheist delusion | By genre | guardian.co.uk Books

How to enable "switch user" in Gnome on CentOS 5

Filed Under:

At my work I have reasonably fast Linux workstation running CentOS 5. It also has a good 24" screen.  I prefer not to switch it off between work sessions and sometimes one of the other guys would like to run his stuff on my machine.

 

Problem is I am logged in and the screen is locked with my password. My colleague is running Ubuntu and he has a nifty "switch user" option on the menu.

Now I have figured out how to get the same functionality in CentOS 5. You need to follow these steps.

Install the Gnome configuration editor. Start "Add/Remove Software" from the "Applications" menu

MWSnap143 2008-03-12, 22_58_02.png

 

and search for "gconf".

 

MWSnap144 2008-03-12, 22_59_45.png

 

Select gconf-editor and apply.

 

Then start gconf-editor from the command line:

gconf-editor&

 

Select "Find" from the "edit" menu:

MWSnap147 2008-03-12, 23_01_54.png

Search for "user_switch" and rember to also search in keys:

MWSnap148 2008-03-12, 23_02_55.png

find the key user_switch_enabled in the top right pane and tick its value:

 MWSnap149 2008-03-12, 23_03_41.png

Close the editor (there is no save button or command).

Now select Lock Screen" from the "System" menu.

MWSnap150 2008-03-12, 23_04_21.png

The password box will now have a "Switch User" button! remember that the user you're switching to must also have his settings changed as above to get a "Switch User" button from his or her account.

  

Review of the Lenovo/IBM X60 ultralight laptop

Filed Under:

Earlier this year I purchased a Lenovo/IBM Thinkpad X60. I resold it within a few days. And here is the reason why:

I had circled a particularly good offer at the local Mediamarkt on a Thinkpad X60 for a while. On paper it seemed like a really good deal, I liked the specs, especially the form factor and the low weight. The screen did not seem to be on par with the rest of the machine, but it was hard to tell in the ghastly (or should I say ghostlike) lihghting in the Mediamarkt stores.

Eventually I bought it, but two days later I returned it, or that is, I tried to return it, but Mediamarkt refused on the grounds that I had opened the packaging and started the Computer. If I had bought it at any other chain here in Stockholm I think I could have returned it. Instead I sold it at a 20% discount on the Internet, which worked like a charm.

I really wanted to keep it, but the fact was that the screen was just of a too poor quality. Perusing the net even more after I bought it I found that the maximum screen brightness was just around 115 candela per square meter, but the real disappointment was the contrast ratio was measured to a measly 156:1. Compare that to the 500:1 you saw on LCD monitors some years ago and the 1000+:1 you see today and it is clear that this component is sub par, especially for me who is used to Sony screens. Even my stop gap laptop, the cheapest Toshiba (~$600)  I could find back in March , has a far superior screen.

If you are in the market for one of the X Thinkpads, do take time to check out the screen for a prolonged period before you decide to buy. Hopefully the X series will get a screen upgrade soon, and on some models it seems to be there: A review of the X61T tablet PC at notebookcheck.net shows the brightness of that screen to be almost exactly the same as for the X60, but the contrast is about 400:1, making it immensly better.

The other gripe I had with the X60 was the mysteriously long time it took to wake up and fall asleep, but this can probably be blamed on Vista. Lenovo will supply a downgrade CD for a fee.

 

Update 01:24

To compare the screen of the X60 with the Sony TZ series check out this review of the TZ:

 

Model Brightness: Contrast
X60 155 156:1
Sony TZ11XN 308 576:1

 

Stockholm should be on The Indepedent's World cities list

Filed Under:

...at least if Copenhagen is there, and it is. Now I may sound like a whining Swede, and, ehrm, yes that is true. Come to think of it maybe I prefer Copenhagen before Stockholm...

Such thoughts aside, there is of course a long rivalry between these two Nordic cities, being roughly equal in population, and easily the largest cities in the region.

The Independent has made a reasonably thorough ranking of World Cities, but they left out Stockholm. However since the Independent kindly explained all their criteria it is easy to fill Stockholm in.

The ranking table in Excel format may be downloaded here. I inserted Stockholm below Copenhagen for a comparison:

stats

 

The Independent has  a list of criteria and how to normalise them.

 

Population: Copied Copenhagens figure

Flights per week. Found passengers per year and factored in (through introspection) the flights from Skavsta (Ryanair) and Bromma (City Airport). Then entered same number as for CPH.

Market Capitalization World Exchanges Annual report (pdf),

Time out - Don't have access to the source. Put in a question mark.

3M stars  Don't have access to the source. Put in a question mark.

Capitals 2 points.

Forbes - Zero.

SOs i think there's two?

Olympics-  Stockholm 1912

Antal google-träffar - 95 millions, twice that of Copenhagen

Metro - Source  Wikipedia, multiplied by percentage of stations underground.

Guides - Don't have access to the source. Put in a question mark.

48 hrs -  Don't have access to the source. Put in a question mark.

Unesco - Included Birka, Skogskyrkogården and Drottningholm

 Maybe Birka and Drottningholm are too far out. Source.

As long as Stockholm scores at least 4 points in the categories wher i put in question marks, Stockholm will be ahead.

 

How to split a string on whitespace when there is quoted stuff in it

Filed Under:

When you are dealing with strings like e.g. the log lines from an apache or other web server log, it is common to find stuff that is inside quotes.

Let's say you want to split that line into its items, e.g. referrer, user agent and other stuff. Since some of that stuff is inside quotes, splitting on whitespace won't work. The trick is to first split on the quotes!

In that way you get an array/list where every odd element is guaranteed to be outside of any quotes, and any even element guaranteed to be inside a pair of quotes. Just iterate through the list: When you are at an odd item, split it on whitespace and store it, when you're on an even item store it away as it is, it's quoted.

How to embed a PloneFormGen form into a page in Plone

Filed Under:

This describes how to embed a Ploneformgen form into another page. It was was done on Plone 2.5 with PloneFormGen 1.1.3, so these tricks may not work for other versions.  If there is a simpler way of doing this, please enlighten me.

  • The first scenario is this: to embed a Ploneformgen form directly into a page template
  • The second scenario is: I have created a content type that is folderish, that simply collects all objects inside and renders them. One of these objects inside is a form folder. I wanted this to be rendered and shown inside my content type's page template.

The solution is the same to both problems.


The first problem was to make it render some HTML to be included in my page.


If you just want to embed the form directly into a template, this code is enough, you do it in one step:

<div tal:content="structure python: context.main_form_for_sending_mail.ww_pfgwrapper()"/>

The Ploneformgen object used above has the id "main_form_for_sending_mail".

Below is a simplified piece of code from the folderish content type. It simply collects all Form folders it can find inside of itself and renders them by calling a template on each of them

    def itemContents(self):
        items = self.contentValues(['FormFolder',])
        output = []
        for item in items:
            output.append(item.ww_pfgwrapper())
        return output
My folderish content type has a page template that calls itemContents:
    <div tal:repeat="item python:here.itemContents()">
<span tal:content="structure item"/>
</div>

So what is that ww_pfgwrapper thing there in the python code? It is a page template that renders the form folder object for inclusion. There is already a page template coming with PloneFormgen that renders the form. It is called fg_base_view. It renders the whole web page with plone headers and footers, and that is not suitable inside a page. There is a macro in fg_base_view, but unfortunately for some reason this macro is defined as the whole template contents, and would still give the whole plone layout.

The solution turned out to be to make a copy of fg_base_view and call it something else, in this case ww_pfgwrapper.

ww_pfgwrapper is the same as fg_base_view with five major changes (the contents of the ww_pfgwrapper template is posted at the end of this article):

  • It does not call the main macro
  • It defines a portal variable (that got undefined by not calling main macro)
  • It has none of the fill-slot stuff
  • It has tal:omit-tag="" for the html and body tags
  • It redefines the name of the edit_macro that is going to be used

Let's go through the reasons for these changes:

It does not call the main macro
Obvious. If that was called we'd get the plone layout once again embedded in the middle of a document.

It has none of the fill-slot stuff
The fill-slot attribute is also deleted, and all the stuff outside of the body element (save the html tag and the defines).

It defines a portal variable

Once the main macro is deleted there is no definition left for the portal variable. One needs to be put in:
portal python:here.portal_url.getPortalObject();

It redefines the name of the edit_macro that is going to be used

The macro responsible for setting the action attribute of the form, will set this attribute to the url + the name of the template. This does not work, even if we make ww_pfgwrapper into a .cpt file with an accompanying .metadata file, just like fg_base_view.  Go figure.

Instead we want the form to call the url + "/fg_base_view", because then it works. The template object responsible for defining the action attribute is called fg_edit_macros. That is the culprit that tacks on the template name last to the action attribute of the form. Make a copy of fg_edit_macros, call it ww_fg_edit_macros, and make a change in the ww_pfg_wrapper template near the top to use that template instead:

base_macros here/fg_edit_macros/macros;

is changed to:

base_macros here/ww_fg_edit_macros/macros;
We then make one small change in the new ww_fg_edit_macros template

tal:attributes="action python:getattr(here,'formActionOverride','') or here.absolute_url()+'/'+template.id"

is changed to:

tal:attributes="action python:getattr(here,'formActionOverride','') or here.absolute_url()+'/'+'fg_base_view'

That is, hard code "fg_base_view" in there, at the end.

After these changes the template ww_pfg_wrapper looks like this:


<tal:block
define="errors options/state/getErrors | nothing;
Iterator python:modules['Products.Archetypes'].IndexIterator;
schematas nothing;
fieldsets python:['default'];
default_fieldset string:default;
fieldset default_fieldset;
fields python:here.fgFields(request);
portal_type python:here.getPortalTypeName().lower().replace(' ', '_');
type_name here/getPortalTypeName|here/archetype_name;
base_macros here/ww_fg_edit_macros/macros;
edit_template python:'%s_edit' % portal_type;
edit_macros python:path('here/%s/macros | nothing' % edit_template);
header_macro edit_macros/header | header_macro | base_macros/header;
typedescription_macro edit_macros/typedescription | typedescription_macro | base_macros/typedescription;
body_macro edit_macros/body | body_macro | base_macros/body;
footer_macro edit_macros/footer | footer_macro | base_macros/footer;
lockable python:hasattr(here, 'wl_isLocked');
isLocked python:lockable and here.wl_isLocked();
tabindex tabindex|python:Iterator(pos=7000);
css python:here.getUniqueWidgetAttr(fields, 'helper_css');
js python:here.getUniqueWidgetAttr(fields, 'helper_js');
portal python:here.portal_url.getPortalObject();
">

<html xmlns="http://www.w3.org/1999/xhtml"
xml:lang="en"
lang="en"
xmlns:tal="http://xml.zope.org/namespaces/tal"
xmlns:metal="http://xml.zope.org/namespaces/metal"
xmlns:i18n="http://xml.zope.org/namespaces/i18n"
i18n:domain="plone" tal:omit-tag="">





<body tal:omit-tag="">
<br/>
<br/>
<b tal:content="here/Title" class="documentFirstHeading">
Title or id
</b>:

<p tal:replace="structure here/getFormPrologue | nothing" />
<metal:use_body use-macro="body_macro" />
<metal:use_footer use-macro="footer_macro" />
<p tal:replace="structure here/getFormEpilogue | nothing" />



</body>

</html>

</tal:block>

And now it works. The form folder can reside inside your folderish object, but it can also be at e.g. the Plone root, and be called by acquisition:

output.append(self.main_form_for_sending_mail.ww_pfgwrapper())

In this way, one can have one central form to embed in all, or some pages. And with acquisition it is of course possible to have different form for different parts of the site by placing Form folders by the same name (id) in different places.




What to do when your external monitor pans around what should be its native resolution (ATI)

Filed Under:

On my Toshiba Laptop, I had a weird problem this morning. My usual external monitor, a very bright Sony 1280 x 1024 LCD, did display at 1024 x 768 or so, but allowed me to pan around to see the entire 1280 x 1024 desktop. How to get it right? I apparently have an ATI Radeon Xpress 200M card in it.  I tried to change the resolution, but all in vain, the display settings already reported the 1280 x 1024 resolution.

The trick turned out to be to right click on the desktop, select  Properties->Settings->Advanced, and go to this tab:




Uncheck the "Preserve wide aspect ratio.." box (which was checked) and then click "Apply" You need to click "Apply" or you cannot make any changes to the monitor at the left.

Once you'ce clicked apply you can click at the "Monitor" text.


In the dialog that pops up, adjust the maximum resolution to in  my case 1280 x 1024. It seems this setting applies to what you might call the physical size of your display, while the standard resoltion controls applies to a virtual size. As I am doing screen captures now, I notice that the settings is now 2560 x 1024 !


I did not set that, go figure... Anyways, tweaking the settings here got my display finally back to normal.

hello

This site conforms to the following standards: