Technology and Software

Batch converting images with ImageMagick

Another years late post.

Suppose you want to convert the blue Dojo Toolkit theme to another color. How you do it? Run this command of the ImageMagick suit on all the images in the src/widget/templates hierarchy

convert -modulate 100,100,45 <blue_image.xyz> <green_image.xyz>

This rotates the color wheel by 45 degrees and keeps the other parameters constant. The result is a light green theme. You have to update all the css files too and that’s way more time consuming. However, with a simple conversion can applies to HTML colors with this particular color rotation : just convert all the occurences of #rrggbb into #rrbbgg!

Advertisements
Standard
Technology and Software

Securing a CVS server with ssh

This post is years late, so it’s more a reminder to me than something useful to other people. I goggled for the instructions, here’s the summary.

Goal: set up a CVS server, authenticate access with ssh, don’t give a shell to users.

Requisite: Start with a working CVS repository

Recipe: (Unix-like systems only)

  1. Each user creates a public/private key pair, using ssh-keygen -t dsa with an empty passphrase. This is the most important thing not to miss: the permissions of the private key file must make it accessible only to the owner; chmod 600 .ssh/id_* will do.
  2. The users send the public key file ~/.ssh/id_dsa.pub to the administrator of the server.
  3. The administator creates a user for each of them on the server (doesn’t allow login for further security) and puts a copy of the public key file in the .ssh directory of their home directories.
  4. The file .ssh/authorized_keys must contain the line

command=”/usr/sbin/cvs -allow-root=<cvs repository dir> server”,no-port-forwarding,no-pty,no-X11-forwarding,no-agent-forwarding dsa <the public key>= user@domain

Note the server parameter to the cvs command. The last part of the line must be pasted directly from the the public key file.

Test:

The user sets the CVSROOT environment variable and checks out the files
export CVSROOT=:ext:<user@cvs.server>:<path to repository>
cvs co <project>

Note that ssh user@cvs.server won’t give a shell to the users, wheter or not the administrator granted login permissions at the creation of the accounts. The cvs server command is run instead.

See http://ioctl.org/unix/cvs/server and countless other documents for the details.

Standard
Technology and Software

Learning Dojo

I decided to finally give a try to the Dojo toolkit. The documentation looks pretty good at explaining the foundations of the toolkit (the core library, the event and IO systems) but it’s very sparse in documenting the widgets. The best resources I found to far to learn about them are the test pages for the nightly builds. The index is here. The API reference should be linked to there to provide code samples.
For the same reasons the root of the test pages hierarchy is also very precious.

By the way, let me cite one pass of the Dojo wiki, which casts light on a subject of extraordinary importance: “Geeks, Nerds, and Dorks: A geek has a very focused knowledge of a subject (that guy that memorized the language of myst), a nerd is a master at many subjects (that girl you go to when you need homework help), and a dork is just plain socially inept (Napoleon Dynamite).” (the link is mine)

Standard