Archives 2005 - 2019

Plone training in London March 27-29, 2012

published Jan 31, 2012 02:42   by admin ( last modified Jan 31, 2012 02:42 )

We will do Plone training in London March 27-29. Same contents as usual, with the addition of Diazo skinning and Dexterity.

We will most likely be at Portman Square (depending a bit on the size of the group).


Link - Introduction to git

published Jan 30, 2012 09:51   by admin ( last modified Jan 30, 2012 09:51 )

To check out later.

Introduction to Git



Read more: Introduction to Git on Vimeo


Länk - Rockbox - nytt OS till ens mediaspelare

published Jan 30, 2012 03:52   by admin ( last modified Jan 30, 2012 03:52 )


Ska kanske prova att få in detta på min lilla mp3-spelare.

Stable ports Rockbox runs well on these players, has a complete manual and is supported by the installer: Apple: iPod 1g through 5.5g, iPod Mini, iPod Nano 1g and iPod Nano 2g Archos: Jukebox 5000, 6000, Studio, Recorder, FM Recorder, Recorder V2 and Ondio Cowon: iAudio X5, X5V, X5L, M5, M5L, M3 and M3L iriver: iHP100 series, H100 series, H300 series and H10 series Olympus: M:Robe 100 Packard Bell: Vibe 500 SanDisk: Sansa c200 (not v2), e200 and e200R series, Fuze, Clip and Clip+ Toshiba: Gigabeat X and F series



Read more: Rockbox - Free Music Player Firmware


Länk - Windmill: "No default or local profile has been set"

published Jan 30, 2012 02:03   by admin ( last modified Jan 30, 2012 02:03 )


This worked for me in  ~/.windmill/prefs.py on Ubuntu 10.10 .

MOZILLA_BINARY='/usr/bin/firefox'
MOZILLA_DEFAULT_PROFILE='~/.mozilla/firefox/'



Read more: #72: FF4 - Exception: No default or local profile has been set. - Issues - windmill/windmill - GitHub


Link - Requests: An alternative to urllib2 in python

published Jan 23, 2012 05:43   by admin ( last modified Jan 23, 2012 05:43 )

Note to self.

Python’s standard urllib2 module provides most of the HTTP capabilities you need, but the API is thoroughly broken. It was built for a different time — and a different web. It requires an enormous amount of work (even method overrides) to perform the simplest of tasks. Things shouldn’t be this way. Not in Python.



Read more: Requests: HTTP for Humans — Requests 0.10.1 documentation


Link - Git over http

published Jan 18, 2012 02:07   by admin ( last modified Jan 18, 2012 02:07 )


This looks very interesting for integrating external authentication sources. It seems to be a CGI script so it does not operate the same way as e.g. subversions's http protocol. I will probably need to install it and check the logs for what the requests will look like. My guess is a combination of path and POST parameters.

I believe this because it’s both efficient and can be run either secure and authenticated (https) or open and unauthenticated (http). It also has the huge advantage that most firewalls have those ports (80 and 443) open already and normal users don’t have to deal with ssh-keygen and the like. Once most clients have updated to at least v1.6.6, http will have a big place in the Git world.



Read more: Pro Git - Smart HTTP Transport


How to make a massive Zope/Plone undo through the web

published Jan 16, 2012 01:03   by admin ( last modified Jan 16, 2012 01:03 )

 

Summary:

http://localhost:8080/manage_UndoForm?PrincipiaUndoBatchSize:int=660

....where 660 should be replaced with the number of transactions you need to go back. Then click like crazy.

 

I had the need to back a Zope site in time several months, October 2011 to be specific.

I had deleted a page (after its due date) for a Plone course December 2011 and kept one for December 2007. I did not, repeat not, want to enter everything that has changed in the contents of that course in between those two dates again. There are backups for the entire system but they are rotated, and I caught this late.

The course page is a compound content type consisting of sub objects for dates, pricing and other things. The missing course page had resided in a folder hierarchy that had also been deleted. The easiest would therefore be to just back the entire server in time, rather than trying to find specific edits to undo.

