Email web statistics from the hosted website using awstats page.

2010-03-08 2 min read Fedora Linux

I want to see the stats for my websites mailed to me directly like Google analytics does. Sure enough I can see them on the hosting cpanel page on awstats, but I dont want to check that everyday. An easier solution would be to have that mailed to my email address everyday using cron. Let’s try to do that today:

First we would need to get the address of the page for the statistics, which would look like this:

Continue reading

create SQL-statements from textfile with awk

2010-03-08 1 min read Linux

<a href="http://feedproxy.google.com/~r/Command-line-fu/~3/lz9uEhVxEEk/create-sql-statements-from-textfile-with-awk">create SQL-statements from textfile with awk

  <td>
    <div class="text codecolorer">
      $ $ awk \'{printf "select * from table where id = %c%s%c;\\n",39,$1,39; }\' inputfile.txt
    </div>
  </td>
</tr>
1

inputfile.txt is a space-separated textfile, 1st column contains the items (id) I want to put into my SQL statement.

39 = charactercode for single tick \’

    <td>
      <div class="text codecolorer">
        1 = first column
      </div>
    </td>
  </tr>
</table>

If inputfile.txt is a CSV-file separated by \”,\” use FS= to define your own field-separator:

Continue reading

eclim for Fedora – Leonidas – installation.

2010-03-08 1 min read Linux Vim Tips

Here is the installation instruction for Eclim for vim. I have not tried it as I did not require it, but if you need it.

http://downloads.sourceforge.net/project/eclim/eclim/1.4.8/eclim_1.4.8.tar.gz?use_mirror=biznetnetworks

sudo ant -Declipse.home=/usr/lib/eclipse -Dvim.files=/home/amitag/.vim -Dplugins=cdt

create ctgs using

ctags -R /usr/include/<h6 class="zemanta-related-title">Related articles by Zemanta <ul class="zemanta-article-ul"> <li class="zemanta-article-ul-li"><a href="http://spf13.com/post/vim-crash-course">VIM Crash Course (spf13.com) <li class="zemanta-article-ul-li"><a href="http://go.theregister.com/feed/www.theregister.co.uk/2010/01/26/sourceforge_ip_address_filtering/">SourceForge bars 5 nations from open source downloads (go.theregister.com) <li class="zemanta-article-ul-li"><a href="http://blog.amit-agarwal.co.in/2010/01/22/my-project-in-sourceforgenet-gnomedesktopwal/">My project in sourceforge.net gnomedesktopwal (amit-agarwal.co.in) <div class="zemanta-pixie"><a class="zemanta-pixie-a" title="Reblog this post [with Zemanta]" href="http://reblog.zemanta.com/zemified/0fb78d60-4b1a-4563-8ffa-f572041a3a64/"><img class="zemanta-pixie-img" src="http://blog.amit-agarwal.co.in/wp-content/uploads/2010/08/reblog_b13.png" alt="Reblog this post [with Zemanta]" /><span class="zem-script more-related more-info pretty-attribution paragraph-reblog">

Continue reading

FVWM window manager.

2010-03-05 1 min read Fedora Linux

<a href="http://www.fvwm.org/" target="_blank">Home Page of fvwm.

So Now I am trying different window managers. My requirement is simple, alt+tab should allow me to swicht the windows and the window manager should be light but configurable and should show the programs/applications that are installed on my system. The last requirement comes from the fact that I am quite forgetful person and keep forgetting about the application to use for the particular purpose. So Window Manager should not be CPU and Memory hogging like Gnome or KDE but still should be decent and not like &#8221;X&#8221; or hackedbox.

Continue reading

Mod and hack the GNome main menu with automated scripts to create a menu of the directory.

2010-03-04 2 min read GNOME Linux

Problem:
I had a directory with very good collection of my scripts and very organized in folders. The structure is something like this, first I have the broad classification of the category. Then I have the name of the tool/script as the name of the directory. All these are perl/python or shell scripts and luckily labelled so with the extension. I want to add these to the GNome main (Applications) menu.
Solution:
Lets take it stepwise:
1)  Add new menu tools to the Applications menu. Go to /etc/xdg/menus
Open the file applications.menu and add the following before

Continue reading

Bash histoy – common history in different terminals

2010-03-04 1 min read Bash Linux

I have been looking to do this for sometime. The bash history is per
session basis and the last session to quit overwrites the bash_history
file and thus all other terminals started between the time last terminal
lasted does not get to write the commands in the history file. Secondly
the history gets cluttered with lot of duplicate entries and entries
with ls and cd commands. So finally I added these to the bashrc file:

Continue reading

Happy New year and invitation to become author.

2010-03-03 1 min read Linux

Wish all of you a happy and prosperous new year.. Now I am opening inivitation for authors. If you like linux and want to write on the same, please register yourself and leave a comment on this post with your username, and as soon as I am back I will do the required.

Once again Happy New Year.

1