log file when the script fails !

i have a script that will retrive some info from database. The script is working fine but i have to add new feature in it when the script fails or retrive null result it should reflect in the log file. below the script AMR_Inactive.sh Code: --------- while read i do

Categories: Computers | Linux | nix | The UNIX and Linux Forums | UNIX
fsarchiver 0.2.7 (Default branch)

fsarchiver is a system tool that allows you to save the contents of a filesystem to a compressed archive file. The filesystem can be restored on a partition that has a different size, and it can be restored on a different filesystem. Unlike tar/dar, fsarchiver also creates the filesystem when...

Categories: Computers | Linux | nix | The UNIX and Linux Forums | UNIX
phpDiveLog 0.3.1 (Default branch)

Image: http://c.fsdn.com/fm/screenshots/47640_thumb.png phpDiveLog displays the information of your Aqua DiveLog LogBook based on CSV files you generate with the Java Conduit shipped with Aqua DiveLog. These dynamic pages are nicely and lucidly formatted. phpDiveLog allows you to combine these...

Categories: Computers | Linux | nix | The UNIX and Linux Forums | UNIX
Daniel Holbach: It's cold in Berlin

Hardly surprising - it’s winter.

Funnily enough my panel applet said it was 4 °C for some weeks now. This surprised me because the ice and snow outside, the freezing canal nearby and my chattering teeth when I was walking the dog definitely felt a lot lot colder.

It looked like the 4 °C in the applet were stuck somehow.

It struck me yesterday: I had set the applet to Berlin Tempelhof airport (since it was closest to me), but as it was closed down a few weeks ago, the 4 °C stuck. Now that I set it to Tegel, it’s all “good” again:

It’s just f.cking cold.


My 5 today: #313987 (git-cola), #303316 (gourmet), #46435 (netgo), #312723 (gtksourceview2), #313279 (gnome-pkg-tools)
Do 5 a day - every day! https://wiki.ubuntu.com/5-A-Day



Categories: Computers | Linux | nix | Planet Ubuntu | Ubuntu
On event processing and some interesting queries

2009-01-05T23:45:00.017+02:00 Image: http://4.bp.blogspot.com/_2ExAgtF_Qgk/SWKCG4EgrgI/AAAAAAAAAVk/IYCt6w6oXHc/s320/Fish_market_Guadeloupe.jpg (http://4.bp.blogspot.com/_2ExAgtF_Qgk/SWKCG4EgrgI/AAAAAAAAAVk/IYCt6w6oXHc/s1600-h/Fish_market_Guadeloupe.jpg)Some people have returned from the vacation...

Categories: Computers | Linux | nix | The UNIX and Linux Forums | UNIX
GTK+ 2.15.0 (Development branch)

GTK, which stands for the Gimp ToolKit, is a library for creating graphical user interfaces. It is designed to be small and efficient, but still flexible enough to allow the programmer freedom in the interfaces created. GTK provides some unique features over standard widget libraries. *License:*...

Categories: Computers | Linux | nix | The UNIX and Linux Forums | UNIX
VNC "Access Denied"

Hi guys, I am having a problem with my VNC, Actually i am using my VNC session for last two month. but now it's show me the "Access denied" when i am trying to access it. I checked the logs, then i found it has blacklisted by server. error is something like "Connections: rejecting blacklisted...

Categories: Computers | Debian | Fedora | Gentoo | Linux | Mandriva | nix | RedHat | Slackware | SUSE | The UNIX and Linux Forums for Linux | Ubuntu
how to execute java in specified time- urgent

Hi, 1. I want to execute a set of java files(a small appln) at specified time interval in solaris. that java uses documentum DFC calls. 2. How can i do this? from thread i chked ppl suggest to do cron, and so.. pls provide me a details steps hence i am new to solaris.. Any...

Categories: Computers | Linux | nix | The UNIX and Linux Forums | UNIX
Formatting digits

I want to check the argument in KSH. If the user type in the prompt 'find 3' it will format 3 to 003 to match the data in the text file. Same as with 10 to 010. Always begins with 0. eg. >find 3 Output: 003 >find 30

Categories: Computers | Linux | nix | The UNIX and Linux Forums | UNIX
The Followers - Part 1

2009-01-06T09:14:55+01:00 Image: http://geekandpoke.typepad.com/.a/6a00d8341d3df553ef010536ad0a1d970b-800wi (http://geekandpoke.typepad.com/.a/6a00d8341d3df553ef010536ad0a1d970b-pi) Image: http://feeds.feedburner.com/~f/GeekAndPoke?i=hc7K6M.P ...

Categories: Computers | Linux | nix | The UNIX and Linux Forums | UNIX
Jono Bacon: I Invented Twitter

Well kind of…in a way…possibly…OK, not at all.

The other day I was digging through some old articles that I wrote. To my amusement, I saw a reference to a little program I hacked up once when I was involved as a KDE developer. I had totally forgotten about it, and I figured it would be fun to share the story.

