configuration for afraid-dyndns on Fedora and other similar distro.

2011-03-04 1 min read Fedora Linux

First install afraid-dyndns with the command:

  <td>
    <div class="text codecolorer">
      sudo yum install afraid-dyndns
    </div>
  </td>
</tr>
1

Now open the configuration file /etc/afraid-dyndns.cfg and we need to change the following:

Notify = root@localhost # leave empty to suppress notifications
CacheFile = /var/cache/afraid-dyndns/IP
AccountHash =

For the Account hash, head over to http://freedns.afraid.org/api/ login and then click one of the XML or the ASCII links there. Once the page has loaded, look at the URL which is of form:

Continue reading

print every nth line

2011-03-01 2 min read Bash Linux

Some time back I was working with lot of data and wanted to analyze only the every 10 line sometimes and sometimes every 20th line. I had to keep doing these changes in vim or otherwise so finally I wrote a program to do this for me. If you need such a program then here it is:

  <td>
    <div class="text codecolorer">
      #!/bin/bash -<br /> #===============================================================================<br /> #<br /> #          FILE:  print_nth_line.sh<br /> #<br /> #         USAGE:  ./print_nth_line.sh<br /> #<br /> #   DESCRIPTION:  Print every nth line<br /> #<br /> #       OPTIONS:  ---<br /> #  REQUIREMENTS:  ---<br /> #          BUGS:  ---<br /> #         NOTES:  ---<br /> #        AUTHOR:   (),<br /> #       COMPANY:<br /> #       VERSION:  1.0<br /> #       CREATED:  12/08/2010 05:36:53 PM IST<br /> #      REVISION:  ---<br /> #===============================================================================<br /> <br /> if [ x"$1" == "x" ]<br /> then<br /> echo "Please provide the line numbers to print .. .ex 3 will print 3,6,9"<br /> exit -1;<br /> fi<br /> if [ x"$2" == "x" ]<br /> then<br /> echo "Please provide the filename"<br /> exit -2;<br /> fi<br /> awk 'temp++ { if ( temp % '$1' == 0) print $1};' $2
    </div>
  </td>
</tr>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
Enhanced by Zemanta

/bash debugger

2011-02-27 5 min read Bash Linux

In this section we’ll develop a very basic debugger for bash.[10] Most debuggers have numerous sophisticated features that help a programmer in dissecting a program, but just about all of them include the ability to step through a running program, stop it at selected places, and examine the values of variables. These simple features are what we will concentrate on providing in our debugger. Specifically, we’ll provide the ability to:

Continue reading

Gnome Tips

2011-02-25 3 min read Fedora GNOME

Add/Edit GDM Sessions

Each session is a *.desktop file located at /usr/share/xsessions.

GDM appearance

You can change background image, gtk/icon theme by hands (as described at Gnome_2.28_Changes#Configuring_gdm_2.28), or you can use gdm2setup from the AUR.

Tweaking

If your gnome applications seem sluggish and gnome hangs at start-up after killing the previous session, it’s likely you haven’t set your /etc/hosts file correctly and your /etc/hosts file includes:

127.0.0.1       localhost.localdomain     localhost      YOURHOSTNAME

Then run “/bin/hostname YOURHOSTNAME” and “/sbin/ifconfig lo up” as root.

Continue reading

install all solaris software from http

2011-02-23 1 min read Solaris

If you are behind a firewall and install some software like top or wget then you can not use sunfreeware, and why because ftp is blocked. Now that is not the case any more, you can go the http mirror site of sunfreeware and here is the link for the same

http://ftp.sunfreeware.com/ftp/pub/freeware/i386/5.10/

Note: you just need to change the words in bold for sparc or i386 and version of the solaris.

Continue reading

Using ssmtp to send mail using gmail.

2011-02-19 1 min read Fedora Linux

First install the package ssmtp using the command:

  <td>
    <div class="text codecolorer">
      sudo yum install ssmtp
    </div>
  </td>
</tr>
1

Open the configuration file for ssmtp as root user:

  <td>
    <div class="text codecolorer">
      vim /etc/ssmtp/ssmtp.conf
    </div>
  </td>
</tr>
1

Make the following changes to the configuration file:

root=**username**@gmail.com
mailhub=smtp.gmail.com:587
hostname=**username**@gmail.com
UseSTARTTLS=YES
AuthUser=username
AuthPass=password
FromLineOverride=yes

In order to make the default (root) “from” field be the server name,
edit the /etc/ssmtp/revaliases file as root user :

Continue reading

using gnuplot for time plotting

2011-02-17 1 min read Learning Linux

Couple of days back, I was working with some data and wanted to plot it. I had couple of options Excel, ploticus and then our own gnuplot. My choice here was gnuplot, as this is most commonly available and helps me write scripts that can automate my repetitive task. So far, so good. The data I was plotting was against time, that was the problem. Couple of quick searches did not result into any luck to get me on the path and hence with some man pages and some documentation, finally I found this, might be this will be helpful for others.

Continue reading
Older posts Newer posts