Allow incoming/outgoing ports on iptables

2012-11-27 2 min read Fedora
Schematic for the packet flow paths through Li...
Schematic for the packet flow paths through Linux networking and Xtables (Photo credit: Wikipedia)

Last couple of years, I just used to disable iptables on my system, this time I decided not to disable it and keep it enabled.

So far so good, now comes the tricky part, I have http server enabled on my system and since this is on local network with already firewall and other security in place so I can allow all incoming to my system and similarly I need to enable XDMCP outgoing. So, I can add the rules like this :

Continue reading

Shortcut to run current command with sudo in bash

2012-09-20 1 min read Fedora Linux

For me, I mostly forget to add “sudo” to the command until the time I am actually supposed to run it. Also sometimes, on some systems, bash completion does not work as expected with “sudo”. With these in mind, I wanted something such that when I have completed the command, I could insert sudo in the begining of the command without much ado. So, finally this is what I came up with in my “~/.inputrc” file. Note: If you don’t have this file, then simply create this file.

Continue reading

gqlplus – sqlplus with readline (tab completion)

2012-08-03 1 min read Database

Tab completion is something which is missing in the sqlplus and if you have lot of tables with long names or lot of columns then it is sufficiently  difficult to type them 🙂

Here is a solution for this problem. Download and install gqlplus. gqlplus is a replcement for sqlplus which supports completion for commands/tablenames and column names. Quite useful.

Oracle SQL*Plus
Oracle SQL*Plus (Photo credit: Manuel Cernuda)
Enhanced by Zemanta

Ubuntu setup – post installation script

2012-07-03 4 min read Bash
My iPhone apps as of February 2010
My iPhone apps as of February 2010 (Photo credit: dougbelshaw)

If you have done a new installation of Ubuntu or Fedora, then yuou know you have to search all kind of blogs to find out what all to install. So, here is a easier way to do that. Just run this script, it will install some applications which are mostly a “MUST” for all the installations. And the list of applications that are installed are :

Continue reading

tora installation on Fedora 17.

2012-06-22 1 min read Database Fedora

Here are the previous links on Tora:

Tora on F16

Tora on Fedora

And if you are interested in installing from source then you can always use this link:
http://blog.amit-agarwal.com/2012/02/06/tora-fedora-16-mysql-oracle/

 

And if you are interested in just installing it then you can always do:

rpm -ivh "http://amit-agarwal.co.in/mystuff/tora-2.1.3-1.fc17.i686.rpm"
Enhanced by Zemanta

rpmconf – Tool to handle rpmsave and rpmnew files

2012-06-18 1 min read Bash Fedora

Install the utility:

sudo yum install rpmconf

Description:

Description : This tool search for .rpmnew, .rpmsave and .rpmorig files and ask you what to do
with them:
Keep current version, place back old version, watch the diff or merge.

And finally run the utility:

sudo rpmconf -a

and if there is a conflict or rpmsave or rpmnew file, then you will see something like this:

Continue reading

Array of all possible colors in bash script

2012-05-07 1 min read Bash Learning

Sometime back, we had looked at using colors in bash script and here is a way to create a array of all the colors.

#!/bin/bash - 
#===============================================================================
#
#          FILE:  colorarray.sh
# 
#         USAGE:  ./colorarray.sh 
# 
#   DESCRIPTION:  
# 
#       OPTIONS:  ---
#  REQUIREMENTS:  ---
#          BUGS:  ---
#         NOTES:  ---
#        AUTHOR: Amit Agarwal (aka), amit.agarwal@roamware.com
#       COMPANY: Roamware India Pvt Ltd
#       CREATED: 16/04/12 17:24:09 IST
# Last modified: Mon Apr 16, 2012  05:39PM
#      REVISION:  ---
#===============================================================================
count=0
for i in 40m 41m 42m 43m 44m 45m 46m 47m
do
    for l in 0 1
    do
        echo -n "l=$l "
        for k in 0 1
        do
            # echo -n "k=$k "
            for j in {30..37}
            do
                carr[$count]="\033[$k;$j;$l;$i"
                echo -ne "${carr[$count]}$count \033[00m"
                ((count++))
            done
        done
        echo
    done
    echo
done

You can add this script to any script of your choice and you have all the 256 colors available to you in the script without additional coding. Happy coding.

Continue reading
Older posts Newer posts