Archives 2005 - 2019    Search

Getting a missing wireless card back on Dell 1015, Ubuntu 12.04 (and a bit of 11.10)

published Apr 05, 2013 07:40   by admin ( last modified Apr 25, 2013 10:19 )

Summary: Still having problems, also with external USB WiFi card. Now upgrading to 13.04 to see if that helps.  Keeping the rest of the text here for reference.

The problem seem to have disappeared now after I installed a new kernel, version 3.5 from a repository of more experimental kernels. Additionally, it seems I had misunderstood the update policy of menu.lst, the settings file that controls what options for kernels you have. I had basically been running Ubuntu 12.04  with a 3.0.0-17 kernel for Ubuntu 11.10.

I now have an updated menu.lst and will test later to see if 3.2 and 3.4 kernels work with the wireless too. If you have problems with wireless it may pay off to try a couple of different kernels, in the case the one you are running has buggy support or incompatibilities.

The experimenatl kernel repository:

sudo apt-add-repository ppa:kernel-ppa/ppa
sudo apt-get update

Suddenly wireless Ethernet disappeared from my Dell 1015 which is running Ubuntu 12.04. It was a bit of a surprise since it had worked before, on the same Ubuntu 12.04 for months. When I say it disappeared it was just like the computer did not have the wireless card anymore, although the dual-booted Windows had no problems using it. Furthermore, adding a USB stick with Wi-Fi just brought back the networks in the menus. You could connect but not send or receive any data.


Diazo rules for Plone

published Mar 31, 2013 01:39   by admin ( last modified Mar 31, 2013 01:39 )



Here is a list of rules that I have used in various situations when preparing a Diazo theme for Plone.


Read more: Link - Flight of the Pigeon: Common Diazo Rules for Plone


Replacing the white with transparent in the gimp

published Mar 30, 2013 05:10   by admin ( last modified Mar 30, 2013 05:18 )

I had to adjust the look of a navigation arrow, that had been anti aliased against a white background, but now the arrow should function as a semi transparent overlay on a slideshow. So I needed the Gimp to not only convert pure white to transparent, but somehow understand that white should in general mean "transparent" so that areas fading to white should in fact be fading to transparent. It did  not matter if the whole image got a bit semi transparent due to this.

Old version, you can see the anti-aliasing to white, giving a halo to the image as it is being laid over a slide

 

 

New version, the whole arrow became semi-transparent, but that is ok for this purpose. Note that the pesky halo is completely gone

 

 

Turned out to be really simple: Select Colors->Colors to Alpha in the menus and go with the default white.



 

The canonical way is to use Color/Color to alpha and give the background color, but that doesn't work too well with white because it makes a lot of things semi-transparent.


Read more: Link - Changing a white background to transparent (.png)


Narkolepsin och hajoljan?

published Mar 26, 2013 04:25   by admin ( last modified Mar 27, 2013 12:05 )

Nu har läkemedelsverket kommit fram till att de unga som vaccinerats mot svinfluensa i Sverige har drabbats av narkolepsi i mycket större utsträckning än de som inte vaccinerats (SvD).

– Vi kan se att över studieperioden har vi 126 fall av de vaccinerade som har fått narkolepsi. Bland ovaccinerade har vi 20 fall.

Det verkar som att det just är vaccinet som heter Pandemrix som pekas ut, och det är om jag minns rätt ett vaccin som inte så har mycket virus i sig, vilket man försökt kompensera genom att ha en adjuvant i. En adjuvant är en substans som allmänt retar immunförsvaret, och det låter som en dålig idé tycker jag, det där med att stimulera immunförsvaret extra, när vi vet att många av våra allvarliga sjukdomar har autoimmuna komponenter. Adjuvanten i det här fallet tror jag är hajolja.

Det finns alltid en fara att behandla  med mediciner som inte är ordentligt testade. Och det är minsann inte lätt att grundligt testa något, speciellt om konsekvenserna blir synliga många år senare. Den libanesisk-amerikanske skribenten Nassim Nicholas Taleb har skrivit en hel del om detta, det kallas iatrogenics på engelska (wikipedia-artikel på engelska här). Neurosedyn-fallen är en av de mer kända exemplen. 

Talebs regel är att man inte ska behandla mildare åkommor alls med medicin, då risken för bieffekter ofta av naturliga skäl är okänd (de flesta läkemedel är inte rigoröst testade i 50 år, eller för effekter över generationer). Vi vet dock att naturen är något människan i stort kan hantera (med åtgärder för sanitet i alla fall). Däremot ska man behandla aggressivt vid svåra eller ovanliga sjukdomsfall, enligt Taleb.

 

