Archives 2005 - 2019    Search

Länk - Getting some debug info out of Varnish

published Nov 17, 2011 08:20   by admin ( last modified Nov 17, 2011 08:20 )


Make a custom http header to hold the debug info:

sub vcl_fetch { set obj.http.X-Cookie-Debug = "Request cookie: " req.http.Cookie; ... }



Läs mer: Varnish, caching and HTTP cookies | Open Source Hacker


How to run no-ip's update client in non-daemon mode

published Nov 17, 2011 07:10   by admin ( last modified Nov 17, 2011 07:10 )

Summary: Supply the -i flag with 0 as an argument. The client will update the DNS info with the automatically discovered IP number, and return.

 

No-ip has an update client for Linux that when run detaches itself from the terminal. It comes with a couple of shell scripts to install it as a daemon, none for Ubuntu however and the Debian one is described in the Readme file such:

"There is a startup script for Debian called debian.noip2.sh. It also has been supplied by another user and is rumored to fail in some situations."

So, I would prefer the update client to be controlled by cron. There is a mode for running the update client and have it immediately return after having done its update. In this mode, you need to supply the -i switch and supply it with an IP number, according to the readme. That kind of defeats the purpose of it finding the IP automatically for you.

However if you read the C source code of the update client you see this:

if (*IPaddress == 0) {
if (nat)
get_our_visible_IPaddr(IPaddress);

...which means that if you supply 0 as the IP address it will look up the address for you.

The readme file also states:

"If you are behind a firewall, you will need to allow port 8245 (TCP) through
in both directions."

This does not seem to be the case. It works fine in my tests behind a firewall, both from the command line and when used with cron, no ports opened for it.

 

 


Ranka länders potential som förmåga att göra komplexa varor

published Nov 09, 2011 11:51   by admin ( last modified Nov 09, 2011 11:51 )

Harvard och MIT har släppt en rapport där de mäter ett lands potential genom att se hur komplexa varor dte kan leverera. Om bara ett fåtal länder kan leverera en vara så tyder det på att den är svår att göra (undantaget råvaror som bara finns på vissa ställen). Japan är den solklara ledaren här, följt av Tyskland, Schweiz och Sverige(!).

Gamla Östeuropa (rättare sagt Centraleuropa), gör också bra ifrån sig.

Creative Commons License The Atlas of Economic Complexity: Mapping Paths to Prosperity by Hausmann, Hidalgo et al. is licensed under a Creative Commons Attribution-NonCommercial-NoDerivs 3.0 Unported License.



Läs mer: The Atlas of Economic Complexity

 

 

Hittat via:

I came across something called the Atlas of Economic Complexity. It’s an attempt to measure the ”productive knowledge” of each country using network analysis techniques on the flows of trade – a bit like Google analyses internet links to rank websites. From the Atlas



Läs mer: Economic Complexity « Hotel Ivory


How to find out what version of Ubuntu or Debian you are running

published Nov 09, 2011 06:13   by admin ( last modified Nov 09, 2011 06:13 )

On these two distributions of Linux, you can type:

cat /etc/issue

On Ubuntu, but not Debian, you can also type:

cat /etc/lsb-release

...and you will get more verbose version information.

Tested on Ubuntu 10.10 and Debian 4 and 5 (apparently :-)

I have recently installed ubuntu 11.04. My friend just asked me what beta I am using. How can I find out?

How can I know what version of ubuntu I'm running? - Ask Ubuntu - Stack Exchange

 


There is something called pyffmpeg

published Nov 09, 2011 02:29   by admin ( last modified Nov 09, 2011 02:29 )

I haven't tried it, but might be good for next time I do not want to remember ffmpeg's command line switches.


PyFFmpeg provides a simple object oriented interface to those libraries. PyFFmpeg is a wrapper around FFmpeg's libavcodec, libavformat and libavutil libraries whose main purpose is to provide access to individual frames of video files of various formats and codecs (such as mpg, mp4, mov, avi, flv, mkv, wmf, and webm). It also provides access to audio data.


Läs mer: pyffmpeg - Python FFmpeg wrapper - Google Project Hosting


A guide to Haskell that actually works

published Nov 04, 2011 09:15   by admin ( last modified Nov 04, 2011 09:15 )

...for me, that is. I have only gone a couple of pages in it but I think I would now understand Haskell code.

Hey yo! This is Learn You a Haskell, the funkiest way to learn Haskell, which is the best functional programming language around. You may have heard of it.



Läs mer: Learn You a Haskell for Great Good!


Länk - Language detection from python

published Oct 27, 2011 02:30   by admin ( last modified Jul 21, 2013 11:19 )

Update: It is now on pypi:

https://pypi.python.org/pypi/chromium_compact_language_detector

It turns out the CLD part of the Chromium source tree is nicely standalone, so I pulled it out into a new separate Google code project, making it possible to use CLD directly from any C++ code. I also added basic initial Python binding (one method!), and ported the small C++ unit test (verifying detection of known strings for 64 different languages) to Python (it passes!).



Läs mer: Changing Bits: Language detection with Google's Compact Language Detector


Länk - Buildout building on Debian

published Oct 26, 2011 11:21   by admin ( last modified Oct 26, 2011 11:21 )

Note to self: Not sure exactly what this is, but sounded like it could be important, if libraries are in places a recipe does not expect them to be.

Use this to get easy_install to build eggs with extension modules that need to find libaries on multi-arch systems like Ubuntu and Debian



Läs mer: Making easy_install play nicely with multi-arch — Ross Patterson


Technology for doing Plone on-line training

published Oct 20, 2011 09:04   by admin ( last modified Oct 20, 2011 09:04 )

Summary: Skype, VNC and VirtualBox in combination works really well.

I recently got a request for and did Plone online training (plug: there will be a Plone course in London in December), and it gave me the opportunity to try out a technology stack that I had had in mind for this purpose for some time. It turned out to be a complete success.

By using two VNC screen sharing servers there was good visual communication. Secondly, by using a VirtualBox instance for the course participant's work, there were no snags in setting up and running Plone, and the course participant could download the virtual machine image afterwards, with a complete buildout/subversion combo.

 

Setup

First, you need voice communication. There are many technologies you can use including the plain old telephone. In this case we used Skype. It worked fine with good sound quality without hogging to much bandwidth.

Secondly, set up two screens, one controlled by the teacher and one controlled by the course participant. Both screens are displayed on both computers. The teacher screen is basically a replacement for the projector screen in a classroom environment. The course participant's screen is where he will do all work, and the teacher can pop in and see what's happening and give help.

 

Achieve total awareness with two VNC servers and a VirtualBox

We used tightvnc, which has the option to have one view password and one full control password. So, on my workstation I set up a tightvnc server called the "teacher server". This screen will be controlled by the teacher and viewed by the course participant. The screen resolution should be set to something that fits on the participant's computer's screen. We used 1024x768.

The course participant's VNC server was set up in a slightly more complicated way. When teaching Plone in a classroom setting, it can be a bit complicated to get the buildouts to run on all kinds of different platforms that the course participants are bringing: Windows in different versions and OS X. Linux usually just works.

If you are teaching remotely, as you do with on-line training, you do not want to troubleshoot the course participant's computer: It would be close to impossible. Instead, I created a virtual Linux running under VirtualBox on my machine, and configured that machine with all libraries and stuff needed to develop in Plone. Then I set up a tightvnc server inside of that VirtualBox, and gave the password to the course participant. This means that the course participant is effectively working on my computer, which machine I have no problems troubleshooting of course, if need be. The course participant controls that screen and I open a view only VNC viewer to it and can see exactly how work progresses and the participant can show stuff.

This means that the physical computer that the course participant is using, just needs to be able to run a VNC client (viewer). After the course, the course participant simply downloads the VDI file (hard disk) of the VirtualBox he's been using, and that will give him the whole development environment plus all his work. I used Ubuntu 10.10 for the VirtualBox, with Gnome installed. Make sure the course participant's download the VNC and VirtualBox software from trusted sources, since there are quite some shenaningans going on on the Internet.

Caveats and snags

There was actually not much trouble, except for things that are totally avoidable that simply had to do with how I happened to set up the virtual computer. I was short of time so I used a ready made Ubuntu 10.10 VDI image for VirtualBox, and that one turned out to be in Italian. It took a couple of minutes to change it

Secondly there was something funky with the virtual storage. It reported that the disk was full, when there was 1.5GB left according to the df command. That was solved by uninstalling OpenOffice to make some free space.

These things were rectified before the course started I should add.

Thirdly, VNC makes Ubuntu assign "d" to minimize all windows instead of "meta-d". I have written about that and how to solve it here.

Fourthly, when the course participants should download their vdi VirtualBox images, be careful with compression, since many do not have adequate programs for uncompressing, or may have trouble using them.

Some weeks ago I tried to help a friend install a Ubuntu vdi image that had been compressed into the .7z format. He used a Mac that he had just got from work, and he had never used a Mac before. After about one hour's phone conversation and unreliable screen sharing over Skype with installing software, dragging, dropping and guessing, it all ended in confusion. If possible, provide the vdi images uncompressed.

Future improvements

One thing that is a bit hard with just having view access to a screen is that you cannot point at different parts of the screen. Sometimes it is easier to say "click there" and point, than saying "click the rightmost button at the bottom of the left pane". Or actually it is quite easy to say it, but not that easy to parse it for the course participant if he or she is in the middle of a difficult task.

I wonder if there exists a VNC client/server combination which would allow a view-only mode where you can point at stuff with an extra pointer that does not interfere with the work?

Furthermore the virtual machine image can be slimmed down to a server + just enough GUI for web browsers and a decent GUI text editor. One might even not need Gnome or KDE and instead go with something more lightweight such as XFCE.  Still, even a non-GUI Ubuntu server install from scratch, which I have done in Virtualbox for other tasks before, is quite hefty, weighing in at about 800MB if i remember correctly.

If one wants more security against eavesdropping one can use noVNC (see guide here) as an intermediate server in which case the connection over the Internet can optionally be encrypted. noVNC also has the added benefit of only requring Google Chrome or Chromium on the course participant's computer, requiring no installation of a VNC client.

 


Länk - Interesting site on refactoring and patterns

published Oct 19, 2011 01:15   by admin ( last modified Oct 19, 2011 01:15 )

 

is the best information source on the Web on such software development topics as design patterns, refactoring and UML.



Läs mer: Design Patterns and Refactoring


Beware of downloading free software from other places than the source

published Oct 18, 2011 04:13   by admin ( last modified Oct 18, 2011 04:13 )

I asked a customer to install VirtualBox on his computer, and unfortunately he downloaded it from one of these free download sites, instead of from virtualbox.org. Nowadays many of these free download sites wrap the downloads in adware, and maybe also spyware, viruses and scamware. And this is exactly what happened to my customer who now will need to clean out his computer, if that is enough.

So, when asking someone to download a piece of the software, also specify the exact location where they should download it from.


Upgrade an Android phone's memory card with Linux

published Oct 11, 2011 03:59   by admin ( last modified Oct 11, 2011 03:59 )

This guide shows you how to change the memory card in your Android smart phone from an existing memory card that it has, to a new and presumably bigger one that you have bought, while keeping all data intact.

To follow this guide you need a Linux computer and you will need a card reader, either built in to your computer or a separate card reader connected to the computer with a USB cable. I used a separate card reader. I used this guide How to change memory card on an Android-phone, as a starting point. Read on for instructions.

Ok, here we go:

Switch off your phone. Open it and take out the old memory card. We are going to make a copy of the memory card and store on the computer.

Put the old memory card into the reader and connect the USB reader to your Linux computer.

Type dmesg to find out what the memory card and reader got registered as. dmesg helps you see what has happened recently on your computer.

Towards the end the dmesg command should output that it detected the card reader and the memory card in the reader. On my computer it looked like this, where I have boldfaced the important info:

[81490.560044] usb 2-3: new high speed USB device using ehci_hcd and address 3
[81490.891778] Initializing USB Mass Storage driver...
[81490.891910] scsi6 : usb-storage 2-3:1.0
[81490.892307] usbcore: registered new interface driver usb-storage
[81490.892309] USB Mass Storage support registered.
[81491.905633] scsi 6:0:0:0: Direct-Access Kingston FCR-HS219/1 9745 PQ: 0 ANSI: 0
[81492.062070] scsi 6:0:0:1: Direct-Access Kingston FCR-HS219/1 9745 PQ: 0 ANSI: 0
[81492.063305] scsi 6:0:0:2: Direct-Access Kingston FCR-HS219/1 9745 PQ: 0 ANSI: 0
[81492.064426] scsi 6:0:0:3: Direct-Access Kingston FCR-HS219/1 9745 PQ: 0 ANSI: 0
[81492.064841] sd 6:0:0:0: Attached scsi generic sg2 type 0
[81492.064980] sd 6:0:0:1: Attached scsi generic sg3 type 0
[81492.065114] sd 6:0:0:2: Attached scsi generic sg4 type 0
[81492.065256] sd 6:0:0:3: Attached scsi generic sg5 type 0
[81492.108160] sd 6:0:0:0: [sdb] Attached SCSI removable disk
[81492.113897] sd 6:0:0:1: [sdc] Attached SCSI removable disk
[81492.116937] sd 6:0:0:2: [sdd] Attached SCSI removable disk
[81492.118378] sd 6:0:0:3: [sde] 3862528 512-byte logical blocks: (1.97 GB/1.84 GiB)
[81492.119505] sd 6:0:0:3: [sde] Write Protect is off
[81492.119509] sd 6:0:0:3: [sde] Mode Sense: 03 00 00 00
[81492.119512] sd 6:0:0:3: [sde] Assuming drive cache: write through
[81492.124881] sd 6:0:0:3: [sde] Assuming drive cache: write through
[81492.124890] sde: sde1
[81492.140247] sd 6:0:0:3: [sde] Assuming drive cache: write through
[81492.140252] sd 6:0:0:3: [sde] Attached SCSI removable disk

So it seems that the memory card is reachable under /dev/sde then in  my case. The sdb,sdc, and sdd messages are spurious in this context; no drives get attached at those addresses.

On your computer the name for the memory card may come out different than sde: It could be "sdc", "sdd" or "mmcblk0" for example. Just addd "/dev/" in front to make "/dev/sdc", "/dev/sdd" or "/dev/mmcblk0" in that case, and use that name for the duration of this guide, instead of "/dev/sde".

Time to backup the entire card with whatever partitions are on it, to the computer.

Make a directory on your hard disk where you can store an image of your old memory card. Change "your_user_name" below to your user name on the computer.

mkdir /home/your_user_name/phonecard-backup

You may need to be root ar at least do sudo for all commands below

Image the entire card to a file there

sudo dd bs=200M if=/dev/sde of=/home/your_user_name/phonecard-backup/sde.dd conv=notrunc,noerror

Eject old card from the card reader and put in the new card, switching "if" and "of" in the above command so the image travels back to the card:

 

sudo dd bs=200M of=/dev/sde if=/home/your_user_name/phonecard-backup/sde.dd conv=notrunc,noerror

You now have a fuctioning new memory card, Unfortunately no bigger than the old one because dd has made an exact copy of the old card.

Time to stretch the new card to its full size: Start parted. The commands you should type are bolded and highlighted in red below.

sudo parted
GNU Parted 2.3
Using /dev/sda
Welcome to GNU Parted! Type 'help' to view a list of commands.
(parted) print devices
/dev/sda (250GB)
/dev/sde (15.9GB)
/dev/mmcblk0 (7948MB)

Here note the full size of /dev/sde, in my case 15.9GB, Continue:


(parted) select /dev/sde
Using /dev/sde
(parted) print
Model: Kingston FCR-HS219/1 (scsi)
Disk /dev/sde: 15.9GB
Sector size (logical/physical): 512B/512B
Partition Table: msdos

Number Start End Size Type File system Flags
1 69.1kB 1976MB 1976MB primary fat16

Above we can see that dd has made the new card just as small as the old one, which makes sense since dd did a byte by byte copy. The old card only had one partition, that is why "print" only lists one partition on my new card, partition number 1. Time to make that partition bigger:



(parted) resize
WARNING: you are attempting to use parted to operate on (resize) a file
system.
parted's file system manipulation code is not as robust as what you'll
find in
dedicated, file-system-specific packages like e2fsprogs. We recommend
you use parted only to manipulate partition tables, whenever possible.
Support for performing most operations on most types of file systems
will be removed in an upcoming release.
Partition number? 1
Error: Partition /dev/sde1 is being used. You must unmount it before
you modify it with Parted.

Error! Ah, Linux mounted the card when it was inserted. And parted can't resize a mounted volume. Open another terminal window or tab on your computer, and type:

sudo umount /dev/sde1

Switch back to the terminal with parted. As end size use the size you noted before for the new card:

(parted) resize                                                          
WARNING: you are attempting to use parted to operate on (resize) a file
system.
parted's file system manipulation code is not as robust as what you'll
find in
dedicated, file-system-specific packages like e2fsprogs. We recommend
you use parted only to manipulate partition tables, whenever possible.
Support for performing most operations on most types of file systems
will be removed in an upcoming release.
Partition number? 1
Start? [69.1kB]?
End? [1976MB]? 15.9GB
Warning: The file system can only be resized to this size by converting
to FAT32. If you convert to FAT32, and MS Windows is installed on this
partition, then you
must re-install the MS Windows boot loader. If you want to do this,
you should consult the Parted manual (or your distribution's manual).
Also, converting to
FAT32 will make the file system unreadable by MS DOS, MS Windows 95a,
and MS Windows NT.
OK/Cancel? OK

(parted) quit

 

 And that should be it. Insert the new memory card into your Android smart phone and boot it up.


1890-1950-2010: Medicin mot resten

published Oct 10, 2011 08:20   by admin ( last modified Oct 10, 2011 08:20 )

En tänkvärd bloggpost på The Economist påpekar att en person från 1890 skulle vara väldigt disorienterad i vardagslivet 1950, medan en person från 1950 skulle känna igen sig 2010 utan problem. Så har mycket mindre hänt mellan 1950 och 2010 än mellan 1890 och 1950?

 

I stora delar av vardagslivet kan jag tänka mej, japp, mycket är samma: Bilar flygplan, telefoner, tåg, el i väggen. Men The Economist pekar på ett stort undantag: Sjukvård. En person från 1890 skulle känna igen sig i sjukvården 1950. Men en person från 1950 skulle inte känna igen sig lika lätt 2010. Man tar upp blodbanker, ryggmärgsbedövning, antibiotika, laboratorietest, organtransplantationer med mera.

The situation with health care is almost the reverse of that with most other consumer technology. While someone from 1890 would have found a hospital in 1950 pretty much familiar, with a bunch of tweaks and upgrades, someone from 1950 would find a hospital today unrecognisable and startlingly futuristic. From widespread use of blood banks and antibiotics to defibrillators, epidural anaesthesia during delivery, heart surgery and angioplasty, laboratory diagnosis of viruses and bacterial infections, tumor biopsies and chemotherapy, and of course organ transplants, MRIs, and so forth, most of what we expect to see when we go to a hospital these days was developed in the second half of the 20th century



Läs mer: The great stagnation thesis: Medicine, the final frontier? | The Economist

 


Test av barfotaskor inte mycket till test

published Oct 10, 2011 04:59   by admin ( last modified Oct 10, 2011 04:59 )

På temat "Ge mej tillbaka mina fem minuter " kan jag bara upplysa dem som inte redan sett videon, att SvD:s test av barfotaskor inte är ett test utan bara en video med en man som visar ett halvdussin skor, utan att testa dem eller ge några omdömen.

WEBB-TV: Vi testar barfotaskor



Läs mer: WEBB-TV: Vi testar barfotaskor | Spring | SvD


Ett alternativt sätt att sluta dricka

published Oct 07, 2011 12:31   by admin ( last modified Oct 07, 2011 12:31 )

Kan alkoholister sluta dricka genom att läsa en bok som får dem att helt enkelt inte vilja dricka mer, och vara nöjda med det? Allen Carr menar det, och en hel del som läst hans bok håller med:

I am not entirely sure why or how this works. I am entirely more unsure of why you don't hear about Allen Carr's method more often. I am a bit blown away. A few chapters thru this book and I just stopped. Just like that. I have an entire fridge full of Sam Adams and a few bottles of wine, too. No more wine tasting - nothing. BIZARRE.



Läs mer: Amazon.com: Customer Reviews: The Easy Way to Stop Drinking


Steve Jobs betydelse för mig

published Oct 06, 2011 02:43   by admin ( last modified Oct 06, 2011 02:43 )

Det är väldigt svårt för mig att avgöra hur mycket Steve Jobs betytt för mig, eftersom det som hjälpt mig mycket är Apple, och inte Jobs direkt. Men han startade Apple och när han kom tillbaka dit efter några års bortovaro från Apple så gick det bättre igen, så det är uppenbart att han var en viktig del.

Så jag får ta perspektivet vad Apple har betytt för mig, och det är väldigt, väldigt mycket. Utan Apple hade jag överhuvudtaget inte sysslat med datorer. Det var när jag satt med en Macintosh SE med skärm i A3-storlek 1987, som jag först förstod vad datorer verkligen kunde göra. Tidigare upplevelser av system som CP/M och MS-DOS var inte i närheten.

Jag förblev Apple trogen i många år och undervisade i flera år i användargränssnittsdesign, ofta med stöd av böcker från Apple ("Hypercard Stack Design Guidelines" från 1987 står sig fortfarande för en del webbdesign fast den kom ut fyra år innan webben fanns). Jag skrev ett hypertext-författarverktyg i HyperCard som jag släppte på info-mac hyperarchive root 1990, i samband med min fil kand. Det sålde i ett exemplar. Jag var faktiskt också anställd som HyperCard-programmerare under något år i början av 90-talet. HyperCard är den största inspirationskällan till Wikis, enligt skaparen av Wikikonceptet, Ward Cunningham. Om detta kan man läsa på - Wikipedia :-)

Apple var för mig essensen och toppen av IT. Många människor avfärdade Apple som "Design", "Snyggt men inget innehåll" osv. Men om de hade läst Apple User Interface Design Guidelines, så hade de noterat att Apples verk inte handlade om yta eller design, utan om djup och synen på människan: Människan som kreativ varelse (jag har skrivit här på bloggen om det tidigare).

Jag slutade vara Apple trogen någon gång mot slutet på 90-talet då jag behövde Windows för användargränssnittskurserna, och senare har det blivit Linux. Men den smartphone jag har som visserligen är en Android, hade aldrig funnits utan Apple, och aldrig utan Steve Jobs. Och jag misstänker och antar att Hypercard, och Apple User Interface Design Guidelines och den Mac SE med storskärm jag använde aldrig heller hade funnits utan Jobs. Mitt liv hade tagit en helt annan vändning utan Steve Jobs. Han banade i mycket den vägen jag vandrat. Vila i frid.

 

 

Teknikjätten Apple meddelade natten till torsdagen svensk tid att grundaren Steve Jobs har avlidit. Jobs avgick som vd i augusti i år efter flera års kamp mot sin cancersjukdom.



Läs mer: Steve Jobs död | Näringsliv | SvD

 

 

 


Länk - xclip hacks

published Oct 05, 2011 03:07   by admin ( last modified Oct 05, 2011 03:07 )

Just a bookmark for me so that i remember it later. xclip allows the command line to access the X clipboard. This particular hack seems to extend its functionality and versatility a bit.

Sometimes you just want to copy something from your terminal and paste it somewhere else. You might have heard of a Linux program called xclip



Läs mer: A better way to use xclip (clipboard from the command line) | Made by Nathan


Locating a file by date on your Linux machine

published Oct 03, 2011 12:12   by admin ( last modified Oct 03, 2011 12:12 )

Summary

To find an AVI file that was last modified 31st of July 2010:

locate -0 *.AVI|xargs -0 stat -c "%y%n"|grep 2010-07-31

A friend just popped up in a chat window and asked if I still had a video from his birthday that I gave him on a memory stick that he had since mislaid.

I asked when the event was and he said 31st of July 2010, over a year ago.

Well, the video was gone from the camera's memory card but it might me on my 1.5 TB hard disk, but where, and what would it be called? Now I could use find to go through the entire hard disk and use its flags for creation and modification date, but that might be a bit slow. The locate command however is super fast since it has a premade index, but alas only searches for file names.

Luckily the number of video files, specifically those suffixed with .AVI from the camera, are a small subset of the files on the disk. So if I could just filter those out and then run stat to get some file info I could thereafter run grep with the date string. Running this:

locate *.AVI|xargs stat -c "%y%n"|grep 2010-07-31

...did not work since stat started stat'ing fragments of path names, so a couple of -0 switches were needed to make file names NULL terminated:

locate -0 *.AVI|xargs -0 stat -c "%y%n"|grep 2010-07-31
It returned one hit, the file I was looking for :-)

