Search

ipcalc: network calculator on the command line

August 22nd, 2007 edited by lucas

Article submitted by Javier Barroso. We are running out of articles ! Please help DPOTD and submit good articles about software you like NOW !

Ipcalc is a command-line tool which allows the user to get useful data from a ip and a netmask.

Ipcalc returns the network address, netmask, network address in CIDR notation, min/max IP addresses, broadcast address and the number of hosts of network.

Ipcalc usage is:

Usage: ipcalc [options] <ADDRESS>[[/]<NETMASK>] [NETMASK]

A example could be:

$ ipcalc 10.0.0.28 255.255.255.0
Address:   10.0.0.28            00001010.00000000.00000000. 00011100
Netmask:   255.255.255.0 = 24   11111111.11111111.11111111. 00000000
Wildcard:  0.0.0.255            00000000.00000000.00000000. 11111111
=>
Network:   10.0.0.0/24          00001010.00000000.00000000. 00000000
HostMin:   10.0.0.1             00001010.00000000.00000000. 00000001
HostMax:   10.0.0.254           00001010.00000000.00000000. 11111110
Broadcast: 10.0.0.255           00001010.00000000.00000000. 11111111
Hosts/Net: 254                   Class A, Private Internet

Ipcalc has been available in Debian at least since v3.1 (’Sarge’) and in Ubuntu since Warty. apt-get install ipcalc will install it for you.

Posted in Debian, Ubuntu | 8 Comments »

jed - Pocket sized emacs

August 19th, 2007 edited by Tincho

Article submitted by François-Denis Gonthier. We have run out of good articles! Please help DPOTD and submit good articles about software you like!

I’m a big fan of GNU Emacs, it’s a very powerful and ultra customisable editor. I have it setup just the way I want, with tons of packages. That means that although my Emacs setup suits me fine for long coding sessions, it takes several seconds to start, even on a moderately fast computer.

When you work in a console, and all you want is to edit some files, and edit them now, you gotta have something that starts in a snap. Jed is the editor I use for that.

Jed
Jed showing a bit of Emacs code.

The obvious advantages of Jed are that it starts much faster than Emacs, but still provides the basic key-mappings and features of the default Emacs setup. Out of the box, it supports syntax colouring for several programming languages: C/C++, S-Lang, FORTRAN, LaTeX, Java, Python, Perl, Bash and more. Since it’s an extensible editor, several add-ons (modes) have been written and are available in the Jed Modes Repository.

For people that are interested in having a full-featured editor, but aren’t crazy about the Emacs key bindings, Jed has a nice console menu interface. Menus can be activated with the F10 key, and then browsed with the arrows key, just like the ol’ DOS editors. Most menu items also have shortcuts, for quicker access the next use. For the less expert users, like myself, menus are very useful; but avoiding the F10 key at the corner of the keyboard is a time saver, as tiny as it may sound.

The Jed menus come with some nice touches that Emacs has acquired just recently. In the “Windows” menu, you can see that Jed offers 9 different colour themes for the terminal, a nice touch for people allergic to white-on-black text, or with difficult display devices.

I personally use Jed as a light editor, but Jed is a very customisable platform. It is linked with the S-Lang library, which can be used to heavily customise the editor. I know little of the S-Lang language, just what I need to set a few shortcuts, but the S-Lang functions provided by Jed are well documented on its home page: http://www.jedsoft.org/jed/doc/jedfuns.html

It is also interesting to know that Jed has a native X11 interface, which is installed by the xjed package. Jed is not as well adapted to X11 than Emacs is, but XJed does bring some interesting improvements like mouse support, and of course key bindings which are not limited by any terminal protocol. Personally, I think that the XJed default configuration should be edited a bit (I use Ubuntu, but tend to suppose it’s not very different in Debian). When XJed starts on my computer, it looks like Jed was started in XTerm, with extremely tiny fonts, and an ugly font. I am sure XJed can be conveniently and easily configured but giving you a bad first impression of Jed is not something I want. I suggest you to try running the console version of Jed in your favourite terminal emulator, then play with it a bit.