The undo page in the ZMI batches undoable transactions in lots of 20. My plan was to revert everything back to October 2011 (working on a copy of course). So, 20 transactions is not enough. I need a mega batch! I know there are command line scripts were I can find the byte offset for the date I am interested in and then use truncate, but haven't done it for ages (ok, once in 2002), and can the effect still be achieved from the ZMI? It will be an append but that's OK.

If you look at the "Earlier transactions" and "Later transactions" links, you can see that the start and end transactions are encoded as cgi parameters. The batch size is in other words, not hard coded.  So, if the url for "Later transactions" on the second page is

http://localhost:8080/manage_UndoForm?first_transaction:int=0&last_transaction:int=20&PrincipiaUndoBatchSize:int=20

 

We can just change those numbers. So I clicked through "Earlier transactions" until I reached October, noted where I were in transaction numbers and did something like this:

 

http://localhost:8080/manage_UndoForm?first_transaction:int=0&last_transaction:int=660&PrincipiaUndoBatchSize:int=20

I got a big page and I did a lot of clicking of check boxes, and hit "Undo" - worked like a charm. I then copied over the oh so precious text to the production server.

"PrincipiaUndoBatchSize" I did not notice until now, it did not seem to overrule the other numbers; I did not change that one.

Hmmm, must go back and try something.... Yup, this works too:

http://localhost:8080/manage_UndoForm?PrincipiaUndoBatchSize:int=660

 


How to force a disk check on next restart on Ubuntu

published Jan 12, 2012 01:03   by admin ( last modified Jan 12, 2012 01:03 )

sudo shutdown -rF now

-or-

make a file in the root ("/") directory called forcefsck

Tested on Ubuntu 10.10 .

I had to forcefully shut down a laptop today, and when it came back to life it did not seem all that well. Sometimes Ubuntu starts a spontaneous disk check but it had no such intentions this time. I could not do a "live" disk check since the disk was mounted and fsck sternly warned that I *will* destroy things if I continue. Well then, how to direct it to do it on next boot?

There are at least two ways of doing this: By issuing a restart from the command line with shutdown command, where in addition to the restart flag one also issues a Force disk check. Or by creating a temporary file that Ubuntu reads as a kind of flag on boot and then deletes.


Länk - Python på Android

published Jan 09, 2012 06:17   by admin ( last modified Jan 09, 2012 06:17 )

 

Turn your python application to an Android APK - Build your own python and extension



Read more: kivy/python-for-android - GitHub


Länk - Färganpassning av skärmen till dygnet

published Jan 08, 2012 10:41   by admin ( last modified Jan 08, 2012 10:41 )

 

f.lux makes your computer screen look like the room you're in, all the time. When the sun sets, it makes your computer look like your indoor lights. In the morning, it makes things look like sunlight again.



Read more: F.lux: software to make your life better


Bör man ha åsikter om läkemedelsförpackningars storlek och utformning?

published Jan 04, 2012 05:26   by admin ( last modified Jan 04, 2012 05:26 )

Speciellt receptfria. En Facebookdiskussion spårade in på denna fråga. Jag lägger upp denna post om vidare diskussion önskas.

 

Freakonomics » Why Can’t You Buy a Big Bottle of Headache Pills in England?


Piano player on getting better

published Jan 02, 2012 10:37   by admin ( last modified Jan 02, 2012 10:37 )

This is supposed to applicable to programming, not sure but I make a bookmark:

 

  • Strategy #1: Avoid Flow. Do What Does Not Come Easy.
  • Strategy #2: To Master a Skill, Master Something Harder.
  • Strategy #3: Systematically Eliminate Weakness.
  • Strategy #4: Create Beauty, Don’t Avoid Ugliness.




Avoid Flow. Do What Does Not Come Easy.


Read more: Study Hacks » Blog Archive » Flow is the Opiate of the Mediocore: Advice on Getting Better from an Accomplished Piano Player