Att köpa glasögon, recept, linser, bågar - Internet eller butik?

published Sep 28, 2011 07:55   by admin ( last modified Nov 09, 2012 11:46 )
  • Vad man kan tänka på och hur man ska köpa
  • Om glasögonbågar
  • Tips om starka glas, högbrytande glas och progressiva glas
  • Ytbehandling
  • Länk till räknare för att räkna ut tjockleken på glas
  • Länk till räknare för att omvandla ett glasögonrecept till ett kontaktlinsrecept

Val av bågar

En optiker tipsade mig om att glasögonens bredd ska vara lika med käkens bredd, och det verkade stämma både på mina nuvarande glasögon och de nya.

Trenden är också mot att glasögon ska synas. Detta är nog eftersom man om man ville vara diskret med sin synkorrigering, hellre nog väljer kontaktlinser eller laserbehandling.

Däremot är det bra även i glasögon om dina ögon syns. Blanka bågar, ljusa bågar och bågar i färger som inte passar med dina ögon konkurrerar med dina ögon. Mörkare bågar, matta bågar, färger som accentuerar dina ögon, antireflexbehandling och asfäriska linser gör det däremot lättare för andra att se dina ögon.

Nu går modet mot stora glasögon. Min uppfattning är att vissa passar bara i stora eller smala glasögon.