The final proof that Jed is a mature and fully-featured editor is that it obeys Zawinski’s Law (Zawinski’s Law), which state that “a program attempts to expand until it can read mail”. Jed has a mail reader called rmail, it can be invoked by hitting M-x (Alt+x) then typing rmail.

Jed has been available in Debian and Ubuntu for ages.

Quick start shortcuts

Here is a few shortcuts you may find useful while playing with Jed for the first time. As usual, C = Ctrl, M = Meta (usually Alt).

C-h
Invoke the help system
C-x C-c
Quit jed
C-x C-f
Open a file
C-x C-k
Close a file
C-x 2
Split a window
C-x o
Move to the next window
C-SPACE
Set the beginning of selection (C-SPACE cancels selection region)
C-Shift-w
Cut
M-Shift-w
Copy
C-y
Paste
C-a
Go to the beginning of line
C-e
Go to the end of line

Posted in Debian, Ubuntu | 12 Comments »

ttf-inconsolata: an open font for your terminal and for nice code printouts

August 15th, 2007 edited by ana

Article submitted by Nicolas Spalinger. We have run out of good articles! Please help DPOTD and submit articles about software you like!

You love the command-line interface but you also want things to look good and be free as in freedom? Maybe you’re looking for a good open font to use when you code? or something to make your code snippets look even better in a printed publication?

Then check out ttf-inconsolata!

What is it?

Inconsolata is a monospace font designed by Raph Levien of Advogato and Ghostscript fame (and quite a few other things).

It is a high-quality font released under the Open Font License (OFL), the community-approved free license specifically designed for fonts and collaborative font design. (See http://scripts.sil.org/OFL for all the details including a extensive FAQ).

Screenshots taken from inconsolata’s website:

How does it compare to other fonts?

This fonts really stands out compared to other fonts out there for the following reasons:

It’s an open font which comes with sources! The great thing about this font is that extended sources - not just the ttf - are made available by the designer: the Fontforge .sfd and the Spiro .plate sources are available on the upstream website and in the source package. A Type1 version of the font is also available.

It is a collaborative font project: you can freely use, study, modify, redistribute and/or sell the font under the terms of the OFL which means you are free to derive artwork from the font, to embed it in a pdf, to branch, extend and tweak the fonts to your liking. You can also send a patch to contribute to Raph’s project.

It is also the result of cutting-edge innovation. Raph has been using his own font design toolkit called spiro to design Inconsolata. Spiro is based on revolutionary curve technology implementing Euler spirals. The spiro toolkit also includes various optimisation scripts. See http://levien.com/spiro for all the details.

It is work in progress (the coverage is mainly Basic Latin, Latin Extended-A and Latin-1 Supplement at this stage) but it is already very useful as such and has great potential to grow to support more Unicode blocks as needed.

This open font project is being generously sponsored by the TeX Users Group Development Fund which you can contribute to.

You can also use Inconsolata directly from your TeX environment using newer implementations like XeTeX or pdfTeX.

Alright, how do I get it?

Thanks to work done by the Debian fonts task force (See the corresponding Alioth project), Inconsolata is now available in Debian unstable and Debian testing. It will soon be sync-ed to Ubuntu.

It is co-maintained by the pkg-fonts team and the mirror Ubuntu fonts team. These teams are part of the open font movement working on improving the availability of high-quality open fonts, packaging the existing ones, integrating them with the wider free desktop stack, getting a toolkit together to do open font design and of course engaging more designers to release fonts under the OFL.

You can find other open fonts designed by Raph on his OFL fonts page

And many other open fonts projects are listed at: http://unifont.org/fontguide, http://scripts.sil.org/OFL_fonts and http://www.openfontlibrary.org/

Free the glyphs :)

Posted in Debian, Ubuntu | 18 Comments »

xdiskusage: where is the space?

August 12th, 2007 edited by ana

Article submitted by Carles Pina from Catux-LUG. We have run out of good articles! Please help DPOTD and submit good articles about software you like!