Trots narkolepsin försvarar Ingemar Persson massvaccineringen. – När vi stod i den situationen fanns ett ansvar att ta ett beslut att skydda befolkningen. Narkolepsi-problemet kom som en total överraskning och eftersom det är en så ovanlig sjukdom var det heller inget vi hade kunnat ta reda på innan.

Vaccin mot olika åkommor har ju funnits länge. Frågan är hur mycket data som finns på adjuvanter, och specifikt den adjuvant som finns i Pandemrix?

Jag skrev om detta också i februari 2012: Adjuvanten skurken bakom narkolepsi efter vaccinering mot svininfluensa?


An explanation of monads that is actually easy to understand

published Mar 21, 2013 08:49   by admin ( last modified Mar 21, 2013 08:49 )
A while ago I gave a talk at jsconf.eu about functional programming. I wasn't happy with the explanation I gave on monads. Since I feel I can do better than that, I'm going to add my blog post to the hundreds of posts already floating around on the subject, hoping that it will help some people to see things more clearly

 

Read more: Link - Jabberwocky


Trello - some kind of flexible brainstorm and project management

published Mar 18, 2013 04:35   by admin ( last modified Mar 18, 2013 04:32 )

Using cards as metaphor. Looks really interesting!

 

Your entire project, in a single glance.


Read more: Link - | Trello


Facebook integration for Plone

published Mar 14, 2013 06:19   by admin ( last modified Mar 14, 2013 06:19 )

Found a stackoverflow question on this

 

I'm searching for an existing Plone add-on that allows Facebook users to authenticate in Plone - version 4.x.


Read more: Link - How to authenticate with facebook account in Plone - Stack Overflow

 

A couple of solutions are proposed (currently untested by me):

 

domruf / plonesocial.auth.rpx — Bitbucket - Plone 4 friendly fork of plonesocial.auth.rpx .

codesyntax/cs.auth.facebook · GitHub - Code from Aspeli's book

collective.facebook.accounts 1.0b2 : Python Package Index - a third option

 

all untested by me


Clojure stuff

published Mar 13, 2013 03:55   by admin ( last modified Apr 26, 2013 05:27 )

 The Clojure Toolbox

"The Clojure Toolbox  A categorised directory of libraries and tools for Clojure"

ClojureDocs - Community-Powered Clojure Documentation and Examples

"ClojureDocs is a community-powered documentation and examples repository for the Clojure programming language"

Clojure libraries for MongoDB, Riak, RabbitMQ, validations, Neo4J, ElasticSearch, Memcached, Apache Cassandra, Kestrel and more

"A growing collection of open source Clojure libraries that support multiple Clojure & JDK versions, licensed under the EPL, target Clojure 1.3+"

 schani/clojurec · GitHub

"ClojureC This is compiler for the Clojure programming language that targets C as a backend."
 

 Immutant | Home

"Immutant is an application server for Clojure. It's an integrated platform built on JBoss AS7 providing support for Ring handlers, asynchronous messaging, caching, scheduled jobs, XA transactions, clustering, daemons and more!"

ibdknox/fetch · GitHub

fetch "A ClojureScript library that makes client/server interaction painless".
 

 alexander-yakushev/lein-droid · GitHub

"lein-droid A Leiningen plugin to simplify Clojure development for Android platform" (still not easy as far as I understand)

dfuenzalida/todo-cljs · GitHub

"A port of the JavaScript TODOs app to ClojureScript, copied from http://todomvc.com/vanilla-examples/vanillajs/"

Edn - sonds like JSON for Clojure:edn-format/edn · GitHub

Routing in Compojure: clojure - What's the "big idea" behind compojure routes? - Stack Overflow

A sample clojure web application, how to deploy it to heroku and a demo on heroku of the application: Building a Database-Backed Clojure Web Application | Heroku Dev Center

Clojure web server benchmarks: ptaoussanis/clojure-web-server-benchmarks · GitHub

I think the nginx performance is just there for reference, it does not serve out clojure stuff, at least not from what I can see in the nginx configuration file. On the other hand, it is bested in the benchmarks by http-kit (http-kit/http-kit · GitHub), which seems to serve out clojure stuff:
 

 Home | http-kit, high performance HTTP Client/Server for Clojure

"HTTP Kit is a small, efficient, Ring-compatible HTTP client/server for Clojure. It uses a event-driven architecture to support highly concurrent a/synchronous web applications (including WebSocket applications)."