Den här killen har en kraftig käke och kan därför bära upp ett par stora glasögon. Notera dock att bågfärgen tillsammans med glasblänk gör att man inte kan uppfatta hans ögonfärg (Källa cc-by-sa)

 

Om man accepterar att bågar ska synas så kan man ha svarta bågar även om man har ljusa färger i ansiktet. Ingen bågfärg eller -blänk stör ögonen. (Källa cc-by-sa)

Här skulle man kunna säga fantastisk antireflexbehandling, men det är nog inget glas alls i bågen (Källa cc-by-sa)

Om man har stor styrka på glasögonen kan det vara en idé att ha förhållandevis små glas med korta diagonaler (dvs mer runda). Vissa bågar har en bredd utanför glasen, och detta är gynnsamt för att få ner tjockleken på starka glas, utan att se ut som om man har för små glasögon. Breda skalmfästen hjälper också att dölja glasens tjocklek.

Ett brett skalmfäste kan hjälpa till att maskera ett tjockt glas
(källa cc-by-sa)

Tjocka bågar i t ex plast kan också dölja tjockleken. Ett högre brytningsindex ger tunnare glas, men som diskuteras nedan så är det effektivare med mindre glas vad gäller att tunna ut dem.

Jag har på senaste tiden iakttagit folk på stan och deras glasögon. Min slutsats är att det vimlar av snygga glasögon men att de inte alltid passar till ansiktet de sitter på.

