Search

agave: Design colour schemes the easy way

January 28th, 2007 edited by ana

Entry submitted by Phil Bull. DPOTD needs your help, please contribute !

Agave (formerly GNOME Colorscheme) is a simple GNOME utility for generating colour schemes.

Select a base colour and Agave will suggest a small set of colours which complement it. You can choose from several types of colour scheme; for example, selecting ‘Monochrome’ results in a scheme of different shades of the same colour, whereas ‘Complements’ just gives two colours which complement each other. If the scheme Agave suggests isn’t ideal, you can increase and decrease both the brightness and saturation of the scheme as a whole using the buttons on the toolbar.

Agave colour scheme generator

You can select any colour on the screen as a base colour by using the ‘dropper’ tool (hidden away in the colour picker dialog). Three different representations of the colours in your colour scheme are given: Hex, RGB, and HSV, and copying the colours into a graphics application is simply a matter of dragging-and-dropping them. If you design websites and edit CSS, Agave may come in useful - particularly when your imagination fails you. The random button generates a random colour scheme, and repeatedly pressing it soon results in a usable combination of colours for you to use.

A small irritation is the limited number of colours allowed per colour scheme. While 2-3 colours may be fine when decorating a room, websites and graphics projects often require several more. Apart from this, Agave appears to have no major bugs, and most of the issues filed in its bug tracker are feature requests. There are several translations available, too. KColorEdit (the KDE equivalent) can handle colour palettes, which makes it more useful to graphics designers at the moment. However, Agave is still a young project and offers some novel features which anyone working with colour will appreciate.

Agave is available in Ubuntu Edgy (universe) and Debian Etch.

Links

Posted in Debian, Ubuntu | 4 Comments »

apt-file: search for files in packages, installed or not

January 24th, 2007 edited by lucas

Entry submitted by Paul Sundvall. DPOTD needs your help, please contribute !

Have you ever tried to compile some tar-ball and had to download missing dependencies? In that case, you probably needed to find out which packages were needed to fix those dependencies. Sometimes there is a README which states what you need, but that might not be that helpful sometimes.

One way of finding out which package needs to be installed is to use the debian package search page.

Another way is to use apt-file instead. It works as a local search engine, based on the apt sources you have in /etc/apt/sources.list.

To use apt-file, build the search database by issuing apt-file update as root. Then, as an ordinary user, search for a file with apt-file search file and you get the package names which contain the file you look for. Install them with apt-get, and your missing dependencies are gone with the wind!

apt-file is located in package apt-file in both Debian and Ubuntu.

after install, build the search database with apt-file update.

Example:

I tried to compile a simple pam example, which gave the following output:

pauls@voltaire:~/code/eget/all/pam$ make
gcc  pamexample.c  -o pamexample -lpam -lpam_misc
pamexample.c:12:31: error: security/pam_appl.h: Filen eller katalogen
finns inte
pamexample.c:13:31: error: security/pam_misc.h: Filen eller katalogen
finns inte
[...]

Seems like I need the (for me) unknown file pam_appl.h. Time to use apt-file!

pauls@voltaire:~/code/eget/all/pam$ apt-file search pam_appl.h
libpam-doc: usr/share/doc/libpam-doc/html/pam_appl.html
libpam0g-dev: usr/include/security/pam_appl.h
lsb-build-base2: usr/include/lsb2/security/pam_appl.h
lsb-build-base3: usr/include/lsb3/security/pam_appl.h
pauls@voltaire:~/code/eget/all/pam$

It seems like I should install libpam0g-dev

pauls@voltaire:~/code/eget/all/pam$ su -
voltaire:~# apt-get install libpam0g-dev
Reading package lists... Done
Building dependency tree... Done
The following NEW packages will be installed
  libpam0g-dev
0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
Need to get 118kB of archives.
After unpacking 365kB of additional disk space will be used.
Get: 1 http://merkel.debian.org unstable/main libpam0g-dev 0.79-4 [118kB]
Fetched 118kB in 2s (47.9kB/s)
Selecting previously deselected package libpam0g-dev.
(Reading database … 123647 files and directories currently installed.)
Unpacking libpam0g-dev (from …/libpam0g-dev_0.79-4_i386.deb) …
Setting up libpam0g-dev (0.79-4) …
voltaire:~#logout

let’s try to compile again:

pauls@voltaire:~/code/eget/all/pam$ make
gcc  pamexample.c  -o pamexample -lpam -lpam_misc
pauls@voltaire:~/code/eget/all/pam$

It works!

Posted in Debian, Ubuntu | 5 Comments »

pypar2: a par2 graphical frontend

January 21st, 2007 edited by lucas

Entry submitted by François Ingelrest. DPOTD needs your help, please contribute !

Do you often download some binary content from Usenet servers? Then you know what .par2 files are useful for, and that there is no decent GUI to handle them.

For those who don’t know par2, let’s make it simple: it’s an utility used to protect files against data loss. It’s able to do that by creating redundant data (“parity files”). For example, if you create parity files with a redundancy level of 5%, you may be able to recover your original files if the amount of corrupted data is less than 5% (corrupted data may be located anywhere in any files). Such parity files may be used whenever data loss is expected: Usenet servers, cheap CD/DVD ROMs…