Pedestal - A web framework

Clojure seem slower than Java: Clojure speed ÷ Java 7 speed | Computer Language Benchmarks Game

Clojurescript One:

ClojureScript One will show you how ClojureScript reduces the complexity of web development

Read more: Link - ClojureScript One Guide

Planet Clojure
 

rplevy/swiss-arrows · GitHub

"swiss-arrows A collection of arrow macros." The thread macro, but with placeholders and a bit of branching.

 

Clojure Concurrency A tour of concurrency primitives in Clojure


Read more: Link - Clojure Concurrency - Online Training Course for .NET Developers

 
 

Military belts and how to find out the name of the buckle part

published Mar 07, 2013 10:31   by admin ( last modified Mar 07, 2013 10:31 )

I have a leather belt for casual dress use, with a military style belt buckle. It locks the belt by friction. I really like it and would like a couple of more belts like it in other belt colors, but could not find it on the Internet. I had no problems finding ones with the correct kind of buckle but where the belt wasn't leather.

Until I realized that you need to know the exact term to describe that kind of buckle. At Baron Belts I found the term "slip-through with friction pin", but that did not help much, since that term did not seem to be in common use to describe the finished product. Wikipedia to the rescue: On their page on belt buckles one can find the term "Box-frame buckle". And that is what one has to search for: Box-frame buckle. And there are some very nice leather belts indeed.


How to make a select element into a list of links that you can jump to

published Feb 18, 2013 02:51   by admin ( last modified Feb 18, 2013 02:51 )

It was suprisingly hard to search for this on the Internet. Summary: It's the select element that gets the onChange event, and from there you can get  hold of the index of the selected option.

 

Creating a combo menu that jumps to a URL upon selecting


Read more: Link - Creating a combo menu that jumps to a URL upon selecting


A javascript for sorting and filtering tables

published Feb 13, 2013 03:24   by admin ( last modified Feb 13, 2013 03:24 )


I found a six year old javascript that does sorting and filtering of HTML tables rather nicely. Works well in intial tests in Firefox and Chrome on Ubuntu.
 

Click on column headers to sort by the column. Sorting is done within the two tbody sections, not across them, and the header and footer are not changed. The table is auto-striped and auto-sorted on the first column on page load


Read more: Link - Table Sorting, Filtering, Etc from JavascriptToolbox.com


Batch convert Gimp XCF files to JPEG

published Feb 05, 2013 01:48   by admin ( last modified Feb 05, 2013 01:48 )

Works like a charm!

 

A little while ago I wrote this very simple Gimp script to do a batch conversion of all .xcf files in a directory into .jpg files of a moderate quality. To install just copy the below code into a suitable in your gimp profile “scripts” directory, e.g.


Read more: Link - Simple XCF to JPEG Batch Conversion Script | Dan's Outsourced Memory


Letting varnish always serve out cached content, and update its cache in the background

published Jan 31, 2013 05:35   by admin ( last modified Apr 12, 2014 02:29 )

Update 2014-04-12

This function now seems to be in the new varnish 4. From the release notes:

Background (re)fetch of expired objects. On a cache miss where a stale copy is available, serve the client the stale copy while fetching an updated copy from the backend in the background.

If you cache content in Varnish, it serves out pages really quickly. But when the cached object expires, the next visitor has to wait for the slow back end, and then the object gets cached once again.

What about if I'd like Varnish to always serve out cached content even when it has expired and then silently - in the background - fetch a new copy for its cache? In that way no visitor ever has to wait for the back end.

Update 2013-10-19:

See the link near the end of this blog post for what seems to be a working, but complex solution (or better, just update to varnish 4.x).

This holy grail feature is called "stale-while-revalidate". It does not currently seem possible in straightforward way, from the linked documentation (my boldface):

With this exercise, you should see that as long as the content is within the regular TTL, there is no difference. Once the TTL expires, the first client that asks for the content should be stuck for 15 seconds, while the second client should get the graced copy.


However, you can trigger an external http client when the time comes close:

Varnish trick: Serve stale content while refetching | Blog of Lasse Karstensen

...that is kludgy, though.

Read more: Link - Saving a request — The Varnish Book


Taleb i Reason.tv, saker som inte står i "Antifragility"

published Jan 29, 2013 01:57   by admin ( last modified Jan 29, 2013 01:57 )

Nicholas Nassim Taleb har låtit sig intervjuas i Reason.tv (finns på Youtube)

 

