mussh - Multihost SSH wrapper

2010-05-25 1 min read Bash Fedora Linux

Description:

Mussh is a <a class="zem_slink freebase/en/shell_script" title="Shell script" rel="wikipedia" href="http://en.wikipedia.org/wiki/Shell_script">shell script that allows you to execute a command or script over ssh on multiple hosts with one command. When possible mussh will use <a class="zem_slink freebase/en/ssh-agent" title="Ssh-agent" rel="wikipedia" href="http://en.wikipedia.org/wiki/Ssh-agent">ssh-agent and RSA/DSA keys to minimize the need to enter your password more than once.

It is a utility for <a class="zem_slink freebase/en/system_administrator" title="System administrator" rel="wikipedia" href="http://en.wikipedia.org/wiki/System_administrator">system administrators maintaining more than one hosts. The utility will help the admin to execute the same command on multiple hosts with a single command.

Continue reading

Menu driven ssh.

2010-05-24 1 min read Bash

I have quite a lot of servers where I need to ssh at workplace and I generally don&#8217;t remember all of them, so I wrote a simple yet useful script. In all the servers I have already copied my key so I dont need a password to login. Without much ado, here is the script.

echo &#8221;Enter the server name:&#8221;
echo &#8221;1. redhat&#8221;
echo &#8221;2. fedora&#8221;

read server

if [ &#8221;$server&#8221; = &#8221;1&#8221; ]; then
ssh amit@redhat
else if [ &#8221;$server&#8221; = &#8221;2&#8221; ]; then
ssh amit@fedora
else
echo &#8221;Not a valid choice&#8221;
fi
fi

Continue reading

Display the history and optionally grep

2010-05-19 1 min read Bash

Ever wondered how good it would be to have a command/function that would display the history or display the history with <a class="zem_slink" title="Grep" rel="wikipedia" href="http://en.wikipedia.org/wiki/Grep">grep.

Would be really good right, well someone thought about this 🙂

$ h() { if [ -z &#8221;$1&#8221; ]; then history; else history | grep &#8221;$@&#8221;; fi; }

Place this in your .bash_profile and you can use it two different ways. If you issue &#8217;h&#8217; on its own, then it acts like the history command. If you issue:

Continue reading

Awk Introduction Tutorial – 7 Awk Print Examples

2010-05-19 0 min read Bash Fedora Linux
\"LAS
Image by Getty Images via Daylife

awk examples

Awk Introduction Tutorial – 7 Awk Print Examples This is the first article on the new awk tutorial series. We’ll be posting several articles on awk in the upcoming weeks that will cover all features of awk with practical examples. In this article, let us review the fundamental awk working methodology along with 7 practical awk print examples. Note: Make sure you review our earlier […]

Continue reading

Mirror or download a website with a tool much better than wget

2010-05-19 1 min read Bash Fedora Linux

If you want to mirror a <a class="zem_slink freebase/en/website" title="Website" rel="wikipedia" href="http://en.wikipedia.org/wiki/Website">website, the simplest tool I know if is <a class="zem_slink freebase/en/wget" title="Wget" rel="homepage" href="http://www.gnu.org/software/wget/">wget. Once you have used wget, you know the troubles associated with it. You also get added couple of files as search html files, which are useless and wastage of bandwidth for you as well as the <a class="zem_slink freebase/en/web_server" title="Web server" rel="wikipedia" href="http://en.wikipedia.org/wiki/Web_server">webserver.

lftp -e &#8221;mirror -c&#8221; 

Continue reading

List all the installed firefox addons from the bash script

2010-05-18 1 min read Bash Fedora Linux

Here is a one-line that would help you get the <a class="zem_slink freebase/en/mozilla_firefox" title="Firefox" rel="homepage" href="http://www.mozilla.com/en-US/firefox/">Firefox addons in the bash script:

grep -hIr \<em:name ~/.mozilla/firefox/*.default/extensions|sed &#8217;s#\s*##&#8217;|sed &#8217;s#.*\(>.*<\).*#\1#&#8217;|sed &#8217;s/[<\|>]//g&#8217;|sort -u<h6 class="zemanta-related-title">Related articles by Zemanta <ul class="zemanta-article-ul"> <li class="zemanta-article-ul-li"><a href="http://www.ghacks.net/2010/05/16/firefox-3-6-4-build-4-released/">Firefox 3.6.4 Build 4 Released (ghacks.net) <li class="zemanta-article-ul-li"><a href="http://www.webmonkey.com/2010/05/first-look-firefox-4-preview-delivers-speed-revamped-interface/">First Look: Firefox 4 Preview Delivers Speed, Revamped Interface (webmonkey.com) <li class="zemanta-article-ul-li"><a href="http://www.ghacks.net/2010/05/15/protect-firefox-bookmarks-with-link-password/">Protect Firefox Bookmarks With Link Password (ghacks.net) <li class="zemanta-article-ul-li"><a href="http://www.huffingtonpost.com/2010/05/12/mozilla-firefox-4-upgrade_n_573062.html">Firefox 4 Upgrade Offers Simpler Design, More Privacy Control (huffingtonpost.com) <li class="zemanta-article-ul-li"><a href="http://www.readwriteweb.com/archives/mozilla_talks_firefox_4_sleeker_interface_better_privacy_controls.php">Mozilla&#8217;s Plans for Firefox 4: Faster, Sleeker Interface, Better Privacy Controls (readwriteweb.com) <div class="zemanta-pixie"><a class="zemanta-pixie-a" title="Reblog this post [with Zemanta]" href="http://reblog.zemanta.com/zemified/6a3ffd4a-91cf-47e3-85ff-7dc3b27ffd7d/"><img class="zemanta-pixie-img" src="http://blog.amit-agarwal.co.in/wp-content/uploads/2010/08/reblog_b89.png" alt="Reblog this post [with Zemanta]" /><span class="zem-script more-related more-info pretty-attribution paragraph-reblog">

Continue reading

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.

Older posts Newer posts