Removing duplicate RPMS.

2010-05-12 1 min read Linux

Got the script mainly with google search on the <a href="http://linux.derkeiler.com/Mailing-Lists/Fedora/2006-12/msg04156.html">link.

Nice trick..

Get the list of rpms with just the names
rpm -qa –queryformat &#8217;%{name}\n&#8217; > pkglist

Get the non-uniques list.
sort -g pkglist | uniq -d > duplicates

Get the versions of the duplicate files:
for pkg in `cat duplicates`; do
rpm -q $pkg » removelist
done

Now keep the rpms that you want to delete in the removelist

Continue reading

vi – the powerful Linux/Unix text editor

2010-05-12 1 min read Linux Vim Tips

We will talk about some vi stuff today:

Some fun first–>
1) <a href="http://www.vim.org/tips/tip.php?tip_id=664">http://www.vim.org/tips/tip.php?tip_id=664
2) help 42

Ok, coming to serious things-
References:
3) Linux cheat sheet:
<a href="http://www.lagmonster.org/docs/vi2.html">http://www.lagmonster.org/docs/vi2.html
4) <a href="http://www.venukb.com/2007/01/28/vivim-graphical-cheat-sheet/">http://www.venukb.com/2007/01/28/vivim-graphical-cheat-sheet/
5) <a href="http://www.eng.hawaii.edu/Tutor/vi.html#commands">http://www.eng.hawaii.edu/Tutor/vi.html#commands

Commands and tips:
6) Something that is difficult to find on the net is : how to create a numbered list in vi/vim? Simple, we will use macro's
To do this:
a> type number and terminatory ex: 1)
b> start recording using qa  . This will record the macro in a.
c> yank the line with yy
d> goto next line
e> press a to increment the number
f> End the macro recording with q
g> Play the macro with numner of times to repeat the actions. Example press 11@a
7) For repeating the last command you can use
8) You can put your vim settings in ~/vimrc and this can containg things like "set nu" and any other configuration.
9) Adding date in vi : :r! date
10) There is a variant of vi known as elvis which is quite nice
11) Similarly for viewing binary file there is a variant called bvi

Continue reading

Linux tip to find the pid/program using a particular port

2010-05-12 1 min read Solaris

netstat -lpn
Technorati Tags: <a class="performancingtags" href="http://technorati.com/tag/port" rel="tag">port, <a class="performancingtags" href="http://technorati.com/tag/pid" rel="tag">pid, <a class="performancingtags" href="http://technorati.com/tag/linux" rel="tag">linux, <a class="performancingtags" href="http://technorati.com/tag/netstat" rel="tag">netstat

Get the most favourite commands from commandlinefu

2010-05-12 1 min read Bash

For those of you who don&#8217;t know, commandlinefu should be one place you should watch to learn new things for command line. Everyday a lot of people post commands to better the previously posted commands. If you want to get the best voted commands from the archieves of commandlinefu then you can use the command:

curl -O &#8221;<a rel="nofollow" href="http://www.commandlinefu.com/commands/browse/sort-by-votes/plaintext/%5B0-2400:25%5D">http://www.commandlinefu.com/commands/browse/sort-by-votes/plaintext/[0-2400:25]&#8221;

Suggested by Dynetrekk ****<a href="http://www.commandlinefu.com/commands/view/2740/get-all-these-commands-in-a-text-file-with-description" target="_blank">here.

Walk through the flower.

2010-05-11 1 min read Photo

Here&#8217;s one of the photos that I took in last few days of the 2009. I like to call it Walk through the flower. Its a super macro of the inside of flower.

<a href="http://blog.amit-agarwal.co.in/wp-content/uploads/2010/01/DSCF7409.jpg"><img class="size-medium wp-image-1477" title="Walk through the flower." src="http://blog.amit-agarwal.co.in/wp-content/uploads/2010/08/DSCF7409-300x224.jpg" alt="Walk through the flower." width="300" height="224" />

Pretty soon you you would be able to buy this photo on <a href="http://shop.amit-agarwal.co.in">http://shop.amit-agarwal.co.in

Firefox 4.0 mockups for LInux/Windows and Mac

2010-05-11 1 min read Firefox
https://wiki.mozilla.org/Firefox/Projects/3.7_and_4.0_Theme_and_UI_Revamp
The link above will take you to the Mozilla wiki for the UI and theme mockups for the Firefox 4.0 release. Quite interesting but what I did not like is that the Linux mockup looks more like chrome. Not sure why mozilla would want to do that 🙂
  • Tabs-on-top: Defaut tabs to top of UI.
  • Hiding the Menu Bar: Hide the menu bar and add Page and Tools buttons.

The post is brought to you by <a href="http://fedorahosted.org/lekhonee">lekhonee-gnome v0.9<h6 class="zemanta-related-title">Related articles by Zemanta <ul class="zemanta-article-ul"> <li class="zemanta-article-ul-li"><a href="http://www.engadget.com/2010/05/10/mozilla-shares-tentative-vision-for-firefox-4/">Mozilla shares tentative vision for Firefox 4 (engadget.com) <li class="zemanta-article-ul-li"><a href="http://news.slashdot.org/story/10/05/11/1222211/Mozilla-Reveals-Firefox-4-Plans?from=rss">Mozilla Reveals Firefox 4 Plans (news.slashdot.org) <li class="zemanta-article-ul-li"><a href="http://www.techmeme.com/100511/p7">Mozilla&#8217;s Plans for Firefox 4: Faster, Sleeker Interface & Better Privacy Controls (Frederic Lardinois/ReadWriteWeb) (techmeme.com) <li class="zemanta-article-ul-li"><a href="http://www.techmeme.com/100510/p67">Firefox 4: fast, powerful, and empowering (Mike Beltzner/beltzner) (techmeme.com) <li class="zemanta-article-ul-li"><a href="http://blogs.chron.com/techblog/archives/2010/05/firefox_4_coming_soon_beta_as_early_as_june_1.html">Firefox 4 coming soon; beta as early as June (blogs.chron.com) <li class="zemanta-article-ul-li"><a href="http://r.zemanta.com/?u=http%3A//www.cbsnews.com/8301-501465_162-20004666-501465.html&a=17869870&rid=73c491d4-0778-448a-ba05-b7758f91e1c9&e=e813a95fa56524108572b5f7c80e8075">An Early Look at the Next Version of Firefox (cbsnews.com) <div class="zemanta-pixie"><a class="zemanta-pixie-a" title="Reblog this post [with Zemanta]" href="http://reblog.zemanta.com/zemified/73c491d4-0778-448a-ba05-b7758f91e1c9/"><img class="zemanta-pixie-img" src="http://blog.amit-agarwal.co.in/wp-content/uploads/2010/08/reblog_b85.png" alt="Reblog this post [with Zemanta]" /><span class="zem-script more-related more-info pretty-attribution paragraph-reblog">

Continue reading
Older posts Newer posts