och han nämner några saker som inte står i hans nya bok Antifragility:

  • Taleb ser sig själv inte som nyliberal (trots att han stöttade det nyliberala presidentalternativet i det republikanska primärvalet) utan ser sig som konservativ. Närmare bestämt "vänsterkonservativ". Min uppfattning är att man ur Talebs filosofi kan hämta argument både för liberalism, konservatism och ekologism.
  • Taleb hämtar mycket från antiken, men ser sig själv inte som arvtagare till antikens greker eller araber (Taleb är kristen arab från Libanon, men naturaliserad i USA) utan som arvtagare till romarna.
  • Taleb menar att man inte ska ta lån. Alls. Eller rättare sagt, man kan ta lån i en betydelse som använts i handel väldigt länge: Nämligen något som så vitt jag kan bedöma motsvarar Escrow (en slags deposition medan en transaktion, t ex utväxling av varor, görs klar).
    Istället ska man finansiera saker med equity, vilket i detta sammanhang tycka vara investeringar i andelar. Ta inte lån för att starta eller utöka ett företag, sälj istället andelar som andra kan investera i. Min reflektion är att bolån skulle kunna ses som andelar, men inte i Sverige: Man kan inte inte knalla ifrån ett hus och bli skuldfri med motivationen att banken kan ta sin andel i huset, vilket man kan i USA.
  • Taleb påpekar att när finansvärlden fick enorma mängder pengar inpumpat 2010 så valde de också att ge sig själv enorma bonusar. Taleb förespråkar på ett ställe i intervjun så vitt jag kan bedöma nationalisering av företag som är för stora för att tillåtas gå omkull (too big to fail) om de kommer på obestånd.

What Lightbox clone/ gallery slideshow to use for small screens?

published Dec 23, 2012 10:30   by admin ( last modified Dec 23, 2012 10:28 )


I noticed that the current javascript library used on one site that I take care of, does not do a good job of presenting a lightbox kind of slide show of the gallery images. On smartphones the margins it makes to the right and left make the "enlarged" images smaller than the thumbnails it is supposed to present!. I have looked at demos for a dozen libraries now, and Pirobox seems to do a good job, although I will need to get back with an update once I have implemented it on the site in question.
 

Hello and welcome, this is an advanced version of pirobox, I implemented a few things more than the previous version. One of the most important things is the ability to open any kind of files, from inLine content to the swf files, from simple images to pdf files. Other things are: automatic image resizing and drag and drop.


Read more: Link - Pirobox Extended V.1.0. jQuery plugin


Python decorator to make functions into command line scripts

published Dec 22, 2012 12:05   by admin ( last modified Dec 22, 2012 12:05 )


Command line arguments are generated from the functions' arguments.

Function decorator to quickly turn Python functions into CLIs as we know them.


Read more: Link - epsy/clize · GitHub


Link: A guide to make a half-decent web design

published Dec 21, 2012 04:24   by admin ( last modified Dec 21, 2012 04:24 )



With the above techniques, you can make a site that is starting to look slightly more professional, pretty quickly.


Read more: Link - 24 ways: How to Make Your Site Look Half-Decent in Half an Hour


Link - Tutorial on how to use Clojure for a web project

published Dec 13, 2012 12:46   by admin ( last modified Dec 13, 2012 12:46 )



Building A Clojure REST Service: Part One


Read more: Link - Internistic: Building A Clojure REST Service: Part One


lprm removes jobs from the print queue on Linux

published Dec 10, 2012 11:28   by admin ( last modified Dec 10, 2012 11:28 )

When the GUI applets don't work or have gone into hiding, you can use lprm to clear out the print queue

sudo lprm

will clear out all from the print queue of the default printer, There seems to be more options if you do

man lprm
Fortunately, system administrators and even individuals can remove job from the print queue using the "lprm" command.


Read more: Link - How to Remove Jobs From the Print Queue in Linux | eHow.com


mupdf opened a tricky PDF file

published Dec 07, 2012 08:41   by admin ( last modified Dec 07, 2012 08:41 )

I got sent a tricky PDF file that would not open in:

  • Document Viewer
  • XPDF
  • ePDFViewer
  • gv
  • Chrome's builtin PDF viewer,
  • The Gimp or
  • Okular

on my Ubuntu Linux 12.04. But mupdf opend it fine.

MuPDF is a Free and open source software library written in C that implements a PDF and XPS parsing and rendering engine. It is used primarily to render pages into bitmaps, but also provides support for other operations such as searching and listing the table of contents and hyperlinks.


Read more: Link - MuPDF - Wikipedia, the free encyclopedia