Back in the year 2000 when I was starting University, I spent every evening between midnight and 6am hacking on code. Fuelled by six cans of coke every night, I barely slept for those few years: I was running on three or four hours of sleep for most nights. Every evening I was excited to fire up my concrete brick of a laptop, check out the latest KDE CVS and taste the latest crack of the day. This inspired me to want to contribute to the project in some way.

It was a bit of a trial by fire. I was not only learning C++ but also Qt and the KDE bindings. To be frank, I was not very good. But I tried hard, I learned a lot, and mostly importantly, I had a lot of fun.

Throughout this time I wrote a bunch of little programs. One of these programs was called KWebStat, and this what I re-read about the other day. Using the wonder of the Wayback Machine I managed to find the old homepage for it which included a screenshot:

See a bigger screenshot

When I read the article, I realised the program was a simple, primitive equivalent to what we now know as Twitter: it put a current status update online. KWebStat was a little different: instead of writing a message, you could click some buttons to indicate what you were doing at that moment, and you could set custom activities to show. KWebStat was a lot more primitive than Twitter though: it updated a static HTML page and you needed some magic to get that page online, but the basic premise was there. There were a few niceties though: KWebStat could grab which song you were listening to in your CD or music player as well as grab a screenshot and put that online. It was a pretty primitive first implementation of status-blogging, and I used it on my old homepage.

So, if the Twitter folks would kindly send over a portion of that mountain of gold that they have, it would be appreciated.

Hugs, Jono.



Categories: Computers | Linux | nix | Planet Ubuntu | Ubuntu
The Top Ten Cybersecurity Threats for 2009 - Draft for Comments