Material

Titan är lätt som aluminium och starkt som stål ungefär. Ju större bågare och starkare glas man har så är det ju snarare vikten på glasen som dominerar dock. Titan är ett dyrare men lättare alternativ till plåt.

Funktion med progressiva glas

Det har länge varit en trend att ha glasögon som är smala i höjdled. Detta framhäver kindbenet, men det ger ett begränsat synfält i höjdled. Det gör det också svårt att ha progressiva glas i bågarna.

Man brukar räkna med att man vill ha minst 30mm i höjdled för progressiva glas, vilket innebär at man kan vinka hejdå till en stor del av Oakleys sortiment t ex.

Det finns dock något som heter short corridor progressive lenses, som man kan försöka med (diskussion här). Vad gäller bågar som är öppna nedåt kan man också helt sonika förlänga glaset längre än vad som designen är avsedd för. En kompis fru fick detta utfört på sina halvgarnityrglasögon och är nöjd.

Man kan också ha dubbel- eller trippelslipade glasögon, med skarpa övergångar. Det utnyttjar glashöjden effektivare, men man gick modemässigt ifrån det för att det ger en uppenbar ålderssignal, tror jag. Rätta mig gärna i kommentarerna om det finns några optiska fördelar med progressiva jämfört med dubbel- och trippelslipade. Tack vare att progressiva tagit över så mycket så undrar jag om det inte kan vara rätt "safe" att gå tillbaka på dubbel- och trippelslipade eftersom ingen känner igen det längre. Utom äldre såklart :-)