How to disable WPS on Netgear WNDR3700

published Dec 30, 2011 04:15   by admin ( last modified Dec 30, 2011 04:15 )

A new attack against home routers has been discovered, and an exploit tool has been made available. To disable WPS  on a Netgear WNDR3700: Go to the admin interface, look at the Screen shot below: go to "Advanced Wireless Settings" and check the checkbox "Disable Router's PIN". Then click the "Apply" button.

 

(I have not verified that WPS is indeed disabled, but as long as the WNDR admin interface does what it says, it should be OK)

Just a day after security researcher Stefan Viehbock released details of a vulnerability in the WiFi Protected Setup (WPS) standard that enables attackers to recover the router PIN, a security firm has published an open-source tool capable of exploiting the vulnerability.



Read more: Attack Tool Released For WPS Setup Flaw - Slashdot

 


Länk - Virtual machines for Internet Explorer testing

published Dec 16, 2011 12:50   by admin ( last modified Dec 16, 2011 12:50 )

 

Microsoft provides virtual machine disk images to facilitate website testing in multiple versions of IE, regardless of the host operating system. Unfortunately, setting these virtual machines up without Microsoft's VirtualPC can be extremely difficult. The ievms scripts aim to facilitate that process using VirtualBox on Linux or OS X. With a single command, you can have IE7, IE8 and IE9 running in separate virtual machines

Default password seems to be Password1

Read more: xdissent/ievms - GitHub


Are there any GUI toolkits for the canvas element in HTML5?

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

Summary: Amino is the closest that I have found, although it seems to be more targeted towards interactive graphics and animation. Although I suppose a GUI is interactive graphics. Untested by me.

Why are there no GUI toolkits that simply do a away with clunky HTML form elements and instead manipulate the CANVAS element directly?

There are now implementations of VNC (noVNC, see my article here) and gtk that show that you can manipulate the canvas element pixel by pixel with enough speed to  make it a fully fledged GUI.

A desktop user interface is vastly superior to HTML based user interfaces and with pixel-by-pixel control I could do so much better user interfaces for compound data and complex interactions. HTML is awkwardly retrofitted into service of something it was never intended to do.

So my question is, why not forego HTML elements completely and instead make something more like Qt, Gtk, Tk or wxwidgets  in javascript for use directly inside a canvas element. You could even throw in a window manager there.

There is a question about this on Stackowerflow, but it was fielded back in 2009 and there aren't that many good answers posted, though Bespin is mentioned

Are there any GUI toolkits built on top of HTML Canvas like swing,swt,gtk or qt? So that it is possible to build applications like applets or flex gui:s inside the html canvas.


 javascript - Are there any GUI toolkits built on top of HTML Canvas like swing,swt,gtk or qt? - Stack Overflow

A comment on Reddit by Chris McDonough originally set me thinking:

 "Many modern web apps are written largely in JavaScript (or even Objective-C on the iPhone) and the server side is just a glorified pack mule that schleps data to and from a persistence engine. Things change."

Ok, we are moving from generating the GUI server side on the web, to generating it in the user's browser.

 


Small linuxes

published Dec 15, 2011 05:31   by admin ( last modified Dec 15, 2011 05:31 )

I'm evaluating small linuxes, and have found two in the 10MB range: ttylinux and Tiny Core Linux. I have played a bit with tty, and will se what Tiny core can do.

 

Update: I have now tried Tiny Core and it crashed and burned through my VirtualBox and took down the entire laptop. Powerful stuff.

 

ttylinux, a small GNU/Linux system available for several CPU architectures. This small system has an 8 MB file system and runs on i486 computers within 28 MB of RAM, but provides a complete command line environment and is ready for Internet access.



Read more: ttylinux homepage

 

Tiny Core Linux is a very small (10 MB) minimal Linux GUI Desktop. It is based on Linux 2.6 kernel, Busybox, Tiny X, and Fltk. The core runs entirely in ram and boots very quickly. Also offered are Micro Core, a 6 MB image that is the console based engine of Tiny Core, and Multi Core, which includes Tiny Core, Micro Core, networking tools and an installe



