Search

gems: broadcast your terminal

January 10th, 2007 edited by lucas

Entry submitted by Martín Ferrari. DPOTD needs your help, please contribute !

Gems is an unknown, little, but efficient program which enables you to broadcast what is seen in your terminal to any number of clients. It’s great for technical lectures and talks, where people often has to make an effort to see what are you typing in the projected screen. It is terminal-agnostic, communicates by any TCP port using very little bandwith and no CPU power, and obviously, it’s free software!

It is very easy to set up, there is no configuration at all, apt-get it and you’re ready to go. In the master terminal, launch the server, optionally specifying a listening port and maximum number of connections (defaults to 6666 and 25, respectively, see the man page for more information), and immediatly you will be given back a shell:

teacherhost:~$ gems-server -port 9999
gems-server initialized.
gems-server: warning: terminal size is greater than 80x25.
teacherhost:~$ cd tmp
teacherhost:~/tmp$ PS1='Hello world class:\w\$ '
Hello world class:~/tmp$
Hello world class:~/tmp$ ls
test.c
Hello world class:~/tmp$

Gems warns you if you are using a big terminal, because clients won’t be able to connect if they have smaller terminals. To connect to a server, just specify address and port:

pupil1:~$ gems-client teacherhost 9999
gems-client: Connection established -- Press 'q' to exit.

Hello world class:~/tmp$ ls
test.c
Hello world class:~/tmp$

When a client connects, he sees only what you type after the connection is made, no screen status is maintained. This is key to its simplicity and compatibility with any type of terminal, but you will have to force screen refreshes as new clients connect (usually just pressing ^L). In this example the client connected just before the ls command was issued.

gems

This is a screenshot of a gems session with clients in the same computer, the focused terminal is the server. You can have different terminal sizes for clients and server as long as the server terminal can fit in the clients.

Links:

gems is included in Debian and Ubuntu since respectively Sarge and Hoary.

Posted in Debian, Ubuntu | 9 Comments »

rlplot: high-quality scientific graphs made easy

January 7th, 2007 edited by lucas

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

If you're looking for an easy way to create and edit professional-quality scientific graphs, why not take a look at RLPlot?

When you run RLPlot, you are shown a spreadsheet screen into which you can enter or copy data. RLPlot's spreadsheet is suprisingly fully-featured for a simple graph-plotting package, and many built-in formulae are available. Once you are happy with the way your data is arranged, simply press Graph -> Create Graph to produce your graph.

Choosing a graph type in RLPlot

There are many different graph types for you to choose from (see screenshot), and RLPlot offers an impressive array of options for customising error bars, axes, labels and data-points. When you have finished, RLPlot shows an editable WYSIWYG view of your graph. In this view you can continue to customise your graph and add additional elements such as annotations, a legend, or even another data plot.

Once you've perfected your graph, it's time to output a copy of it. RLPlot offers a good choice of output options, including the SVG format (ideal if you want to do any further editing in another application). It can also print the finished graph directly.

Editing a graph in RLPlot

While not as powerful as gnuplot, RLPlot offers a quick and simple alternative for creating good-looking graphs of scientific data. It appears to be actively maintained, and there are no major bugs currently known for the current version. RLPlot is available from Debian Stable (a more recent version is available in Testing) and Ubuntu (since Hoary).

Posted in Debian, Ubuntu | Comments Off

sysrqd: small daemon to manage Linux SysRq over network

January 3rd, 2007 edited by ana

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

sysrqd is a tiny daemon aiming to control sysrq over network.

SysRq stands for System Request, and this are functions mapped to keyboard shortcuts by the kernel. You can use them by pressing Alt+SysRq+[key] (SysRq might be named “Print Screen” on your keyboard), where key can be s (sync), k (sak), 0 to 9 (logging level), b (reboot), etc.
The goal of this keyboard sequences is too be available even if you can’t do anything on your box, because you screwed up everything, or because it’s crashed or under very heavy load.

sysrqd can help you to use SysRq keys when you are not in front of your box,and you need to do Emergency Sync, R/O remount and reBoot.

It is designed to respond under heavy load or half-crashed box, so it might work even if you can’t access to your box for example. In this case, you will be happy to telnet to your box on sysrqd port, enter your password, and then press s, u, b and wait for your server to reboot. You would not have been able to do that since ssh was not responding.

The connection is password protected but not cyphered so you might want to firewall it or to run it on a trusted network.

You can find latest version 8 packaged in both Debian and Ubuntu.

Posted in Debian, Ubuntu | 6 Comments »

websec: monitor websites for changes

December 30th, 2006 edited by ana

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

A lot of websites don’t provide RSS feeds yet. When you want to monitor changes to such sites, you can only visit it from time to time, or use public services such as FEED43 or RSSPECT. Websec (Web Secretary) automates the process of regularly visiting the website: it typically runs in a cron job, and compares the content of a web page with what it fetched during the previous run. If the content has changed, it will email it to you with the changed content highlighted.

It works quite well, but has some limitations:

  • You cannot monitor a whole website, but only single web pages ;
  • You can exclude some text from the comparison (typically “Generated in 0.2s”, the current date/time, etc), but I couldn’t get it to exclude multi-line expressions (this makes it impossible to monitor Google results, for example). See bug #402113.

I couldn’t find a package doing the same as websec, but generating an RSS feed instead instead of emailing the changes. If someone want to write one, it might be possible to re-use some of websec’s code.

You can find websec’s homepage at http://baruch.ev-en.org/proj/websec/

Websec has been available in Debian and Ubuntu for several stable releases, and doesn’t suffer from any really annoying bug.

Posted in Debian, Ubuntu | 2 Comments »

scli: a collection of SNMP command line management tools

December 27th, 2006 edited by pipitas

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