Glasögonmärken

De märken som jag personligen fastnade för var Oakley, Puma och Rudy project.

 

Rudy project Slicer Aluminium, med flip-ups

 

Specsavers hade faktiskt också några riktigt trevliga ur märkena Quiksilver och Animal. Man får dock inte låna hem från Specsavers + att det var billigare material i de bågarna (och billigare pris förvisso). Ej hemlån var en dealbreaker för mig. Specsavers i Storbritannien håller ungefär halva priset mot Sverige, men det verkar svårt att beställa; de verkar aktivt hindra att man beställer utanför varje lands affärsområde.

 

Skaffa först ett glasögonrecept

Jag valde att gå till en optiker för att få ett recept, som jag sedan kunde gå vidare med. På så sätt så kan man t ex välja att handla glasögonen på Internet eller av en annan optikbutik. Jag valde till sist också att köpa bågarna på ett ställe, och glasen på ett annat. På så sätt fick jag maximal frihet, utan att det blev dyrare.

Internetbutiker mot fysiska butiker

Jag var beredd att ge 1000:- extra totalt i en fysisk butik för glasögonen. Detta eftersom jag bl a använder deras bågar för att prova och fundera. De är ju inga välgörenhetsinrättningar, och det är också bekvämt att ha en butik man kan gå till efter köpet.