Following up on my 2008 list (http://www.thecepblog.com/2008/01/05/the-top-ten-cybersecurity-threats-for-2008/) of top cybersecurity threats, I have just published The Top Ten Cybersecurity Threats for 2009 for public comments...

Categories: Computers | Linux | nix | The UNIX and Linux Forums | UNIX
Ted Gould: Let applications be applications

One thing that kept bothering me in the GNOME UI Hackfest was how little data applications export out to the desktop. As I was in the shell group we were discussing various things that we wanted to do and John Mccann kept having to remind me not to worry about the implementation as I would get frustrated that we simply didn't have the data. I want to fix this. I want to have the data in a structured way.

What I've come to realize is that we need to let applications be applications, let panels be panels and let applets be applets. With the notification area specification we created a way for applications to break through this barrier and put a little segment of the application into the panel. While this sounds great, and it has created a quick way to prototype some interesting ideas, it's also created a complete mess in our panels. There is no consistency of action nor in look for that section of the panel. I like to call the notification area the "bag of crap." While it's created a way for applications to innovate, it's drastically stalled innovation for panels and shells.

What I'd like to put forward is the idea of little flags that applications can hold up to say what they're thinking or doing, which I'm going to call indicators. The application can then represent in a structured way that it's got something of interest to the desktop as a whole, and then the desktop can represent that to the user. How ever it likes. It's not the application's responsibility to figure out how to do this, or if it needs to be done in a single place or multiple, or anything other than raising the flag. While I think that this might frustrate application developers at first in that they don't have control over the display of this information, I think that long term it will empower them in that they don't have to fiddle with this type of interaction any more.

First off I want to build something simple (start small, think big), the messaging indicator, which will mostly consist of a GNOME panel applet. It will do simple things like represent IMs and e-mail and not a lot more, but the real goal is starting to get applications like Evolution and Pidgin to export this information. Once we're there, then we can start to look at new ways to use it. I love the idea of having the Evolution icon having the number of unread messages a la Apple or Gwibber also putting messages in the messaging indicator. Those are all next steps, but I think important ones in starting to explore how we can get data out of the applications and to the users in usable and attractive ways.



Categories: Computers | Linux | nix | Planet Ubuntu | Ubuntu
ImgMod3 1.1.0 (Default branch)

Image: http://c.fsdn.com/fm/screenshots/71482_thumb.jpg ImgMod3 is a simple image cropping, scaling, and modification tool. It is built with a single purpose: to be able to handle a large number of files quickly, while retaining manual control. It uses PIL for the image processing operations and...

Categories: Computers | Linux | nix | The UNIX and Linux Forums | UNIX
James Henstridge: Using Twisted Deferred objects with gio

The gio library provides both synchronous and asynchronous interfaces for performing IO.   Unfortunately, the two APIs require quite different programming styles, making it difficult to convert code written to the simpler synchronous API to the asynchronous one.

For C programs this is unavoidable, but for Python we should be able to do better.   And if you’re doing asynchronous event driven code in Python, it makes sense to look at Twisted.   In particular, Twisted’s Deferred objects can be quite helpful.

Deferred

The Twisted documentation describes deferred objects as “a callback which will be put off until later”.   The deferred will eventually be passed the result of some operation, or information about how it failed.

From the consumer side, you can register one or more callbacks that will be run:

def callback(result):
    # do stuff
    return result

deferred.addCallback(callback)

The first callback will be called with the original result, while subsequent callbacks will be passed the return value of the previous callback (this is why the above example returns its argument). If the operation fails, one or more errbacks (error callbacks) will be called:

def errback(failure):
    # do stuff
    return failure

deferred.addErrback(errback)

If the operation associated with the deferred has already been completed (or already failed) when the callback/errback is added, then it will be called immediately. So there is no need to check if the operation is complete before hand.

Using Deferred objects with gio

We can easily use gio’s asynchronous API to implement a new API based on deferred objects.   For example:

import gio
from twisted.internet import defer

def file_read_deferred(file, io_priority=0, cancellable=None):
    d = defer.Deferred()
    def callback(file, async_result):
        try:
            in_stream = file.read_finish(async_result)
        except gio.Error:
            d.errback()
        else:
            d.callback(in_stream)
    file.read_async(callback, io_priority, cancellable)
    return d

def input_stream_read_deferred(in_stream, count, io_priority=0,
                               cancellable=None):
    d = defer.Deferred()
    def callback(in_stream, async_result):
        try:
            bytes = in_stream.read_finish(async_result)
        except gio.Error:
            d.errback()
        else:
            d.callback(bytes)
    # the argument order seems a bit weird here ...
    in_stream.read_async(count, callback, io_priority, cancellable)
    return d

This is a fairly simple transformation, so you might ask what this buys us. We’ve gone from an interface where you pass a callback to the method to one where you pass a callback to the result of the method. The answer is in the tools that Twisted provides for working with deferred objects.

The inlineCallbacks decorator

You’ve probably seen code examples that use Python’s generators to implement simple co-routines. Twisted’s inlineCallbacks decorator basically implements this for generators that yield deferred objects. It uses the enhanced generators feature from Python 2.5 (PEP 342) to pass the deferred result or failure back to the generator. Using it, we can write code like this:

@defer.inlineCallbacks
def print_contents(file, cancellable=None):
    in_stream = yield file_read_deferred(file, cancellable=cancellable)
    bytes = yield input_stream_read_deferred(
        in_stream, 4096, cancellable=cancellable)
    while bytes:
        # Do something with the data.  For this example, just print to stdout.
        sys.stdout.write(bytes)
        bytes = yield input_stream_read_deferred(
            in_stream, 4096, cancellable=cancellable)

Other than the use of the yield keyword, the above code looks quite similar to the equivalent synchronous implementation.   The only thing that would improve matters would be if these were real methods rather than helper functions.

Furthermore, the inlineCallbacks decorator causes the function to return a deferred that will fire when the function body finally completes or fails. This makes it possible to use the function from within other asynchronous code in a similar fashion. And once you’re using deferred results, you can mix in the gio calls with other Twisted asynchronous calls where it makes sense.



Categories: Computers | Linux | nix | Planet Ubuntu | Ubuntu
email to group-id is failing to receive

Hi all, The below is the program i used to send a mail. *#!/bin/ksh mailaddress=$(cat $HOME/email.txt) (cat | mail -s "TESTING LOAD STATUS on `date`" "$mailaddress") <
Categories: Computers | Linux | nix | The UNIX and Linux Forums | UNIX
Hammock 1.5 (Default branch)

Hammock is a mock object framework for J2ME devices. It is used in conjunction with unit test frameworks like JMUnit and J2MEUnit. The framework includes mocks for many of the J2ME UI and I/O classes as well as a utility, HammockMaker, for generating mocks of other classes. *License:* The Apache...

Categories: Computers | Linux | nix | The UNIX and Linux Forums | UNIX
Automount on NIS slave

I am setting up the NIS slave server to automount the home directory just like its master server on suse linux (SLES 10). Since the master will be the first to mount the /home on the client. I have not been able to mount the /home on the on the slave when the master NIS server is unavailable. How...

Categories: Computers | Linux | nix | The UNIX and Linux Forums | UNIX
checksysreport 1.0-4 (Default branch)

Image: http://c.fsdn.com/fm/screenshots/61865_thumb.jpg checksysreport performs some automatic tests against a directory containing an untarred Red Hat Enterprise Linux sysreport. You will need a valid Red Hat Network login in order to use it, as it fetches information from RHN using the RHN API...

Categories: Computers | Linux | nix | The UNIX and Linux Forums | UNIX
Crossroads Load Balancer 2.41 (Default branch)

Image: http://c.fsdn.com/fm/screenshots/55097_thumb.png Crossroads is a daemon running in user space, and features extensive configurability, polling of back ends using wake up calls, status reporting, many algorithms to select the 'right' back end for a request (and user-defined algorithms for...

Categories: Computers | Linux | nix | The UNIX and Linux Forums | UNIX