Some common daily problems for IT people….

  • You are installing a Laserjet driver for the brandnew Lexmark printer your boss bought, but you do not know: was the darn thing shipped with a PostScript module installed or does it understand PCL only?
  • You are wondering, what the LCD display of the printer down the hall currently indicates, but you’re too busy to get up and walk down?
  • You are bothered by a user who phones “My big HP jammed; though I removed the paper, this red light keeps blinking all the time!”?

Use scli.

scli is the command to invoke the “SNMP Command Line Interface”. A little known console utility, it is of great use to me on many occasions.

Executive summary:

scli connects to any SNMP-enabled network node and lets you interactively “browse” through the values stored in the device’s SNMP database (”MIB”, Management Information Base). My own personal usage is mainly for network printers (yeah, that’s why I picked these examples), but scli can work with many more device types: bridges, routers, gateways, switches, computers and more. (And it also has a scriptable, non-interactive mode).

Target users:

  • users who want to learn what kind of info the devices owned by them do reveal to their network neighbourhood
  • users who are executing a kind of “remote helpdesk” function (in their job, for their friends, or within their own family)
  • users who are just curious about SNMP functions, and want to learn about that resource and about their network nodes
  • users who are somewhat familiar with “snmpwalk”, but not familiar enough to run it without consulting the manpage every time again)

Links:

Glorious details for the curious:

scli does not only give you a more user friendly way than snmpwalk to run SNMP queries, it also formats the results it returns in a more user friendly way. You can run scli interactively (which gives you its own shell+prompt to run different commands) or in a way that just executes one command, displays the result and returns to your standard shell (this mode is also good for scripting stuff).

By default, scli returns plain ASCII text messages. But you can also tell it to return XML by using the “–xml” parameter. (XML may be useful if you want the return to be processed by software, instead of being read by a human).

Assuming the network node you are interested in poking at has the IP address 192.168.23.45. Start the tool by typing

  scli 192.168.23.45

SNMP-enabled devices by default use “public” as their “community name”, and if scli does not see a community name on the commandline, it tries to use “public”.

You wonder what that community name” thingie means? It is a very weak way of authorization; in essence, a password common to all users, but no separate user names. SNMP in version 1 will not even encrypt the community name on the wire! Yes, that’s very bad security for most devices, but that’s how the real life SNMP world around us currently is. (SNMP v2 and v4 are better, but not yet as common in devices used out there).

If you have a less open node, and you happen to know the used “community name”, use it as an additional argument:

  scli 192.168.23.45 "community-name"

If it succeeds connecting, scli will present you its prompt:

  scli > 

It is in interactive mode now. Type “help” to see the available commands. Type “show system info” to find out who the vendor of the device was, and what the model name is. I’m sure you will find more interesting queries of your own quickly.

scli has a good commandline auto-completion (using the [TAB] key) built in. Type “show system [TAB] [TAB]“ to get a list of subcommands other than the “info” we used. You’ll see possible completions “devices info mounts processes storage”. That means “show system storage” is another valid scli full command. Try it.

Of course, you can even try “show system” on its own [without any of the available sub commands]. That makes scli execute all of these subcommands and return all results at once (but piped through a pager).

The same is true for “show [TAB] [TAB]“ or “show” all on its own. Run it and see all SNMP info about of device you are currently accessing.

A few tips will help you get up to speed with scli:

  1. Your most important command to remember with scli is “show scli command [TAB] [TAB]“.
  2. Your most frequently used initial command with scli will probably be “show scli command tree”.
  3. scli ships with a very good man page; make sure to look at it at least one time.
  4. scli can return its qurey results XML-formated, if called with the “–xml” parameter.

scli is available in Debian (stable, testing and unstable all have 0.2.12-2, while experimental has 0.3.0-0.1). If you happen to use 0.3.0, don’t miss to try a scan for SNMP enabled devices in your neighbourhood. At the interactive scli command prompt (scli >), type “run scli scan <a-network-IP-address-in-your-reach>”. Or run scli in command mode from the shell, and type: “scli -c ‘run scli scan <a-network-IP-address-in-your-reach>’” (that network address may be something like 192.168.0.0/24 or 10.162.4.0/22). This scan command is one of the new ones in 0.3; it will present you a list of all SNMP-enabled nodes that respond to the (unsafe) community name “public” (which we didn’t explicitely need to type here). You may want to fix that hole…

scli was created by Prof. Juergen Schoenwaelder, who also is one of the people who created the SNMP standard and wrote the RFCs describing it.


P.S.: Oh, you *really* wanted to know the answers to these initial questions? Ok, here we go:

Is my new Laserjet PostScript-enabled?
kurt:~> scli 192.168.23.45 -c "show printer interpreters" | grep Description
Description:   Lexmark PCL
Description:   Lexmark PostScript
Description:   Lexmark XL
Description:   Lexmark PJL
Description:   Lexmark Automatic Language Switching
Description:   Lexmark NPAP

So, whatever “NPAP” is — PostScript is supported as well. It will be easy to print to it from CUPS…
 
 

What’s on the LCD display on that remote printer right now?
kurt:~> scli 192.168.23.45 -c "show printer display"
PRINTER LINE   TEXT
      1    1   No Paper: Tray 4

Uuhh, and you wondered why that thing didn’t give any noise since 2 hours…
 
 

Why doesn’t that red light stop flashing on that printer?
kurt:~> scli 192.168.23.45 -c "show printer covers"
Printer:      1
Cover:        1
Description:  Rear Door
Status:       coverOpen

Printer:      1
Cover:        2
Description:  Top Door
Status:       coverClosed

So, that’s easy. Tell your user: “Please shut that darn Rear Door again and the flashing red light will go away.”



Posted in Debian, Ubuntu | 9 Comments »

« Previous Entries Next Entries »