Internetbutiker

Detta är de internetbutiker som jag fann intressanta. De ligger alla i EU vilket gör att man slipper tull, och dessutom svensk moms för de som ligger utanför Sverige:

Iris Optical - Har tre riktiga butiker i London, och har ett intressant sortiment.

www.smartbuyglasses.se - Skeppar till enhetspris över hela världen. Har domänen smartbuyglasses i .com, i .uk, .de, .dk, .fr, .es, .at, .ch och .it ( i vissa skickas man vidare till annat namn men det är samma sajt). Smartbuglasses ersätter en för tullkostnader om de skulle uppstå, enligt sajten.

 

   också brittiska, och sajten ingav förtroende 

 

 

Att bara sätta in glas på Internet

Det finns butiker på Internet som specialiserar sig på att sätta in glas i befintliga bågar. På engelska kallas proceduren reglazing. Jag tar upp två här, en eftersom den ligger i Sverige, och en brittisk eftersom den erbjuder asfärisk slipning som tillval i beställningsformuläret.

optikbutiken.se - Har fått bra recensioner på nån rejtingsajt. Två betyg på dem var låga där, men det var folk som klagade på bemötande i telefon, och det har ju inte med linsernas kvalitet att göra

 http://www.thinlenses.co.uk/

Där kan man beställa asfäriska glas direkt i webbformuläret. För 1.67 blir det £195 just nu, eller knappt 2000 SEK med dagens gynnsamma växelkurs. Det står inte vilket märke och modell de använder på glasen. Som namnet på butiken antyder så specialiserar de sig på högbrytande glas.

Glas

Mineralglas och plastglas

Det vanligaste idag är plastglas, och över Internet är det det enda alternativet. Glas (mineralglas) har dock några fördelar:

  • Billigare
  • Hårdare
  • Bättre optisk kvalité

Nackdelarna är att det är

  • Tyngre
  • Kan splittras vid olyckor
  • Bara kan användas i bågar som har en ram hela vägen runt glaset

Tjocklek på glasen & brytningsindex

Ju högre brytningsindex ett glas har, desto tunnare kan det göras för samma styrka. Många optiker erbjuder något de kallar "standardglas", och de kan ofta fås "gratis" med bågen. Dessa har brytningsindex 1,5 och är gjorda i glas (mineralglas). Nästa nivå upp med plastglas är 1,6 , sedan 1,67 och högre kan vara t ex 1,74 . Det är en rejäl prisskillnad mellan 1,67 och 1,74 och även från 1,5 och upp till 1,6.

Man kan räkna ut tjockleken på plast- eller mineralglas med den här kalkylatorn. Vanliga mått på frame bridge (näsdelen) är 19mm, på frame eyesize (bredden på ett glas) är 53mm och på interpupillary distance (pupillavstånd) 62 mm. Man ska dock ta dessa mått från de glasögon man är intresserad av och ens glasögonrecept. Om jag väljer mina mått och slår in rätt rejäla mått på närsynthet så får jag dessa kanttjocklekar för olika brythingsindex:

 

1,6 i glas 8,9mm
1,7 i glas 7,7mm
1,8 i glas 6,8mm
1,9 i lantalglas 6,3mm
1,6 i plast ~9mm
1,67 i plast 8,2mm
1,74 i plast 7,4mm
   

Man kan se ur denna tabell att en halvering av tjockleken aldrig är möjlig. Istället får man nog ställa up en tjockhetsgräns, och sedan variera glasstorlek och brytningsindex. Däremot är det väldigt effektivt att variera storleken på glasen: En tioprocentig minsking av glasets bredd ger med de parametrar jag använde en minskning i tjocklek med nästan 30% vid brytningsindex 1,67.

Genom att välja bågar med en bred framkant utanför glasen, kan man minska glasens storlek utan att bågarna som helhet blir för smala till ansiktet

