Magic space on the current command line

2010-06-25 1 min read Bash Fedora Linux

# For how to set up magic space for Bash see:
# – http://www.ukuug.org/events/linux2003/papers/bash_tips/#slide15
# – http://codesnippets.joyent.com/posts/show/1690

man bash 2>/dev/null | less -p ’magic-space’

man bash 2>/dev/null | less -p ’Event Designators’

man bash 2>/dev/null | less -p &#8217;\!#&#8217; # &#8221;The entire <a class="zem_slink" title="Command-line interface" rel="wikipedia" href="http://en.wikipedia.org/wiki/Command-line_interface">command line typed so far.&#8221;

<a href="http://snippets.dzone.com/posts/show/10265">Read more :<h6 class="zemanta-related-title" style="font-size: 1em;">Related articles by Zemanta <ul class="zemanta-article-ul"> <li class="zemanta-article-ul-li"><a href="http://www.makeuseof.com/tag/trigger-wake-lan-mac-address/">How To Trigger Wake On LAN Using The MAC Address (makeuseof.com) <li class="zemanta-article-ul-li"><a href="http://smarterware.org/4271/projectview-lists-your-todo-txt-by-project">Projectview Lists Your Todo.txt by Project (smarterware.org) <li class="zemanta-article-ul-li"><a href="http://helpdeskgeek.com/linux-tips/shell-script-backup-directory-linux/">Back Up a Directory in Linux using a Shell Script (helpdeskgeek.com) <div class="zemanta-pixie" style="margin-top: 10px; height: 15px;"><a class="zemanta-pixie-a" title="Reblog this post [with Zemanta]" href="http://reblog.zemanta.com/zemified/038d79c3-59e6-41ad-a8ad-31d1af669509/"><img class="zemanta-pixie-img" style="border: medium none; float: right;" src="http://blog.amit-agarwal.co.in/wp-content/uploads/2010/08/reblog_e39.png" alt="Reblog this post [with Zemanta]" /><span class="zem-script more-related pretty-attribution">

Continue reading

ack on solaris – grep recursively.

2010-06-25 2 min read Solaris

<span style="background-color: #ffffff;">Some days back I posted an article on ack <a href="http://blog.amit-agarwal.co.in/2009/08/24/more-powerful-grep-ack/" target="_blank">here. Today I was working on Solaris 9 and the default grep installed on the system does not have the &#8221;-r&#8221; option to search recursively. So, you know for all the time I had to keep using find with grep to work with directories recursively. This was something similar to the one below:

<span style="background-color: #ffffff;">find . -type f -exec grep amit {} \;

Continue reading

GIMP 2.6 released

2010-06-25 1 min read Photo

GIMP released version 2.6 with some major improvements. I have not yet downloaded it and plan to do it in few days time.

<a href="http://gimp.org/release-notes/gimp-2.6.html">Release notes of 2.6 version.

This version has made some changes in the GUI too and looks quite impressive in the screenshots.

Heres one of them from the GIMP site.

<a href="http://blog.amit-agarwal.com/wp-content/uploads/gimp.org/screenshots/gnome-1280x800-fresh-start.jpg"><img title="GIMP UI" src="http://blog.amit-agarwal.com/wp-content/uploads/gimp.org/screenshots/gnome-1280x800-fresh-start.jpg" alt="GIMP UI" width="1280" height="800" />

Check it out πŸ™‚

rpmsave and rpmnew files.

2010-06-25 1 min read Linux

When upgrading an rpm based Linux System, all of us would have seen &#8221;*.rpmsave&#8221; or &#8221;*rpmnew&#8221; files being created. These are the config files in the rpm that rpm utility thinks should be overwritten (creates a *.rpmsave for the earlier file) or should not be overwritten (create *.rpmnew with the new file).

If you ever wondered what to do with these files then you can use this small script that would show the diff between the two files and you can decided which to keep or which to delete.

Continue reading

bash one liner to change/remove test pattern from config file or text file.

2010-06-25 1 min read Bash Fedora Learning Linux

Problem:

I had a directory with a lot of config files in the ini file format, i.e. name and value separated by equals. Some/all of these contained some directory names and other values which had to be replaced. But there were other place where I should not not replace them, if there was no exact match. I also needed to have a backup copy of the file that I was modifying. Since the number of files that I needed to change was multiple so was quite difficult to do it without using some script.

Continue reading

Visualizing system performance data

2010-06-25 1 min read Linux

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

<font SIZE="6"><a HREF="http://feedproxy.google.com/~r/Command-line-fu/~3/jjk4Htw9rvo/visualizing-system-performance-data">Visualizing system performance data

$ vmstat 2 10 | awk 'NR > 2 {print NR, $13}' | gnuplot -e “set terminal png;set output 'v.png';plot '-' u 1:2 t 'cpu' w linespoints;" draw `vmstat ` data using gnuplot

  • <a HREF="http://www.commandlinefu.com/commands/view/3581/visualizing-system-performance-data">View this command to comment, vote or add to favourites
  • <a HREF="http://feeds2.feedburner.com/commands/by/Sunng">View all commands by <a HREF="http://feeds2.feedburner.com/commands/by/Sunng">Sunng

<a HREF="http://www.commandlinefu.com"><img SRC="http://blog.amit-agarwal.co.in/wp-content/uploads/2010/08/header-logo.jpg" ALIGN="bottom" ALT="commandlinefu.com"/>

by David Winterbottom (<a HREF="http://codeinthehole.com">codeinthehole.com)

Continue reading

Using PHP to search a MySQL database and return paged results

2010-06-25 1 min read Database Linux

<a href="http://www.designplace.org/scripts.php?page=1amp;c_id=25">Using PHP to search a MySQL database and return paged results

Link above to the article. I am using this as base to do some programming of my own for my website. When I am done I can post few more details, till then…………

Older posts Newer posts