Archives 2005 - 2019

Djungel av javascript på DN.se - laddade inte på flera minuter

published Nov 15, 2009 01:00   by admin ( last modified Nov 15, 2009 01:00 )

DN.se: framsida består som många webbsidor idag av html såklart, samt en oländig terräng av extern javascript som refererar till andra sajter. Om något av dessa externa script inte laddas som det ska, eller om de resurser det skriptet i sin tur försöker ladda in inte svarar, så kan det hända att hela sidan helt enkelt inte laddar alls i webbläsaren. Det var vad som hände idag, då sajten de17a.com inte laddade, och man blev stående med en helt vit webbsida istället för dn.se i flera minuter.

Det korrekta sättet att hantera sådant här är att ha timeouts på inladdningar, antingen på klientisidan eller genom att DN och andra sajter som gör så här, gör alla sådana här abrovinker på serversidan innan sidan skickas ut, och applicerar sina egna timeouts där. Eller varför inte göra om hela systemet?

Läs mer: DN.se - Nyheter - DN.se


The best screenshot tool for Linux

published Nov 14, 2009 11:03   by admin ( last modified Nov 14, 2009 11:03 )

 

Summary: I finally found one on Linux that met my needs: It is called Shutter

 

Update info 2009-11-21:

Switching recommendations from Imagemagick to Shutter, due to Imagemagick's inability to take screen shots of programs such as Firefox and OpenOffice.

What is the best screenshot tool for Linux of course depends on your particular needs.

My basic needs are the following:

  • Take only a portion of the screen that I define when taking the shot
  • One click operation
  • Save as a unique file name automatically so I never lose shots. Great for quickly making a series of shots for documentation.

And as an extra:

  • Automatically upload to my blog and prime the Clipboard with html to paste, alternatively open a page in a gallery where I can copy and paste the picture URL.

On Windows I use MWSnap, which fits the basic needs except for the one click operation. However it does remember the region-or-window setting and atomatically saves the file under a unique file name.

On Linux, the obvious choices did not meet my specifications: KSnapshot is a five-click operation or so, and so is "Take Screenshot (gnome-panel-screenshot)" in Gnome, and Gimp. The setting for region/window/screen selection is not sticky( except for Gimp), and you have to manually supply a file name for all them.

Today I finally found one on Linux that met my needs, Shutter. The trick is to make a customized application launcher for it with the switch "--selection". In this way Shutter starts and immediately hides itself and shows crosshairs for selecting the part of the visible screen you want to take a screen shot from. It can be configured to automatically save the screenshots in a folder of your choice, under a file name with your choice of date, time and other info embedded in the file name.

It can also automatically upload the resulting image to an ftp server.

There is an Imagemagick solution that came close to satisfying my needs, and below is the text I wrote before I realized it cannot handle Firefox and Openoffice, at least not on my stock Ubuntu 9.10.

The Imagemagick solution is the one click solution near the end of this page: How to Take a Screenshot in Linux (Ubuntu) |
It is actually a shell script that captures a region of the screen, automatically saves it and with a slight modification, opens the image in a viewer (or any program of your choice).

After the last line of the shell script that you can find from the link above:

import $file;

add:

eog $file;

The author has written one more page on the subject using Gnome Screenshot instead of ImageMagick, in order to easily get delayed shots:

The shell script for taking one-click screenshots is below. Copy and paste it into your favorite text editor and save it somewhere in your home directory as screenshot-import.sh. Then run the following command on it in the terminal to make it executable: chmod +x screenshot-import.sh.

How to Take a Screenshot in Linux (GNOME) Revisited | Webmaster Tips

That solution can however not be scripted to only capture a part of the screen.


Vän av ordning: Koldioxid brukar inte räknas som en lokal förorening

published Nov 13, 2009 01:22   by admin ( last modified Nov 13, 2009 01:22 )

... och ventilation minskar definitivt inte den utsläppta mängden koldioxid. Koldioxid är inte skadlig eller irriterande som gas, utan kan vara ett hot globalt som växthusgas.

Det har helt enkelt blivit lite fel i en krönika i Sydsvenskan om konsekvenser av att bygga ner en motorväg i en tunnel:

En stor del av den koldioxid som förorenar Lundaluften kommer redan från trafiken på motorvägen. Teknik för ventilation när bilarna kör i betongtunnlar borde inte förvärra situationen.