Sex millimeters tjocklek på glasets kant känns som en estetisk gräns.

Om man ska ha glasen i halvgarnityr eller helt utan omgivande båge så måste glasen för det första vara gjorda i plast vilket bara det gör dem lite tjockare jämfört med glas, och dessutom så ökar de extra i tjocklek för att kunna vara del av den bärade strukturen i bågen.

Asfärisk slipning

Linser kan slipas asfäriskt. Då blir de tunnare vid samma brytningsindex än ett vanligt (sfäriskt) glas. Man får inte samma förstoring/förminskningsproblem heller, dvs man ser saker genom dem mer i normal storlek och ens ögon blir inte heller så förminskade/förstorade genom dem. Det sistnämnda är ju en klar kosmetisk fördel.

Även om ögonen se mer normala ut genom asfäriska glas så kvarstår vid glas för närsynthet, det kosmetiska problemet med att sidorna på huvudet kan dras in optiskt och man ser sammanklämd ut genom glasen. Det faktum att ögonen dock ser normalstora ut i den asfäriska slipningen gör effekten lite överraskande och främmande.

Det finns dessutom andra små slipningstricks (slipa på framsidan/baksidan, ta hänsyn till pupillens bågrörelse), men de kan jag inte så mycket om.

Ytbehandling

Glas kan ytbehandlas för att ge mindre reflexer, en s k antireflexbehandling. Det har både en praktisk och en kosmetisk fördel. Den praktiska är vid t ex bilkörning när man blir mindre störd av strålkastare och annat ljus, kosmetiskt så syns ögonen bättre genom glasen utan blänk.

Antireflexbehandling är extra viktigt när man har högbrytande glas, detta eftersom de störande reflektionerna blir mycket kraftigare med högre brytningsindex. Antireflexbehanling är helt enkelt en beläggning utanpå glaset med ett brytningsindex mellan luft och glaset.

Det finns också ytbehandling som är smutsavvisande och vattenavvisande. Smuts är ofta fett, och en ytbehandling som är fettavvisande kallas på engelska för oleophobic. En vattenavvisande ytbehandling kallas på engelska hydrophobic. 

För plastglas är också hårdhetsbehandling viktig. Det verkar varar stor kvalitetsskillnad mellan olika sådana behandlingar. Här en rapport (pdf) från Testfakta. Tyvärr skriver de inte ut vilka som tillverkat glasen (Zeiss, Hoya, osv) eller vilken av dessas respektive ytbehandlingar som då använts. Det finns en risk (eller möjlighet om man så vill) att någon av de namngivna svenska leverantörerna har bytt sedan testet.

Polariserande glas

Polariserande glasögon tar bort ljus som rör sig horisontellt i sin vågrörelse. Detta hjälper med att ta bort reflexer från vatten, t ex på sjön eller vid bilkörning i regn. Även glas och metall kan reflektera polariserat ljus, och himlen kan ge ifrån sig polariserat ljus.

Polariserande glasögon stjäl alltid ljus. Teoretiskt sett kan polariserande glas släppa igenom 50% av ljuset, men med den metod man mest använder i glasögon, Polaroid, så släpps max runt 38% av ljuset igenom. Polariserande glas verkar därför inte vara någon höjdare för mörker- och skymmningsbruk.

Det verkar lite småsvårt att hitta högbrytande glas med polariserande förmåga. Finns på B2B-sajten Ali Baba.


 

Vad blev det?

Bågar

Jag valde till sist att köpa bågarna i en butik eftersom de inte var dyrare där för den modellen och för att just den modellen bara fanns på Internet i en tjeckisk butik(!). Jag var dessutom beredd att betala lite mer till butiken i vilket fall som helst. I detta fall gick det ganska jämnt ut.

Pumaglasögon

Linser

Jag valde till slut att beställa linserna i en butik. En orsak till detta var att jag ville ha asfäriska linser och nästan inga webbsajter listar priser på asfäriska linser, så det hade blivit en extra förfrågan om detta, och prispåslag. Jag kom fram till att med påslaget för asfäriska glas så verkade det också som om prisskillnaden kom under min magiska tusenkronorsgräns mellan butik och Internet.

Jag valde Hoya 1,67 enkelslipade asfäriska, med bästa hårdhets- och antireflexbehandlingen.

Kontaktlinser

Här finns en kalkylator för att omvandla från ett glasögonrecept till ett kontaktlinsrecept.

Man kan nämligen inte använda styrkorna från sitt glasögonrecept till kontaktlinser. Anledningen till detta är att ju närmare linsen sitter ögat, desto svagare kan den vara för att ge samma synkorrigering. Man kan själv prova detta med sina glasögon genom att föra dem närmare och längre bort från ögonen (tips: om du är närsynt och behöver se bättre på nära håll tillfälligt, skjut fram glasögonen på näsan). Det går däremot att omvandla ett glasögonrecept till ett kontaktlinsrecept, t ex med ovanstående kalkylator.

Kom ihåg att det kan finnas andra skäl att ändå besiktiga ögonen hos en kontaktlinsoptiker.

Progressiva glas och att ångra glas

Om man ska ha progressiva glas, eller misstänker att man kanske behöver det, tycks det mig vara mycket bättre att handla glas i affär än på nätet. Det finns flera skäl till det. För det första så är det viktigt var i höjdled på glasen som övergången mellan fjärr- och när/medelseende inträffar. Var man vill ha den övergången beror på hur högt glasögonen sitter på näsan och på personliga preferenser. Det kan inte ett formulär på webben hjälpa en med.

För det andra så kan man hos många optiker ångra sig vad gäller slipning av glasen efter man har fått dem. Detta kan man använda till att prova en annan styrka i vanliga glas som fungerar bättre för när- och fjärrseende, utan extra kostnad, dvs en svagare styrka. Om man vill ändra från enkelslipade glas till progressiva glas kan man också göra det, med endast en tilläggskostnad. Kolla med optikern att denna möjlighet finns.