To check/repair some files, or to create these parity files, you have to open a terminal and use the command line. This works flawlessly but this not really user friendly, especially for distributions aimed at human beings. There exists a replacement named gpar2, but it uses some extra libraries and I’m sure that many of you don’t like to install extra libraries when it’s not really needed.

PyPar2 is a simple graphical frontend, written in Python: thus even if a package is not available for you system, you don’t have to compile anything. Here is how it looks like:

PyPar2 is designed to be very easy to use. Here are a list of its features:

  • Advanced settings are available, but hidden by default
  • There is no preferences dialog, all selected options are automatically saved and restored
  • Multiple languages are available:
    • English
    • French
    • German
    • Polish

PyPar2 is available in Debian unstable/testing and Ubuntu Feisty repositories. The “final” 1.0 release is coming soon, with many code changes, so stay tuned! If you would like to add support for a new language, please contact me first at Athropos - AT - gmail - DOT - com to be sure to use the latest language definition.

Links:

Posted in Debian, Ubuntu | 1 Comment »

rlwrap: use readline’s line editing with all applications

January 17th, 2007 edited by lucas

Entry submitted by arno. DPOTD needs your help, please contribute !

Many command-line-oriented applications don’t provide features like history, completion or line-editing. rlwrap wraps readline (which is the library behind those features in bash and many other applications) around any line-oriented command. So you can take advantage of history, completion and editing facilities, even with applications that don’t provide them. rlwrap is the kind of tool that, once discovered, makes you wonder how you could have lived without it.

For example, telnet or netcat don’t have editing facilities, neither history. With rlwrap, system administrators will then be able to use those tools more efficiently. Also, launching dash can sometimes help testing compatibility for a few lines of shell code. Unfortunately, line editing with dash is not very pleasant. With rlwrap, it becomes possible to have completion and history in dash.

By default, history is saved in a specific file for each program: your history will be kept even after exiting the program, and will not conflict with other apps.

Just as readline, you can customize rlwrap with ~/.inputrc file. You can also define, for each application, a list of keywords. rlwrap will then perform completion on those words.

With socat, you can also wrap readline around any program. Socat is much more than a readline wrapper: using it only for that purpose would be not only overkill, but also more complex. Another readline wrapper is cle (Command Line Editor). It’s a great tool, but it has not been developed since 1999. Rlwrap is now more powerful, providing more options, with more configuration capabilities.

Target Usages:

Users of applications such as netcat, telnet, dc, that don’t link with readline, and whose editing possibilities are limited.

Tip:

If your shell supports it, you may find useful to define aliases for commands you often use ; for example: alias netcat="rlwrap netcat".

You can find rlwrap’s homepage at http://utopia.knoware.nl/~hlub/uck/rlwrap/

rlwrap is available in Debian (0.21-1 in sarge, 0.28-2 in unstable) and Ubuntu (0.24-1 in dapper and edgy).

Posted in Debian, Ubuntu | 6 Comments »

mozart: The Mozart Programming System

January 14th, 2007 edited by ana

Entry submitted by Kari Pahula. DPOTD needs your help, please contribute !

Mozart is an implementation of Oz, a multiparadigm programming language, with a strong support for concurrent and distributed computing and for solving problems involving optimization and inference.

Some of Oz’s distinctive features are single assignment variables and binding. For example, you can do declare A B C and then execute C = A and [A 2] = [1 B] ([] marks a list in Oz) and have A = 1, B = 2 and C = 1 in the end.

Being single assignment variable means that executing A = B would be a runtime error. If needed, you could create new computation spaces where you could safely create condtradictions and examine the failures from outside.

Another one of Oz’s features is transparent support for concurrency. You can try out the next example yourself if you have no aversion towards using Emacs by installing mozart for yourself and feeding it line by line to the emulator. Start the X Mozart programming environment from the menu and go through it line by line and press C-. C-l as you go.

What you type

What you see

declare H W
{Inspect rect(width:W height:H area:thread W*H end)}

rect(area:_ height:_ width:_)

H = 20

rect(area:_ height:20 width:_)

W = 45

rect(area:900 height:20 width:45)

What happens in this example is that the thread started for counting the area suspends until both W and H are bound to a value. Once both are known, the thread continues execution and sets the corresponding field in the rect record.

Any of the above didn’t involve state at all. With Mozart, you can get by quite far within the declarative model itself. But when needed, there are two (equivalent) abstractions available for stateful operations. One is chunks, which operate much like regular variables with destructive updates. The other is ports, which are many-to-one communication channels. If you’re familiar with Erlang, you’d recognize them to be similar to the message passing used in it.

As an example, let’s write an echo server.

declare Echo
local
   Xs P
   {Port.new Xs P}
   proc {Consume Xs}
      X|Xr = Xs  % suspends until a new list item arrives to Xs
   in
      {Inspect X}
      {Consume Xr}
   end
   thread {Consume Xs} end
in
   proc {Echo M}
      {Port.send P M}
   end
end

This is only a small scratch on the surface of what Oz and Mozart can do. Even if you’re not going to start writing programs using Mozart yourself, the concepts behind it are well worth knowing for any self-respecting programmer.

Links

Mozart is available for most 32-bit architectures in Debian Woody, Sarge and Etch. The changes between 1.3.1 and 1.3.2 are relatively minor, so you won’t be missing much if you’re using the version in Sarge. It is also available in Ubuntu since Warty.

Posted in Debian, Ubuntu | 2 Comments »

« Previous Entries Next Entries »