Try all colors in xterm with script before setting the color

2011-03-18 2 min read Bash Fedora Learning Linux

If you are looking for testing the colors on how they would look like in the xterm before you set the color then here is a small script for you.

  <td>
    <div class="text codecolorer">
      #!/bin/bash -<br /> #===============================================================================<br /> #<br /> #          FILE:  xterm_colors-test.sh<br /> #<br /> #         USAGE:  ./xterm_colors-test.sh<br /> #<br /> #   DESCRIPTION:  Test all the colors for xterm bg<br /> #<br /> #       OPTIONS:  ---<br /> #  REQUIREMENTS:  ---<br /> #          BUGS:  ---<br /> #         NOTES:  ---<br /> #        AUTHOR:   Amit Agarwal (amit.agarwal@amit-agarwal.co.in), aka<br /> #       COMPANY:  Individual<br /> #       VERSION:  1.0<br /> #       CREATED:  02/18/2011 01:02:51 PM IST<br /> #      REVISION:  1.0<br /> #===============================================================================<br /> <br /> cat /usr/share/X11/rgb.txt |sed 's/\([0-9]\{1,3\}[ \t]*\)\{3\}//'|sed 's/^ *//' >~/rgb.txt<br /> while read line<br /> do<br /> bg=$(echo $line)<br /> echo $line<br /> echo "Trying $bg color"<br /> xterm -bg "$bg"&<br /> sleep 5<br /> kill -9 $!<br /> done < ~/rgb.txt
    </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

This can be used in various ways but I will leave the choice to you. One option that I should probably still tell is :

Continue reading

All in one solution for all the scripts of vim from vim.org

2011-03-09 9 min read Bash Fedora Learning Linux Vim Tips

For quite sometime now, I was looking for some console based program which would help me get the scripts from vim.org. A simple solution would have been to do a wget for the scripts. But since there are so many scripts coming up daily and with a need to search based on script ID and name of the script, I thought better to write a script that can do all of those things. Now, what was required was that the script should be either able to download this or add to the GLVS script. Also note that, I had done something similar in the past here. There are some additions in the below script. You can download a copy of the script get_vim_scripts. Or you can copy the script from below:

Continue reading

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

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

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

vino – connect to running GNome session like RDP

2011-02-04 2 min read Fedora Linux

One thing that all of us Linux users have probably missed is connecting to the running GNome session to see what is going on in the running session. This can be quite handy in couple of situations:

  1. Debugging remote sessions – where you do not want a new session, instead want to connect to running session.

  2. Maintaining running session from another PC. If you are running some applications on some Linux box and want to gracefully stop it using some commands other than kill -9 then it is best that you connect to the running session, if you are not using screen.

    Continue reading

bash mathematical calculators.

2011-01-25 3 min read Bash Fedora Learning Linux

To start with , the most simple and easy to use should be “bc”. but just for some guys who want to be more experimental, here are few more bash calulator programs. These are completely command line and thus you can completely integrate them in your shell script or use them in shell script to do some really crazy maths calculations.

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

Lets start with installing these. Before we start, don’t blame and flame me if your favourite is not there in the list. If it is not, better is you drop me  a comment or email, and I will see, if I can include it in the list above, but remember this is only for console based calculators.

Continue reading
Older posts Newer posts