...fast det är intressant att krönikören garderar sig total med frasen "borde inte förvärra situationen".  Nej det är väl iofs sant, om man bortser från CO2 under byggandet i alla fall.

Läs mer: En sannsaga i pusslet om Lunds framtid? - Lund - Sydsvenskan - Nyheter dygnet runt


Move gobs of small files quickly with ssh and "|" in one go

published Nov 10, 2009 11:29   by admin ( last modified Nov 10, 2009 11:29 )

If you need to copy a lot of files to another computer in Linux, you can use scp with the "r" and "C" flags.

"r" makes it copy recursively and "C" makes it compress the files before sending them, which saves a bit of bandwidth. However the overhead of using scp for copying many small files is huge, at least an order of magnitude (10 times), maybe two, bigger on my machine transporting a couple of thousand of files. One solution is to use tar and first create a tarball, and then copy  that over.

However sometimes you may not have space on the source device to make a tarball. In that case you can tar it "on the fly" and pipe it to not scp, but ssh. It turns out that you can supply commands to ssh already on login:

tar zcf - SOURCEDIR | ssh user1@remotehost "cat > /DESTDIR/DESTFILE.tar.gz"

If you are not already authorized with keys on the remote host, it will prompt you with a password.

I pretty much stole the command above from:
Lâmôlabs » Pushing & Pulling Files Around Using tar, ssh, scp, & rsync

I just omitted the "v" flag, since even though you can still supply your password, the prompt gets buried in verbose output with the "v" flag.

 

And if you do not want a tar ball as the end result on the remote computer, you can unpack it on the fly:

localhost% tar zcf - SOURCEDIR | ssh user1@remotehost tar zxvf -

Again taken from the Lâmôlabs page, again omitting the "v" flag.


Länk - Rekonditionering av lungor mellan första och andra ägaren

published Nov 10, 2009 11:18   by admin ( last modified Nov 10, 2009 11:18 )

 

For the first time, scientists in the McEwen Centre for Regenerative Medicine, University Health Network have successfully used gene therapy to repair injured human donor lungs, making them potentially suitable for transplantation into patients



Läs mer: Gene therapy repairs injured human donor lungs for the first time


Länk - Airports in Europe ranked by passenger traffic

published Nov 09, 2009 01:37   by admin ( last modified Nov 09, 2009 01:37 )

 

After all the positive feedback we got from producing our European Airport Traffic Trends database for 2008 you can now download the 2009 version, with even more airports. Every week we update the database of 300 airports with data that has become available during the week. See how individual airports are faring in 2009 by downloading the latest European Airport Traffic Trends spreadsheet:

http://www.anna.aero/wp-content/uploads/european-airports-2009.xls

Läs mer: European Airport Traffic Trends | anna.aero


Här kan du köpa starka energisparlampor i E14-sockel

published Nov 07, 2009 02:19   by admin ( last modified Nov 07, 2009 02:19 )

Ibland vill man ha starkt ljus från en lampa som har en eller flera E14-socklar att sätta lamporna i. Problemet är att de  lysrörslampor som det är lite tryck i, 10 W eller mer,  alltid i princip har den stora E27-sockeln. Men det finns åtminstone två butiker i Stockholm varav den ena är en varuhuskedja, som säljer 11W och 12 W lysrörslampor med E14-sockel. Den ena är Elfa (i Solna och i Kungens Kurva) där jag för något år sedan införskaffade 2st 12W E14-lampor som alltsedan dess monterade i badrumsskåpet lyser upp mitt badrum, och den andra är Hornbach i Fittja, som fick släppa till tre stycken 11W E14 till en Ikea-lampa i förra månaden. Mitt intryck är att lamporna är av god kvalitet.


Getting hard disks up to DMA speed on Proliant ML110/CentOS Linux

published Oct 27, 2009 10:15   by admin ( last modified Oct 27, 2009 10:15 )

 

Summary: Editing the menu.lst file in the grub directory of the /boot directory to include "ide0=noprobe ide1=noprobe" as parameters for my default boot option worked for me. Your mileage may vary of course

 

