Linux xdg-open — replacement for start in windows

2009-11-05 1 min read Fedora Linux

if you want to open any document with the default document handler from the bash prompt or command prompt in linux then the simplest way to do that is use ”xdg-open”.

This can also be used in bash scripts to allow users to select which document to open without worrying about if a particular application is installed or not. Example could be where you have list of documents in the current directory (same kind or of different format.) and you want the user to select the document. In such a scenario you can take the user input for the filename and user ”xdg-open filename” to open the file irrespective of the file type or worrying about if xpdf is installed or abiword is installed or not.

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

Get list of git repositories from command line.

2009-10-04 3 min read Linux

Earlier I had posted a small blog on teamgit. The problem still is that you have to manually go to the git.kernel.org page and get the list of the repo&#8217;s that you can download. How about a command line to get the same. Here&#8217;s one:

wget -O – http://git.kernel.org |grep &#8221;class=.list.&#8221; |grep -v title|awk -F&#8217;>&#8217; '{print $3}&#8217;|sed &#8217;s/<\/a//&#8217;

Output will be like this:<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">linux/kernel/git/ghaskins/linux-2.6-hacks.git

<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">linux/kernel/git/ghaskins/preempt-test.git
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">linux/kernel/git/ghaskins/schedtop.git
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">linux/kernel/git/glommer/linux-2.6-x86-pvops.git <div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">linux/kernel/git/gregkh/bti.git <div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">linux/kernel/git/gregkh/ddk.git <div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">linux/kernel/git/gregkh/driver-core-2.6.git <div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">linux/kernel/git/gregkh/lkn.git <div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">linux/kernel/git/gregkh/patches.git <div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">linux/kernel/git/gregkh/tty-2.6.git <div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">linux/kernel/git/gregkh/usb-2.6.git <div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">linux/kernel/git/gregkh/usbutils.git <div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">linux/kernel/git/gregkh/usbview.git <div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">linux/kernel/git/gud/chunkfs-tools.git <div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">linux/kernel/git/gud/chunkfs.git <div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">linux/kernel/git/gud/fuse-chunkfs.git <p style="padding-left: 60px;"><span style="text-decoration: underline;"><span style="color: #0000ff;">linux/kernel/git/ghaskins/linux-2.6-hacks.git

Continue reading

Change user, assume environment, stay in current dir

2009-10-03 1 min read Linux

<a href="http://blog.amit-agarwal.co.in/category/linux/">Bookmark this category

Change user, assume environment, stay in current dir $ su — user I&#8217;ve used this a number of times troubleshooting user permissions. Instead of just &#8217;su – user&#8217; you can throw another hyphen and stay in the original directory.

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

commandlinefu.com

by David Winterbottom (codeinthehole.com)

URL: <a href="http://feedproxy.google.com/~r/Command-line-fu/~3/7LH0tfWi1Oc/change-user-assume-environment-stay-in-current-dir">http://feedproxy.google.com/~r/Command-line-fu/~3/7LH0tfWi1Oc/change-user-assume-environment-stay-in-current-dir

Database of vulnurability at milw0rm.com – udpate and makeindex with cron.

2009-09-08 1 min read Bash Uncategorized

I am quite regular visitor of milw0rm and generally try to keep up with the vul&#8217;s. For doing this I wrote a small scripts rather set of scripts to keep myself update.  Here&#8217;s what we are going to do:

  1. Get the latest tar from the site.

  2. Extract it.

  3. Make the index

  4. Have a shortcut to search the index.

Download the attached files for the first 2 points. <a href="http://blog.amit-agarwal.co.in/wp-content/uploads/2009/09/makeindex-milw0rm.sh">makeindex-milw0rm and <a href="http://blog.amit-agarwal.co.in/wp-content/uploads/2009/09/udpate-milw0rm.sh">udpate-milw0rm

Continue reading

bash tutorial for begineer and experienced.

2009-07-20 1 min read Bash Learning

I having been looking for something like this for sometime. Found <a href="http://beginlinux.com/desktop_training/comm/shells/232-bash" target="_blank">this while searching.

A very good thing about this tutorial is its comprehensiveness and the details. A lot of examples are gives which too are quite useful.

Older posts Newer posts