Read more: Tiny Core Linux, Micro Core Linux, 10MB Linux GUI Desktop, Live, Frugal, Extendable

 


Mount a VirtualBox VDI file on Ubuntu and Debian

published Dec 13, 2011 02:06   by admin ( last modified Dec 13, 2011 02:06 )

Tested on Ubuntu 10.10.

If one of your virtualbox OS instances is hosed, you may still want to reach the files on it. You can actually mount the vdi file (the virtual disk image) on your Linux, and reach the files inside.

VirtualBox 4.0.x did not work for the following, I installed VirtualBox 4.1.6 .

Download gord-vbox-extras_1.0-4_i386 from here.

This will install vdfuse-v82a on your computer and in your path.

Make sure your user is in the fuse group, and that the line "user_allow_other" is commented in, in the /etc/fuse.conf preferences.

Figure out where the VDI file is that you want to mount. Let's say it is called "myvirtualmachine.vdi".

Make an empty directory to be the mount point of the volume that holds the file systems of your VDI image. Call it e.g. "mountpoint".

Mount the volume with:

vdfuse-v82a -f ~/VirtualBox\ VMs/myvirtualmachine/myvirtualmachine.vdi mountpoint/

 

Make a directory to hold the file system, call it e.g. "file-system".

Mount the file system there:

sudo mount mountpoint/EntireDisk file-system -o loop

This was enough for me, and all files are now visible and editable. I had put the OS directly on the entire disk in th evirtual machine. If there are partitions, maybe there is more mounting to do; I do not know.

You may need to use sudo to add and edit files, if their access restrictions don't match with your user id.

 

 

I have uploaded a new version of gord-vbox-extras to sourceforge. It now has zenity and nautilus and virtualbox-4.0 as formal dependencies. If you run KDE or something else, you can always unpack the package, rather than installing it.



Läs mer: virtualbox.org • View topic - Discuss: Mount any VBox-compatible disk image on the host

 


Make the smallest Debian server for virtual server use

published Dec 11, 2011 11:27   by admin ( last modified Dec 11, 2011 11:27 )

Mikael Ståldal has written a guide of how to make a really small Debian that you can use as a basis for your virtual server.

It still includes networking, bash and most importantly, the Debian package management system. The latter sets it apart from many other small distros, that have their own package management systems. Although the image is still 256 MB, it only consumes 6MB of RAM, which is good for virtual servers, where RAM is one of the more scarce resources.

If one concentrates on virtual servers, it ought to be possible to rebuild and strip the kernel of code that caters for hardware not used. I guess one then needs to analyze what hardware the different virtual environments pretend to provide.

To build a minimal Debian based Linux system with a fully functional bash shell, TCP/IP networking and apt setup to be able to install any package from the Debian repositories. The resulting disk image will be about 256 MB and consume about 6 MB RAM.



Läs mer: How to roll your own Debian based Linux distro | Mikael Ståldal’s technical blog

 


Notes on ttylinux 9.10 for PC

published Dec 11, 2011 07:03   by admin ( last modified Dec 11, 2011 07:03 )

For the small tty Linux 9.10:

  • According to the documentation, root's password is "password". However, it's "root".
  • The install program is listed as being called ttylinux-installer, however it is in fact named installer.

 

There are two initial accounts: root, the administrator account, with password password; user, a user account, with password password

ttylinux User Guide

 


How to get the http (protocol) back in the Firefox url field

published Dec 10, 2011 01:43   by admin ( last modified Dec 10, 2011 01:43 )

Type "about:config" in the url field. Hit return. Type "trim" into the field. Click at the line containing "browser.urlbar.trim" in the search result, to flip it from "true" to "false".

browser.urlbar.trimURLs



Läs mer: GNOME 3 Wins Linux Journal's Readers' Choice Award - Slashdot