Have you ever wished to know where are those files that waste space on your hard drive? Have you ever wondered which folder contained the most gigabytes? Your wishes had become true! xdiskusage is your application.

Using xdiskusage you can discover very easily how your hard drive’s directories are organised, and specially how much space is used by each one.

After executing xdiskusage without arguments, the initial default view will be the list of partitions:

Main view

By double-clicking in some partition you will get the list of the biggest directories (arranged by size) and the space that each one is using:

root view
(notice that free space is shown as another directory)

You can double-click in any other directory to explore it. Right-clicking shows a menu with some options like hide, unhide, go in, go out, etc. Just play with it!

xdiskusage is also a fantastic complement for “du”:

$ cd /tmp
$ du | xdiskusage

You can give any directory as an argument to xdiskusage:

$ xdiskusage /usr/src

One last thing: the -a switch shows files and not only directories:

File view

Alternatives

In Debian you can fine some alternatives to xdiskusage like:

  • gt5: not in Debian Etch. HTML based, needs a browser to navigate (text or graphical)
  • baobab: GTK based
  • filelight: KDE libs based
  • kdirstat: KDE based

The last three of them are more eye candy than xdiskusage, but I preferred a simpler solution, without that many dependencies. Of course, feel free to test and choose!

Notes

xdiskusage has been available in both Debian and Ubuntu since a long time ago.

Note that there is a bug that doesn’t allow the application to be launched by app-launchers such as Alt + F2 or menus. It’s a reported bug (Debian bug #276193).

Thanks to Fran Hermoso for correcting the text again, and to Muzzol from the Catalan-Ubuntu mailing list for commenting it.

Posted in Debian, Ubuntu | 10 Comments »

KRename: powerful renaming tool

August 8th, 2007 edited by ana

Entry submitted by Matej Urbančič. DPOTD needs your help, please contribute!

Quick overview

KRename is a powerful batch renaming tool for KDE that allows to rename lots of files in one step. The design of the program is suitable for both advanced and novice users.

Program description

KRename supports batch renaming of files based on a set of predefined and adjustable expressions. It can also copy or move the files to another destination. Among the most notable operations are: case-toggling of file names, numbering and powerful finding and replacing. It supports changing access and modification dates, permissions, and file ownership. It can work recursively. The more demanding audience can do magic with the support for regular expressions. It can be used in tabbed mode or the more comfortable wizard mode, whatever you prefer, when sorting your picture collection, music library or project files.

KRename follows the paradigm of console based commands that can really be used for any purpose. Since not all of us feel comfortable writing our own scripts, such tools really are a perfect replacement. The biggest advantage of KRename is surely its simple and straightforward interface and a great set of possibilities, which gives power even to not so knowledgeable users.

The tabbed mode includes four tabs. On the first tab we select files and directories in many different view modes and sort options, and through support for global KDE file types we can actually see which files are being changed. We need to define what should the program do with the locations of the files in the second tab. Usually we rename existing files in some directory, but the program can also move them to another location. The third tab defines the plug-ins to be used for some special operations, such as using data extracted from the file to determine its new name (it supports avi, ogg, pdf, jpg, bmp, mp3, deb, rpm, emails, etc), changing permissions.

In the last tab we define what exactly we want to do with the settings we selected and how to shape the file name. There are many predefined sets of expressions, but we can also make our own. KRename supports regular expressions, which can really make a difference.

For the wizard mode, the first two steps are very similar to the first two tabs, whereas the third —and last— step combines the other two tabs in a simpler interface.

Screenshots

Tabs view:
krename - 1st tab krename - 2nd tab krename - 3rd tab krename - 4th tab

Wizard view (last step):
krename - wizard mode

Additional Information

In the homepage you can find a support forum, and more screenshots. It is programmed in C++, using the Qt/KDE framework, and has been integrated in Krusader and the Konqueror file manager.

It has been available in Debian and Ubuntu since a long time ago.

Posted in Debian, Ubuntu | 3 Comments »

« Previous Entries Next Entries »