First traceback

2009-10-25 1 min read Linux

<a href="http://www.bin-co.com/blog/2008/10/blogging-tradition-subscription-notification/trackback/">Binny V A recently quoted my blog in this posting. Since this is the first traceback to my site, so I think it was worth mentioning. Thanks Binny and I did like your idea.

rebuild rpm from installed rpm with rpmrebuild

2009-10-22 1 min read Fedora Linux

Ever happened to you that you downloaded and installed  a rpm and then deleted the package? If your answer is yes, then there is a solution.

Come to the fairyland of rpmrebuild. Create the rpm from the installed files  and give a new number if required.

sudo yum install rpmrebuild

Simplest use is to

rpmrebuild

but I personally like the one mentioned below:

rpmrebuild -R -v -P –pug-from-db

Continue reading

stop indentation on current file in vim to keep the indentation from copied text.

2009-10-22 1 min read Linux Vim Tips

I have been looking for this for quite some time. Finally found two easy ways to do it:

:setlocal noautoindent
:setlocal nocindent
:setlocal nosmartindent
:setlocal indentexpr=

Just use the above four commands when the file is already open to stop all the indentation/smart indentation/auto indentation in vim for the current file. If you want to map it then you can use shorthand notations and map it in the .vimrc file.

Continue reading

Adding dates to your photos.

2009-10-12 1 min read Linux Photo
Add date in the photograph with a perl script.

#!/usr/bin/perl

if ($#ARGV < 0 )
{
print &#8221;$#ARGV \n&#8221;;
print &#8221;Usage $ARGV[0] filename/dir\n&#8221;;
exit -1;
}

@files = `find &#8221;$ARGV[0]&#8221; -iname &#8221;*jpg&#8221; -print`;

if ($#ARGV > 3 ) { $cmd = 1;}
$count = 1;
foreach $file (@files) {
chomp ($file);

Continue reading

Using column to format a directory listing

2009-10-09 1 min read Linux

<span style="color: #000000;">Using column to format a directory listing
<span style="color: #000000;">$ (printf "PERMISSIONS LINKS OWNER GROUP SIZE MONTH DAY HH:MM PROG-NAME
<span style="color: #000000;">\n" \ ; ls -l | sed 1d) | column -t
<span style="color: #000000;">Using column to format a directory listing

<span style="color: #000000;"> * View this command to comment, vote or add to favourites
<span style="color: #000000;"> * View all commands by unixmonkey1299

<span style="color: #000000;">commandlinefu.com

Continue reading

On screen display of a command

2009-10-08 1 min read Fedora Linux

<a href="http://blog.amit-agarwal.co.in/category/linux/">Bookmark this category
delay: 2d On screen display of a command. $ date|osd_cat This is very useful if you need to show someone some text from a distance. (Like someone standing over your shoulder…)

I&#8217;d recommend aliasing it to something like:

alias osd_cat=&#8221;osd_cat -o 400 -s 8 -c blue -d 60 -f osd_cat -f -*-bitstream vera sans-*-*-*–200-*-*-*-*-*-*-*&#8221;

xosd is the utility that provides osd_cat.

* View this command to comment, vote or add to favourites * View all commands by din7

Continue reading

root shell auditing and syslog entry for all commands of shell

2009-10-08 2 min read Fedora Linux

A lot of times there is a need to log all the messages and the output of the shell to the file or syslog. Sometimes I need that for some user too. script command can be used to do this but then sometimes you cannot tell the user the session is logged or you can ask the user to run this command and it should be automatically done. And sometimes there is a need put the output in the syslog so that the root user has more control and also mail for syslog is sufficient to be analyzed rather than looking for other files. Finally I found this :

Continue reading
Older posts Newer posts