Archives 2005 - 2019

Ny attack: Använd separat webbläsare för dina bankärenden!

published Jan 16, 2009 02:12   by admin ( last modified Jan 16, 2009 02:12 )

Eftersom javascript kan öppna en url, så kan ett javascript från någon sajt kolla om den kan ladda en bild från en annan sajt, t ex från en banks "säkra" webbsidor. Om javascriptet kan ladda bilden, ja då är du inloggad på den sajten. På så sätt kan koden veta att du är inloggad på en specifik bank, och kan lägga upp en loginruta, som påstår att du är utloggad och måste logga in igen.

Jag har inte provat detta hack, men det borde fungera för alla sajter som har kända url:er som är skyddade med lösenord. Så det borde fungera på alla möjliga lösenordsskyddade tjänster, speciellt de som skyddar per directory.

 

Vad är lösningen? Jag skulle hävda att man bör göra bankärenden i en separat webbläsare med bara ett webbläsarfönster öppet, och med tajt säkerhet inställd. Använd t ex Portable Firefox, som kan leva i ett eget  bibliotek på hårddisken.

 

Kanske man som webbutvecklare  måste skydda sig genom att randomisera url:er i framtiden. Hmmm, många användare kräver nästan DHTML+javascript idag, för att det ger ett mer kraftfullt användargränssnitt, så det kan nog bli svårt att bara slå av javascript eller ens delar av dess funktioner.

The malware exploits weaknesses in the browser that lets the attacker "see" the banking site URL where the victim is logged in, and then the phisher automatically generates a popup posing as that bank. If the user falls for the popup lure and enters his banking credentials, the phisher then gets those credentials



Läs mer: New Phishing Attack Targets Online Banking Sessions With Phony Popups - DarkReading

 

It's explained in a few comments above. You just reference a resource (usually an image) that requires you to be logged in at the target site in order to access. If your attempt fails, the user isn't logged in at that site. If it succeeds, you know the user is currently logged in.



Läs mer: Slashdot | Phishing For Bank Info Without Any Pesky Malware

 


Checklista minskade dödstalet till hälften vid operationer

published Jan 15, 2009 12:04   by admin ( last modified Jan 15, 2009 12:04 )

Som jag skrivit om tidigare, så verkar det vara en god idé att ha en checklista vid akutvård och operationer, och att en person har hand om denna checklista. Man har nu gjort en storskalig studie på flera kontinenter, och det verkar stämma. Dödstalen halverades i snitt.

Låter som något som borde införas i svensk sjukvård.

In this week's New England Journal of Medicine, researchers reported on how well the checklist worked on more than 7,500 surgical patients in eight hospitals, in Toronto, Seattle, London, New Delhi, Auckland, Manila, Amman in Jordan, and Ifakara in Tanzania. The rate of death was 1.5 per cent before the checklist was introduced, and dropped to 0.8 per cent afterward, Dr. Atul Gawande of Harvard Medical School in Boston and his co-authors reported. In-patient complications also dropped from 11 per cent to seven per cent.


Läs mer: Surgery deaths drop dramatically with checklist: study


Marketcetera - Open Source plattform för värdepappershandel

published Jan 15, 2009 06:11   by admin ( last modified Jan 15, 2009 06:11 )

Ett riskkapitalbackat företag i Kalifornien (såklart) har utvecklat en javabaserad plattform för att handla med värdepapper. Det här kan bli roligt. Plattformen kan använda Ruby som scriptspråk.

 

Det här kan leda till en explosion av lösningar och idéer tor jag. Jag gick till deras sajt, men jag kunde inte ladda ner något.

Linux and open source software are a key component in the underlying infrastructure of the finance industry, but the higher layers of the stack are still dominated by a multitude of proprietary, in-house solutions. A software startup called Marketcetera aims to change that with a new, open source platform for building automated trading systems.



Läs mer: Open source trading platform could be a win for Wall Street


Notes on screen casts from Windows to flash, edited and processed on Linux/Windows, and getting it on the web with e.g. Plone

published Jan 14, 2009 12:42   by admin ( last modified Jan 14, 2009 12:42 )

