Fun with shell

One line to search wiki in Linux with GUI

I just tried make a one liner to get info about keywords from Wikipedia.

This is just an idea can be further advanced , the command is just use of the wiki dns and few utilities like dig and zenity.


zenity --info --text="$(dig +short txt $(zenity --entry --title="Search wiki" --text="Enter your search word:").wp.dg.cx)"

Sample output :
Say if the search term was "Ubuntu" , the output would be :

Criket score from terminal

For all cricket fans and PC freaks out there , this is delight script both cli and gui scripts are there in the source.

For cli : Just place the "crick" file in /bin with chmod +x and run crick command from anywhere in terminal to see the score card.

For GUI : Extract the file "crick-info-gui.tar.gz" from the source and cat README.

To download :source {click}

Right click Format Media | USB | SDC | HDD and more

Use this to format any media , including your HDD , pen drives , usb portables , memory cards and so on.

Please note : Be careful while selecting the /dev/sd* in the list menu.

Tired this as there was a need to right click format on Ubuntu

Download here

MTR - a network diagnostic tool

Just came across a tool called "mtr" , it expands to "My trace Route"

DESCRIPTION :

mtr combines the functionality of the traceroute and ping programs in single network diagnostic tool.

As mtr starts, it investigates the network connection between the host mtr runs on and HOSTNAME. by sending packets with purposly low TTLs.

Right click send-to-media or usb

Description:

Have you ever wished you had a right click send-to-media.

This scripts gives options to send files/folders to media that is mounted.

Send to USB , HDD , CD/DVD ROM any media that is mounted !!

Rename extensions | filename in bulk

A mysterious virus , had changed the extensions of *.avi to *.jpeg , in on of friends portable harddisk , know the power of Linux , she asked can you write a small code to change the extensions , i gave it a try this way :

for i in *.jpg; do j=`echo $i | cut -d . -f 1`; j=$j".avi"; mv $i $j; done

Further tried to make it more generic

Twiiter for terminal

Just wonder why not you tweet while coding from terminal , so tired this :

#!/bin/sh

user="twitter-username"

password="twitter-password"

echo "You want to tweet about ?"

read message

curl -u $user:$password -d "status=$message" "https://twitter.com/statuses/update.xml"

Rather disadvantage if your friend could read your script right ;)

So tired this :

#!/bin/bash

tweet()

{

usr=$(zenity --entry --text="Username" --title="Twitt")

Bash Script to resize images

One of my firends wanted this , so i explained him stepwise how to do it , then thought why not a script , here it is :

#! /bin/bash

ZENITY=/usr/bin/zenity

if hash zenity 2>/dev/null; then

if hash mogrify 2>/dev/null; then

loc=$(${ZENITY} --file-selection --title="Select a File" --directory)

cd $loc

pwd

mkdir resized

cp $loc/* $loc/rz/

cd rz

size=$(zenity --title "Give the required resize value" --entry --text "Resize value")

Integrate Google calendar with evolution and Gnome clock

Go to your Google Calendar and find out your private ICAL URL

Now, open a terminal and type :

/usr/lib/evolution-webcal/evolution-webcal YOUR_PRIVATE_ICAL_URL

ICAL URL can be found here :Setting --> Cal details then get ICAL URL

ZenPinger

Zenpinger

GUI to ping using Zenity

Introduction

Zenity is a tool that allows you to display Gtk+ dialog boxes from the command line and through shell scripts. It is similar to gdialog, but is intended to be saner. It comes from the same family as dialog, Xdialog, and cdialog, but it surpasses those projects by having a cooler name

.

Using the same a small utility is been designed for pinging different hosts.

Details

Howto :

Step 1 : Download the source

Step 2 : Change mode to execution