A machine that I use as a home server, a HP Proliant ML110 G5, has taken very long to copy large files. A 5GB file seemed to take about 3 hours. This is of course wholly unreasonable. Something must be wrong, but where? I suspected it wasn't using DMA mode, which is a quicker mode of data transfer. Googling around I found that the hdparm should be able to check DMA mode and set it if not enabled. Well hdparm reported it was not set and furthermore that it could not be set. A hint that something was wrong was also that the drives where identified as /dev/hd*, not /dev/sd*. So further googling revealed it could be a BIOS setting. I looked into BIOS but everything was OK there. Eventually I found this page that says that the correct kernel driver may not be loaded, and instead a generic very conservative driver is loaded:

Google suggests booting with ide0=noprobe ide1=noprobe to make sure the ata-piix driver is used. If you don't want to reinstall then make sure initrd contains the ata-piix driver and that references to /dev/hd* are replaced with /dev/sd* in fstab etc.

Read more: [CentOS] Re: DMA mode

 

So the question is: Do I have the ata-piix driver on my system? It is probably not a good idea to disable something and not having the thing you want to have enabled, installed. It turns out the file you should be looking for on the file system (at least on  my CentOS) is called "ata_piix", not "ata-piix".

I edited the menu.lst file in the grub directory of the /boot directory to include "ide0=noprobe ide1=noprobe" as parameters (You may want to make a new boot option for this so you can easily go back). I then rebooted and edited fstab to mount the new /dev/sd* devices after checking in /dev what they were, and rebooted again.

Before and after

Before the performance according to hdparm was like this:

/dev/hda:
 Timing cached reads:   5052 MB in  2.00 seconds = 2526.92 MB/sec
 Timing buffered disk reads:   10 MB in  3.71 seconds =   2.69 MB/sec
[root@firefly ~]# hdparm -tT /dev/hdc

/dev/hdc:
Timing cached reads:   4920 MB in  2.00 seconds = 2460.83 MB/sec
 Timing buffered disk reads:   10 MB in  3.71 seconds =   2.70 MB/sec
[root@firefly ~]# hdparm -d1 /dev/hdc

 

And now it is like this:

 

[root@firefly ~]# hdparm -tT /dev/sda
/dev/sda:
 Timing cached reads:   4948 MB in  2.00 seconds = 2475.64 MB/sec
 Timing buffered disk reads:  180 MB in  3.02 seconds =  59.53 MB/sec
[root@firefly ~]# hdparm -tT /dev/sdb
/dev/sdb:
 Timing cached reads:   4840 MB in  2.00 seconds = 2421.36 MB/sec
 Timing buffered disk reads:  286 MB in  3.02 seconds =  94.67 MB/sec

 

So a neat improvement on buffered disk reads of factor 35 or 3500% on my second disk, and an improvement of factor 22 or 2200% on the slightly older drive. Copying the 5GB file now seemed to take around 2 minutes, which is an even bigger difference in speed.

 

Here is some background information on SATA in Linux and drivers.


Länk - SheevaPlug - en nätverksdator för 1000:- som drar typ 4W

published Oct 26, 2009 12:14   by admin ( last modified Oct 26, 2009 12:14 )

 

The SheevaPlug is a development platform, targeted for use as a plug computer, and designed to run network-based software services. It features a Kirkwood Series processor with an embedded Marvell Sheeva 1.2 GHz CPU equipped with 512 MB of FLASH and 512 MB of DRAM. Connection to the home network is via Gigabit Ethernet, offers desktop class performance, and can be used to replace a PC-based home server for many applications. Peripherals connect using the included USB 2.0 port.



Läs mer: New IT - Product


Levande virusvaccin effektivare på barn, avdödat på vuxna

published Oct 18, 2009 04:02   by admin ( last modified Oct 18, 2009 04:02 )

Enligt nedanstående sida på amerikanska smittskyddsinstitutet (CDC), så verkar ett försvagat virus vara ett effektivare vaccin på barn än avdödat virus. Det ger en starkare immunrespons och en bredare immunitet. På vuxna är det tvärtom. En spekulation är att ett omoget immunförsvar lär sig bättre av ett levande virus, medan ett moget dödar det nnan inlärningseffekten hinner kicka in.

Both TIV and LAIV have been demonstrated to be effective in children and adults. However, data directly comparing the efficacy or effectiveness of these two types of influenza vaccines are limited and insufficient to identify whether one vaccine might offer a clear advantage over the other in certain settings or populations. Studies comparing the efficacy of TIV to that of LAIV have been conducted in a variety of settings and populations using several different outcomes.