Here are some notes on my experiments with screen casts. I have just started experimenting with it so these notes are here mostly for my own use. All software I use is free. There are probably better ways to some of these things, please inform me if you know. I will cover:

  • How to set up your browser for a screen cast
  • What software to use in Windows to make a complete screen cast in flash format
  • How to edit out portions of that screen cast on Windows
  • How to convert the screen casts to a Flash swf file, ready for inclusion in a web page

  • How to use mencoder to convert to flv in those cases it is too long/awkward for CamStudio swf producer
  • How to convert the video from CamStudio's avi so that it can be edited with Cinelerrra on Linux
  • What Plone products can be used to display the screen casts, swf and flv formats respectively, on a web page

 

What is a screen cast?

The term screen cast as used in this post, is a video showing a piece of the computer screen, with a voice over.

How to set up your browser for a screen cast on Windows

Use a separate browser from the one you usually use. The idea behind this, is so that you do not get distracting text suggestions in forms, when you do your screen cast. You e.g. do not want Firefox to suggest "I think I am pregnant" right in the middle of a screen cast, just because you wrote that in a subject line in an e-mail four days ago in a form field by the same name as the form you are now demoing on screen. I use the portable Firefox. It can live in a folder without getting "installed" into windows, and so becomes a Firefox separate in its settings from your system Firefox. Disable form autocomplete and all other such things in it.

How to do a screen cast on Windows

I use Camstudio. It is free and open source.

It can:

  • Capture what you are doing on screen and save it to an avi file
  • It can simultaneously record your voice and save it to the same avi file

In this way you can make a screen cast in the avi file format.

 

How to edit out portions of the screen cast on Windows