Rooting ZTE Blade/San Francisco & installing Cyanogenmod

published Sep 26, 2011 09:56   by admin ( last modified Sep 26, 2011 09:56 )

Quickly and easily root your ZTE Blade to get access to interesting apps on Android Market.

Subsequently flashing the phone with Cyanonogenmod Gingerbread 2.3.3 gives you besides the newer Android, some interesting features such as gestures and the ability to edit permissions for all applications individually. My ZTE Blade had some teething problems with Cyanogenmod 7.0.3 Stable, less so with 7.1.0-RC1.

Quick how-to

  • First in order to root the phone, go to
    http://android.modaco.com/topic/337262-permanent-root-for-22-blades/
  • Register at the modaco site in order to download the file
  • Unpack the zip file into its own folder on your computer
  • Mount the phone as a USB storage unit to your computer and copy the folder over
  • Disconnect the phone from the computer
  • Use the "Files" application on your phone to find the folder and tap the z4root file in the folder. Install it.
  • On your phone, go to Settings->Applications->Development  and enable USB debugging
  • Turn the phone off and back on again
  • Start the now installed z4root app and the phone should get rooted. If rooting the phone was the goal, you are done!
  • To continue installing Android Gingerbread 2.3 from Cyanogenmod, follow the instructions at the bottom of this page:

    http://wiki.cyanogenmod.com/wiki/ZTE_Blade:_Flashing_CyanogenMod#Method_via_ROM_Manager

    or if you'd rather have the instructions in a video tutorial format:

    http://www.youtube.com/watch?NR=1&v=XZ9VgyaIT4w (It works on gen2 Blades despite what the video byline says, mine is a gen2)

 

Well, I am pretty happy with my recently purchased ZTE Blade, but the call quality is lacking when it comes to the sound of the phone's internal earphone speaker. Cyanogenmod 7 with Android 2.3 contains an equalizer and with a bit of luck it may patch itself into the call chain I thought (no such luck in hindsight).

I did hesitate to install Cyanogenmod for a while due to the unwieldy install instructions on their wiki. After having written down and analyzed all the steps (see further down in this post) I realized all steps bar one, were for rooting the ZTE Blade.

Happily the user "Kallt Kaffe" has made an app that roots the Blade in one step! His being on my phone operator network (Telia SE) made it feel safe and compatible (although I believe the root is universal across languages and operators). If you want to root the Blade/San Francisco, it then seems to be the easiest way:

http://android.modaco.com/topic/337262-permanent-root-for-22-blades/

 

According to Kallt Kaffe's guide, USB debugging must be enabled. I found it under Settings ->Applications->Development->USB debugging

 

I had to reboot the phone to get the rooting app to accept that the setting was indeed enabled.

Here's a Youtube film on Cyanogenmod tweaks (untested by me)

And here's a review

 

 

Impressions

The Cyanogenmod 7.0.3-Blade stable running on my ZTE Blade has not come out completely smelling of roses.

  • [upgrading to Cyanogenmod 7.1.0-RC1 seems to have solved this problem] The phone seems to switch itself off when charging after a couple of hours. I do hear notification sounds for incoming e-mails, but come morning the phone is dead and does not respond to phone calls. At 8.50 everything is fine, but at 10.20 the phone is dead and needs to have the battery pulled out and back in again when I'm out and about. This happens every night when phone is being charged. However, when not having it charged overnight, everything is fine. Pulling out the USB charger's cable helps sometimes, reinserting it helps at other times. Or the old battery reset method. I do have silent hours enabled, but the phone dies well after the silent hours are over.
  • [update: download this to fix it] It doesn't reconnect to WiFi. Disabling and re-enabling WiFi makes it reconnect. This is a general problem for ZTE Blade and not just when it runs Cyanogenmod it seems, I have just learned
  • It reboots occasionally while entering text into Google Maps.

 

The cumbersome by me untested way

Below the steps to root and flash a ZTE Blade as it currently says on Cyanogenmod's Wiki.

 

 

1) Cyanogenmod may be installed just as in this video,

http://www.youtube.com/watch?NR=1&v=XZ9VgyaIT4w

thusly:

 
 
2) but the phone needs to be rooted first. Described here:
 
 
 
3) ...but in order to root it one must install adb. Two pages show how, this one where you need to install the entire development environment for Android:
 
 
It links to a page for just adb:
 
 
That one currently essentially just points back  to the big SDK install page however
 
4) ...aha but to install Android SDK you need to have Java installed:
 
 
5) And then you need the Java Development Kit:
 
 
6) If you happen to run Linux on your computer you furthermore need to configure udev (if udev is on your flavor of Linux) to recognize and handle the device in Normal, Debug, Recovery and Fastboot mode. These modes the phone can enter by on-boot button combinations apparently, and you can use lsusb to find them out while pressing and waiting:
 
 

phonix232 has done that work for you though:

:
 
SUBSYSTEMS=="usb", ATTRS{idVendor}=="19d2", ATTRS{idProduct}=="1353", MODE="0666", OWNER="[username]" #Normal Blade
SUBSYSTEMS
=="usb", ATTRS{idVendor}=="19d2", ATTRS{idProduct}=="1351", MODE="0666", OWNER="[username]" #Debug Blade
SUBSYSTEMS
=="usb", ATTRS{idVendor}=="19d2", ATTRS{idProduct}=="1354", MODE="0666", OWNER="[username]" #Recovery Blade
SUBSYSTEMS
=="usb", ATTRS{idVendor}=="18d1", ATTRS{idProduct}=="d00d", MODE="0666", OWNER="[username]" #Fastboot Blade

[username] should be changed to your username. On the Linux computer that is I gather .