Läs mer: CDC - Comparisons of LAIV and TAIV Efficacy


Byggvaruhus som har sitt sortiment på nätet

published Oct 16, 2009 01:35   by admin ( last modified Oct 16, 2009 01:35 )

Innan man åker iväg till ett byggvaruhus ås vill man kanske kolla vad de har och vad det kostar. Två byggavuhuskedjor som har sitt sortiment on-line är K-Rauta och Beijer bygg. Två som inte har det är Bauhaus och Hornbach.


Kul teori: Framtiden försöker hindra oss att bygga Large Hadron Collider

published Oct 14, 2009 01:51   by admin ( last modified Oct 14, 2009 01:51 )

En dansk och en japansk fysiker spekulerar att det är Framtiden som reser tillbaka till oss för att hindra att LHC byggs, och på så sätt rädda framtiden.

Ett annat perspektiv på samma sak framförs i diskussion på Slashdot: Nämligen att alla scenarier där LHC har byggts och körts har lett till total destruktion. Om man man tänker sig att universum i varje ögonblick mångfaldigar sig själv till alla utfallsrum så lever vi i ett som ständigt undviker att LHC blir körduglig.

Motargumenten blir ju att vi inte har några bevis på denna multiverseteori, och att man skulle kunna säga detta om vad som helst som inte lyckas, samt att det är rätt normalt att svåra saker misslyckas. Men det är ju en rolig teori, hänger lite grand ihop med den där om varför fysikens lagar balanseras i vårt universum - för att annars skulle det ju inte fungera!

Läs mer: Essay - The Collider, the Particle and a Theory About Fate - NYTimes.com


Videosketch - "The front fell off"

published Oct 14, 2009 01:06   by admin ( last modified Oct 14, 2009 01:06 )

 

Front Fell Off



Läs mer: YouTube - Front Fell Off


Undrar vad .se:s DNS-fel kostat i Sverige?

published Oct 13, 2009 01:09   by admin ( last modified Oct 13, 2009 01:09 )

Under senkvällen har det varit svårt att komma in på svenska sajter, fortfarande (01:00) kan jag t ex inte komma in på dustin.se eller ticketbox.se. Båda sajterna lever ju på online-handel så där måste en rejäl förlust ha gjorts, och om man sedan räknar in alla andra sajter som slutar på .se och som varit svåråtkomliga så blir det nog en rund summa. Men man får väl se det från den ljusa sidan, det är ju inte som när sidekickanvändarna (en smartphone) på T-Mobiles nät i USA fick reda på att alla deras data är raderad. Permanent. Ingen backup. Det kördes på Micosoft Danger-plattformen (som egentligen inte är så microsoftig utan inköpt). Man men tycker kanske att namnet Danger var lite väl välfunnet givet utvecklingen.

Och när jag nu ska pinga in denna bloggpost till Twingly så kommer jag inte åt twingly.se!

– Det måste ha kommit igenom en bugg i vårt system som ledde till att vi skickade ut felaktig information. Vi såg det på en gång, säger Danny Aerts, vd för .SE, till TT sent på måndagskvällen. Han säger att felet inträffade vid 22-tiden. Och det ledde direkt till stora svårigheter att komma in på webbsidor där adressen slutar med .se.



Läs mer: Stora internetproblem för Sverige - DN.se

 

 

Well, this is shaping up to be one of the biggest disasters in the history of cloud computing, and certainly the largest blow to Danger and the Sidekick platform: T-Mobile's now reporting that personal data stored on Sidekicks has "almost certainly has been lost as a result of a server failure at Microsoft/Danger."



Läs mer: T-Mobile: we probably lost all your Sidekick data

 

Av okänd anledning lades det till ett extra.se i slutet på webbadresserna. - Vi vet inte hur det här kunde inträffa, men det ska vi utreda, säger Danny Aerts.



Läs mer: Stora internetproblem för Sverige | Inrikes | SvD

 

 


Den vetenskapliga journalen för oklar forskning

published Oct 10, 2009 12:32   by admin ( last modified Oct 10, 2009 12:32 )

Vad gör man om man har forskning som visar ett icke signifikant statistiskt resultat? Man kan ju tro att sådan forskning inte är nyttig, men det är den om andra kan se den. En oklar korrelation är ju lika mycket information det. Så det finns tydligen tidskrift som heter the Journal of Articles in Support of the Null Hypothesis:

Welcome to the Journal of Articles in Support of the Null Hypothesis. In the past other journals and reviewers have exhibited a bias against articles that did not reject the null hypothesis. We seek to change that by offering an outlet for experiments that do not reach the traditional significance levels (p < .05). Thus, reducing the file drawer problem, and reducing the bias in psychological literature.



Läs mer: Journal of Articles in Support of the Null Hypothesis


Retrovirus samvarierar med kroniskt trötthetssyndrom

published Oct 10, 2009 11:46   by admin ( last modified Oct 10, 2009 11:46 )

Antikroppar mot ett retrovirus har hittats i en stor majoritet av en undersökt grupp där alla lider av kronisk trötthet. Viruset är inte så vanligt bland "vanliga" människor. Jag misstänker att en hel del saker som vi idag inte vet orsaken till kommer att visa sig vara orsakat av infektioner. Mer studier och detekteringstekniker behövs.

However, other researchers emphasised that the numbers published so far are too small to conclude anything about the cause of chronic fatigue syndrome. "It's spectacular but needs replication. And I hope that no one is thinking of prescribing anti-retrovirals on the basis of this," said Simon Wessely, professor of psychological medicine at King's College London. "It's very preliminary and there no evidence to say this is relevant to the vast majority of people in the UK with the condition."



Läs mer: Has science found the cause of ME? - Science, News - The Independent


APN för 3:s (Tre.se) kontankort är net.tre.se

published Sep 29, 2009 09:09   by admin ( last modified Sep 29, 2009 09:09 )

I alla fall funkar det för mig. "data.tre.se" funkar inte. På tre.se:s sidor hittar jaag bara "bredband.tre.se" och "data.tre.se".

Credit till:

Dom APN:er jag känner till för TRE är net.tre.se - Kontant korten bredband.tre.se - Vanliga bestal abonnemang data.tre.se - Tro är den gamla APN , förekom på tidig utrustning från tre. vip.tre.se - Skall tydligen vara företags abodemang.
Läs mer: ACER One / linpus E220 / Mobilt bredband / Tre APN


Bygg en effektiv bokscanner med 2 kameror och en v-vagga

published Sep 27, 2009 11:43   by admin ( last modified Sep 27, 2009 11:43 )

 

I've built two of these things now, and this instructable covers the best parts of both of them. You can build a book scanner using only hand tools plus a drill. I realized that not everyone is comfortable with using all the different hand tools you might need to make it. So I scanned a book on using hand tools that should answer all your questions. ;)



Läs mer: DIY High-Speed Book Scanner from Trash and Cheap Cameras


Lightpeak - ersätter nätverk, firewire, HDMI och USB-kontakter

published Sep 27, 2009 08:34   by admin ( last modified Sep 27, 2009 08:34 )

Intel och Apple har kokat ihop en ny kontakt med optisk överföring, som ska klara av att ersätta HDMI och många andra kontakter. Det slog mig när jag läste om den att de då bör göra kontakterna lite olika så att man pluggar rätt typ av data (Video, nätverk etcetera) i rätt kontakt. Men så slog det ju mig igen att det är ju just det man inte vill. Istället ska vilken kontakt som helst kunna pluggas i vilken kontakt som helst, och sedan får mjukvaran lista ut vad det är som finns i sladden, och routa det inne i datorn. Smart!

Intel's upcoming, optical interconnect technology that boasts data transfer rates of up to 10 Gbps. While some have speculated that Light Peak will directly compete with USB 3.0, Engadget has now unearthed information that indicates



Läs mer: Slashdot Apple Story | Apple Behind Intel's USB Competitor?


How to change default application for a file type in Gnome

published Sep 27, 2009 08:09   by admin ( last modified Sep 27, 2009 08:09 )

Find a file with the file suffix that you want to be opened by the application. Right click on the file, select "Properties", and on the "Open with" tab click the radio button in fron of the desired application.

The reason I did not find this option at first, is that the "properties" context menu are properties of the individual file (or should be at least), and not of the file type, meconsiders.


hi im using gnome and when i try to change my default application for like mp3's or anything by using **right click file > properties > open with tab > and select applicatio


Läs mer: Cant change default application /'open with' in gnome - Ubuntu Forums