I used the free and open source program Virtualdub. Virtualdub allows you to set markers in the video and cut out the portion in between. When saving the avi file from Virtualdub, it becomes huge. I believe this is because it makes all frames into key frames, but I am not sure. Incidentally, all subsequent instructions in this post operate on an avi file that has been through Virtualdub after Camstudio. (I don't know if that matters.)

 

How to convert the screen cast to a Flash swf file, ready for inclusion in a web page

After you have created the avi screen cast with CamStudio, you can use the accompanying program Camstudio swf Producer to make an swf file, complete with a player and an example html page. Neat!

 

How to publish swf in Plone

I used ATFlashMovie 1.0.2 on a Plone 3 site, to publish the swf file. For flv format, see further down.

 

How to use mencoder to get the avi file from Camstudio/Virtualdub into Flash flv file

I made a long screen cast that Camstudio swf Producer wanted to break up into smaller parts. It did not succeed in this. It may be because I edited it in between with Virtualdub. I then resorted to mencoder on Linux. Mencoder is a part of MPlayer, and is also available on Windows. On this page I found an incantation that worked in getting my avi file from CamStudio/VirtualDub into a Flash flv file:

mencoder screencast.avi -lavfopts i_certify_that_my_video_stream_does_not_use_b_frames -of lavf
-ovc lavc -oac pcm -lavcopts vcodec=flv:vbitrate=500:mbd=2:mv0:trell:v4mv:cbp:last_pred=3 -o screencast.flv

The above command gave a file containg a 10 minute screencats with PCM sound, weighing in at 114 MB.

The following command (found here):

 mencoder screencast.avi -forceidx -of lavf -oac mp3lame  -lameopts abr:br=56 -srate 22050 -ovc lavc 
-lavfopts i_certify_that_my_video_stream_does_not_use_b_frame -lavcopts
vcodec=flv:vbitrate=250:mbd=2:mv0:trell:v4mv:cbp:last_pred=3 -o screencast.flv

...gave a file weighing in at 16MB. The quality is noticeably worse. From what I can tell, sound has been encoded as mp3 with a low bitrate (56 Kb/s), and the bitrate of the video has been cut in half. Subjectively I find the sound to be too bad, but the video OK, but a bit on the grainy side. Future adjustment would be to get a higher (or variable) bit rate for the sound. I have not deployed this later more compressed version of the file, but I assume it works with flash.

If you want to find out what codecs mencoder supports on your system, type:

mencoder -ovc help

and

mencoder -oac help

for video and audio codecs respectively.

 

How to publish the flv movie in Plone

I then used the Plone product FlashVideo 0.8.2 on a Plone 3 site, to directly publish the flv file.

FlashVideo will automatically wrap the flv file in a player. But it wants you to manually specify the height and width of the video in pixels. FlashVideo will automatically extract information on the height and width of the video (I failed to note this capability first, verified 2010-01-04). You also need to make an image the size of the movie. I used Gimp and took a screenshot and resized it to the desired dimensions.

How to convert the video from CamStudio's avi so that it can be edited with Cinelerrra on Linux, using ffmpeg

Cinelerra is what seems to be a capable video editor for Linux systems (actually all X systems according to their pages). Cinelerra likes to work on Quicktime movies. The avi file can be converted to Quicktime movie that Cinelerra can read with the following incantation:

ffmpeg -i screencast.avi -acodec mpeg4aac screencast.mov

 
ffmpeg is a converter that is meant to be easy to use. If you want to find out what codecs ffpmeg supports on your system, type:

ffmpeg -formats

Finally

I am looking into how to crop movies after they have been made. With crop, I mean removing a region of the video, throughout the movie. It seems both cinelerra and ffmpeg can do this.

ffmpeg has commands like cropbottom, cropleft etcetera.


Länk - Bygger fotosyntes på kvanteffekter?

published Jan 14, 2009 03:45   by admin ( last modified Jan 14, 2009 03:45 )
Then came the revelation: Instead of haphazardly moving from one connective channel to the next, as might be seen in classical physics, energy traveled in several directions at the same time. The researchers theorized that only when the energy had reached the end of the series of connections could an efficient pathway retroactively be found. At that point, the quantum process collapsed, and the electrons’ energy followed that single, most effective path. Electrons moving through a leaf or a green sulfur bacterial bloom are effectively performing a quantum “random walk”—a sort of primitive quantum computation—to seek out the optimum transmission route for the solar energy they carry. “We have shown that this quantum random-walk stuff really exists,” Fleming says. “Have we absolutely demonstrated that it improves the efficiency? Not yet. But that’s our conjecture. And a lot of people agree with it.”



Läs mer: Is Quantum Mechanics Controlling Your Thoughts? | Subatomic Particles | DISCOVER Magazine


Sanning betyder olika saker för författare och vanligt folk

published Jan 13, 2009 05:21   by admin ( last modified Jan 13, 2009 05:21 )

Med det masskommunikationssamhälle vi haft, där få kommunicerqar till många, är det lätt att komma undan med psykologisk sanning. Men med Internet vrids hela kommunikationen i samhället mot fakta, och det är det som nu biter Liza Marklund i svansen.

I Expressen kan man se olika författare uttala sig om Liza Marklunds fadäs, att ge ut en bok på vilken det står "En sann historia", men som nu inte tycks vara det. Jan Guillou säger t ex:

Nej, hennes böcker har presenterats som romaner. De har sålts som romaner. Vad författaren då avser är inte en journalistisk sanning och så har det varit i decennier. Men den kunskap som finns i förlagsvärlden är tydligen inte självklar för allmänheten.

Notera citatet "Men den kunskap som finns i förlagsvärlden är tydligen inte självklar för allmänheten."

En författare som kan hitta på historier är ju produktivare än en som inte gör det, och det är förmodligen lättare att hanka sig fram som sådan om man låter fantasin flöda fritt. Men nu kan allt faktakollas, och miljoner människor, som inte hade en röst förut, har nu det.

 

De flesta "vanliga människor" har en uppfattning om vad det ska innebära när någon påstår att det som skrivs är sant. Och det är att det är faktamässigt sant, inte att det är psykologiskt sant. Guillou kanske tror att det mer relativa sättet att se på sanning inte nått ut till menigheten från förlagsvärlden, men det blir nog alldeles tvärtom.

 

Fast man ska inte bunta ihop alla författare i heller så klart. men det är ändå så att ju bättre fantasi desto lättare är det at vara en (framgångsrik) sådan.



Läs mer: Kollegornas dom | Nyheter | Aftonbladet


Europa exporterar mässling till andra länder

published Jan 11, 2009 10:28   by admin ( last modified Jan 11, 2009 10:28 )

I Latinamerika utrotades mässling 2002, tack vare massiv vaccinering. De fall som dyker upp nu är importerade från Europa. I en del länder i Europa så är det så många föräldrar som inte vill ha sina barn vaccinerade, att sjukdomen sprids.

In contrast, Latin America eliminated measles in 2002, but has since suffered outbreaks "imported" from Europe. While measles rarely kills in Europe, in poorer countries malnutrition and limited healthcare make the virus far more lethal



Läs mer: Europe 'exporting' measles to poor countries - health - 10 January 2009 - New Scientist


Länk - Människor har en genetisk variation motsvarande en befolkning på tio tusen

published Jan 11, 2009 10:04   by admin ( last modified Jan 11, 2009 10:04 )
The first people to point out that humans were short of genetic variation were John Maynard Smith and John Haigh, in 1974. They looked at the allelic variation of the beta globin gene and determined that it was consistent with a population of only 10,000 individuals. Since there are more than 10,000 people now, they needed some other explanation.



Läs mer: Cultural impedance, demographic growth, effective population size | john hawks weblog


"Ökning i autism beror på faktorer i miljön"

published Jan 10, 2009 12:57   by admin ( last modified Jan 10, 2009 12:57 )

En stor undersökning i Kalifornien i USA visar att ökningen av konstaterade fall av autism, inte enbart kan förklaras med att man blivit duktigare och känsligare vad gäller att upptäcka autism. Eftersom gener inte ändrar sig så fort, återstår bara ändringar i miljö, vilket kan delas upp i två faktorer:

  • Kemiska ämnen
  • Nya infektioner

Dessa påverkar moderlivet och också det växande barnet så klart.

Jag funderar:

Det finns många kemiska ämnen som vi använder som ger neurologiska och immunologiska effekter. Det vore därför intressant att göra en kvantitativ studie för att se om användning av vissa kemiska ämnen har ökat samtidigt eller med viss förskjutning, jämfört med autism

Eftersom vi använder mycket substanser med antibiotika i kan det också vara så att vissa typer av infektioner tagit överhanden och ger skador. Man vet sedan gammalt att ökat antal infektioner i Röda Hund ger mer autism.

The California researchers concluded that doctors are diagnosing autism at a younger age because of increased awareness. But that change is responsible for only about a 24 percent increase in children reported to be autistic by the age "A shift toward younger age at diagnosis was clear but not huge," the report says. Also, a shift in doctors diagnosing milder cases explains another 56 percent increase. And changes in state reporting of the disorder could account for around a 120 percent increase. Combined, Hertz-Picciotto said those factors "don't get us close" to the 600 to 700 percent increase in diagnosed cases.



Läs mer: New Study: Autism Linked to Environment: Scientific American


Så kan man köra två Firefoxprofiler samtidigt

published Jan 10, 2009 01:10   by admin ( last modified Jan 10, 2009 01:10 )

Starta Firefox med switchen "-P", så kan man välja eller skapa ny profil.

Anyways, FireFox complains that you an instance is already running if you try to run firefox on each screen. To get around the problem, start firefox with -P, which runs the profile selector.



Läs mer: Ubuntu — Running Two Firefox Intances on Dual Screen (Seprate X Screen — not LargeDesktop or TwinView) « The Great Magnet. What a fool I was to defy him.


Varför håller man på med biobränslen när det finns solceller?

published Jan 09, 2009 11:49   by admin ( last modified Jan 09, 2009 11:49 )

De senaste månaderna har jag sett rapporter om olika framsteg vad gäller att använda alger som producerar diesel, och vad gäller effektiviteten som solceller har när det gäller att omvandla ljus till electricitet.

 

Av vad jag minns så är verkningsgraden för fotoceller mycket högre när det gäller att konvertera ljus till användbar energi, än den för biobränslen. Och jag ser på Wikipedia att detta stämmer: Fotoceller är minst dubbelt så bra, möjligtvis upp 40 gånger bättre! Båda sätten att utvinna energi använder ju solen.

Dessutom är det ju så att solceller ger elektricitet ut, vilket är en energiform som är mer användbar direkt än t ex diesel. Elektricitet är svårare att lagra, men det går. Man får då hitta på nåt som att pumpa vatten baklänges i ett vattenkraftverk, lagra den kemiskt eller elektrolys eller något, och på så sätt lagra den i en annan energiform.

The photosynthetic efficiency is the fraction of light energy converted into other forms of energy for use. Trees convert light in to chemical energy through the process of photosynthesis with a photosynthetic efficiency of approximately 0.2-0.5%. Other numbers reported range up to 6%, a more detailed analysis is required. By comparison solar panels convert light into electric energy at a photosynthetic efficiency of approximately 10-20%. The photosynthetic efficiency varies with the frequency of the light being converted.



Läs mer: Photosynthetic efficiency - Wikipedia, the free encyclopedia


Plone login portlet and the personal bar could be the same thing

published Jan 09, 2009 05:07   by admin ( last modified Jan 09, 2009 05:07 )

The info in the login portlet and in the personal bar should probably be combined. This would increase the perceived stability (Apple UI design principle) of the Plone user interface.

During some pair programming with Robin today for Betahaus I noticed that in the new design for a site, Rasmus and Robin had chosen to move the login portlet to a viewlet. This viewlet is also used for the info in the personal bar in Plone (personal bar has stuff like logout, link to member folder, etcetera).

This makes a lot of sense. The login form is only displayed when you are not logged in, and the info in the personal bar only when you are logged in. With this design, the same screen real estate could be used for both of them, since only one is visible at any given time. Conceptually, they also fit very well together.

Instead of a viewlet, this could of course also be done with the existing login portlet. In their present incarnations in Plone, the login portlet and the personal bar have different form factors on screen. Robin and Rasmus show info from the personal bar with a thumbnail of the logged in member, and also some dashboard-like links that gives the member access to recent stuff relevant to him since last login. The resulting form factor becomes identical to the login form's, so they can easily alternate in the same screen space.

 


Länk - Vi är inte stenåldersmänniskor

published Jan 08, 2009 11:35   by admin ( last modified Jan 08, 2009 11:35 )
Well, the assumption that humans stopped changing in the Pleistocene was always obviously false. You won't find many people who will admit to making that assumption, but there it is anyway, strewn through their works. It made a useful assumption for some people, in that they could examine so-called universals instead of more messy variations. But those variations are proving to be the most interesting frontier of behavioral science. Some of them have been under strong selection, perhaps showing the adaptive reactions of minds to new social and cultural systems of the Holocene.



Läs mer: Recent evolution in Newsweek | john hawks weblog


Länk - Mood boards - for getting the right mood of your design

published Jan 06, 2009 09:40   by admin ( last modified Jan 06, 2009 09:40 )
The template takes a more streamlined approach, dropping the handmade elements but keeping the blue and brown color scheme. The color palette, patterns, type treatments and photo usage are all more explicit.



Läs mer: Why Mood Boards Matter | Webdesigner Depot - Photoshop Tutorials, Wordpress, Icons, WP Themes


Länk - "Just enough Operating System"

published Jan 06, 2009 09:40   by admin ( last modified Jan 06, 2009 09:40 )
"Just Enough Operating System" (JeOS)



Läs mer: Virtual appliances made easy with rBuilder


Länk - YUI grids - färdiggjorda översiktliga layouter med CSS

published Jan 06, 2009 09:39   by admin ( last modified Jan 06, 2009 09:39 )
The foundational YUI Grids CSS offers four preset page widths, six preset templates, and the ability to stack and nest subdivided regions of two, three, or four columns. The 4kb file provides over 1000 page layout combinations. Other features include:



Läs mer: Yahoo! UI Library: Grids CSS


Länk - Möjligt att återskapa hjärna

published Jan 06, 2009 09:34   by admin ( last modified Jan 06, 2009 09:34 )
Contrary to popular belief, recent studies have found that there are probably ways to regenerate brain matter



Läs mer: Regenerate Your Brain? -The Science Says It's Possible


EU måste gå in i Mellanöstern

published Jan 06, 2009 06:27   by admin ( last modified Jan 06, 2009 06:27 )

Det är mycket nu, som det brukar sägas på TV ibland. Iran har genom Hamas och Hezbollah lyckats projicera sin makt ända bort till Medelhavet och risken är att vi får se ett "muslimskt" inbördeskrig mellan Shia och Sunni.

Världsekonomin går ner och detta drabbar instabila länder hårdast. En del av dessa som Pakistan, har kärnvapen, och Indien anklagar nu Pakistan för att ha legat bakom terrordåden i Bombay. Om ett krig utbryter mellan Pakistan och Indien kommer miljoner att dö fort om kärnvapen kommer till användning.

En anledning att Iran och Syrien kan utöva sådant inflytande i Mellanöstern är att andra länder i regionen är ineffektiva, både på krig och på att skapa en framtid för sina egna befolkningar. Under dessa omständigheter väljer en hel del människor livsstilar som är destruktiva. En hel del människor tilltalas då  av en krigar- och offermentalitet, och Iran har varit duktiga på att stödja dem i detta.

Man ska inte tro att den livsstil vi har i liberala demokratier alltid kommer så naturligt till människan: I filmen "The Baader Meinhof Complex" kan man se tysk medelklass som väljer ett kamp- och förstörelseliv trots utmärkta möjligheter att leva ett bekvämt borgerligt liv.

Dock ökar chanserna betydligt för en människa att välja en produktiv livsstil om hon stöds av demokrati, frihandel och starka institutioner. Med dessa fundament så brukar hetsporrarna bli få till antalet och kunna hållas i schack.

I stora delar av Mellanöstern och i Pakistan finns en hopplöshet om att kunna skapa sig ett bra borgerligt liv. Det bästa hopp de har är EU.

Vi ska dock inte tro att t ex Pakistan skulle kunna bli medlem, men Turkiet borde in fortast möjligt. Med Turkiet som brohuvud kan trovärdiga samarbets- och handelsavtal slutas med länder i Mellanöstern, på ett sådant sätt att hoppet om ett borgerligt liv kan vara starkt och trovärdigt nog att försvaga hetsporrarna till en punkt där de inte längre kan påverka samhällsutvecklingen.

Turkiet måste därför in i EU så snabbt som möjligt och de samarbetsavtal som  förbereds mellan EU och Nordafrika och mellan EU och länder i öst måste också inkorporera Mellanöstern, inklusive Israel.

Européer har en tendens att tro att de lever i en slags bubbla av välstånd och frid, så snart världskrigen dragit förbi. Men faktum är att om vi inte för en aktiv utrikespolitik och ser om vårt hus så står vårt enda hopp som vanligt till att USA räddar oss, och det kan komma en tidpunkt när det inte fungerar.


Bister artikel i Economist om darwinism, feminism, socialism, status och kriminalitet

published Jan 03, 2009 12:24   by admin ( last modified Jan 03, 2009 12:24 )

I The Economist finns det en artikel om hur det naturliga urvalet kan användas som förklaring för:

  • Kriminalitet
  • Att kvinnor tjänar mindre än män
  • Att ett samhälle inte blir lyckligare av att bli rikare, och att de relativt fattiga har dålig hälsa
  • Att det finns rasism

 

I artikeln menar man att många av de saker vi tror går att ändra eller bota, i själva verket är uppkomna och skapade av det naturliga urvalet. I samtliga fall försöker man hitta rationella förklaringar, grundade på tesen att reproduktion är det viktigaste kriteriet för framgång. 

  • Vad gäller kriminalitet så menar man att detta kan vara en "rationell" respons hos unga män som tror sig inte kunna få reproducera,
  • vad gäller kvinnors löner så menar man att kvinnor över sin mest reproduktiva ålder inte behöver bevisa sitt genetiska värde med en hög lön och därför inte söker detta.
  • Vad gäller rikedom och lycka/hälsa menar man att det beror på den stress som låg social status ger, då den försämrar reproduktionsmöjligheterna
  • Vad gäller rasism att människan historiskt diskrimerat mellan "vi" och "dom" (men artikeln noterar att ras kan ersättas med något annat)

 

Jag tror att den här typen av resonemang kommer att få kraftigt genomslag i det allmänna medvetandet, och det potentiellt kan leda till stor oro.

A classic example is income. Women earn less than men. Or do they? In fact, younger women do not, or not much. A recent report by the Institute of Economic Affairs (IEA), a British think-tank, found that British women aged between 22 and 29 who were in full-time employment earned only 1% less than their male counterparts. This age group corresponds for many women to the period when they are single. Once they have found the best available mate, the calculation changes: a woman no longer needs to show of



Läs mer: Darwinian answers to social questions | Why we are, as we are | The Economist


How to get your windows back when your Linux screen goes black

published Jan 02, 2009 07:33   by admin ( last modified Jan 02, 2009 07:33 )

Summary: Ctl-Alt-F1, followed by Ctl-Alt-F7 works for me

One of my Linux machines, a Toshiba L30 laptop running Ubuntu 8.04, has problems with the X window display system when running an external monitor. Sometimes the external monitor goes all black, and sometimes both the laptop screen and the external monitor go black. In the later case, I can see the cursor flitting around in a jerky way on the laptop screen when I move the mouse. Everything else is gone.

My guess is that there is something fishy in the dual monitor setup, and that possibly some memory positions are written to that should not be written to. It's been some years since I tried to tweak the X settings on a linux computer and I do not feel like trying again, because it is a job that is a real time sink.

A simple remedy I have found is to go into one of the command line consoles, by holding down Control, Alt and the F1 keys,  release them and then go back to X by holding Control, Alt and F7. I do not know why this works, but it does.

Another option is to hold down Ctl, Alt and backspace, but this reboots X, and you have to restart your applications. The method described above gets me everything back as it was.