Menu

Show posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Show posts Menu

Topics - hakerdefo

#21
General Support / GTK killed ROXTerm
June 05, 2016, 05:48:53 AM
#22
Like XKCD webcomic? If yes, then you can view-download current and random XKCD comics right from your desktop. More info on my GitHub repo here,

pmxkcd - Desktop XKCD webcomic viewer & downloader for Linux

Cheers!!!
#23
Scripts / vsncftp - yet another FTP uploader
March 09, 2016, 10:48:58 PM
Here is another bash script to upload to FTP. This time it's a bit different than the previous one I posted here. This version uploads all the contents of a directory to FTP server. No fancy GUI this time. No input prompts. Just a wee dependency. Don't worry the script will cry if the dependency is not met with  :P

Before using the script you will have to add values to the following variables,


HOST_1='ftp-test.vsido.co.us'



Make sure  HOST_1  doesn't look like this,


HOST_1='ftp://ftp-test.vsido.co.us'


The backbone behind this script doesn't like the usage of  ftp://ftp



USER_1='your_ftp_user_name'



PASSWD='your_ftp_password'



LOCALPATH1='/path/to/directory/with/upload/files/*'


Mind the trailing  /*  DON'T REMOVE  /*



LOCALPATH2='/path/to/directory/with/upload/files'


MAKE SURE TO REMOVE   /*  WE DON'T NEED  /*  HERE. THE PATH SHOULD BE THE SAME MINUS TRAILING  /*



RDIR="/ftp/directory/to/upload/files/to"


Here add the FTP directory to which you wish to upload files. i.e.  /incoming   /ISO  /upload  etc.. etc..


Save the file somewhere in your $PATH. chmod 755 it. Run it. By default it will remain silent. Won't show any progress-transfer information. On completion, successful or erroneous, it will show detailed log file(s).

Cheers!!!
#24
Scripts / vsftup - VSIDO FTP Uploader
March 06, 2016, 10:44:13 PM
Been unable to visit VSIDO forums for a while  :(
Came across this post today,

http://vsido.org/index.php?topic=1148.msg12225

So here is an attempt to solve that problem,

vsftup - VSIDO FTP Uploader

Nothing fancy! Uploads a file to an ftp server. No extra dependencies outside standard VSIDO install  8)
Make sure you give the full path to the directory on the FTP server when prompted.
i.e. To upload to 'ISO' directory on 'ftp://ftp-vsido.net' enter,
ftp://ftp-vsido.net/ISO/
when prompted.

If you don't use username and/or password (really???) for your ftp server you can leave them empty when prompted.

Download the attached script, chmod 755 it and give your feedback!

Cheers!!!
#25
How To's / How to clean duplicate $PATH entries
January 09, 2016, 09:02:31 PM
Open terminal and type,

echo $PATH


Do you see any duplicate path entries? If no, Great! If yes, Worry not! Fix is simple!
Open  '.bashrc' file in your favorite text-editor and just add following lines at the bottom,


PATH="$(echo $PATH | perl -e 'print join(":", grep { not $seen{$_}++ } split(/:/, scalar <>))')"
export PATH


Save the file. Do Logout-Login and voila! No more duplicate path entries!
Cheers!!!
#26
Subject line is a bit of a cheating  ;) This one is not exactly a 'How To'; Rather it is a small list of some interesting and privacy respecting search engines. No DuckDuckGo cause we all know it  8)

startpage

unbubble

Qwant

Dribper

Deeperweb

searx

startpage and unbubble allow you to save your settings in a URL. You then just need to save or bookmark that URL.

Cheers!!!
#27
I've Got a Life / RIP Ian Murdock
December 30, 2015, 09:16:59 PM
A shocker! Ian is dead! The founder of Debian project is no longer with us! Yesterday I read a series of tweets from Ian threatning suicide and complaining about police brutality. Back then I thought Ian's twitter account was compromised and didn't make much of it. Sadly a while back Docker's Ben Golub posted this sad news,

http://blog.docker.com/2015/12/ian-murdock/

And the following confirmed the sad news,

https://bits.debian.org/2015/12/mourning-ian-murdock.html

RIP Ian! Thoughts and prayers are with his near & dear ones!
#28
I've Got a Life / America and the love for guns
October 02, 2015, 05:09:06 AM
Never understood why America (Americans) love the guns so much? The disasters keep happening again and again?
"Yes, and how many deaths will it take 'til he knows
That too many people have died?"
Many in the forums are americans and I would love to get their views on this topic.
https://en.wikipedia.org/wiki/Umpqua_Community_College_shooting
#29
Scripts / PMRP - Poor Man's Radio Player
August 06, 2015, 06:36:49 PM
I was confused whether to post this as update to 'RADIO VSIDO - VSIDO's very own Internet radio player' or to start a new thread? But after some consideration I decided to start it as a new topic.
* So here it is. PMRP - Poor Man's Radio Player. Probably the best bash based Internet radio player in the world.
* Over 250 hand-picked radio stations spanning across different genres and subjects. Whatever you feel like listening to, you'll find it in PMRP.
* Better menus for easier navigation-selection of radio stations.
* Currently playing track information (If available).
Installing PMRP is easy. PMRP uses mpg123 as the back-end so first install it,


sudo apt-get install mpg123


I've attached pmrp here so download it first.

Download PMRP

And save it somewhere in your $PATH with the name 'pmrp' and 'chmod 755' it.
That's it! Open terminal, run 'pmrp', and enjoy from over 250 radio stations.
As usual view-review-comments are welcome.
Cheers!!!

#30


(07 May 2017) Update  Begins:

Removed the dependencies on Perl and cURL.
Cleaned-up the script a bit.

Don't forget to read the set-up instructions posted down below if you are a new user  ;)

Here is updated pmwf script


#!/usr/bin/env bash
###################
local_latitude=
local_longitude=
local_unit=
api_key=
local_rm=$(which rm)
printf "\033c"
wget --user-agent="Mozilla/5.0 Gecko/20100101" --quiet --timeout=30 "http://api.openweathermap.org/data/2.5/weather?lat=$local_latitude&lon=$local_longitude&units=$local_unit&mode=json&APPID=$api_key" --output-document "/tmp/current.json"
wget --user-agent="Mozilla/5.0 Gecko/20100101" --quiet --timeout=30 "http://api.openweathermap.org/data/2.5/forecast/daily?lat=$local_latitude&lon=$local_longitude&cnt=4&units=$local_unit&mode=json&APPID=$api_key" --output-document "/tmp/forecast.json"
printf "\033c"
if [[ ! -f "/tmp/current.json" ]]; then
    echo ""
    echo -e "Can not connect to openweathermap.org!"
    echo -e "Please check your internet connection!"
    echo ""
    exit 1
else
    place=$(jq -r '.city.name' "/tmp/forecast.json")
    nation=$(jq -r '.city.country' "/tmp/forecast.json")
    time2=$(jq -r '.list[1].dt' "/tmp/forecast.json")
    time3=$(jq -r '.list[2].dt' "/tmp/forecast.json")
    time4=$(jq -r '.list[3].dt' "/tmp/forecast.json")
    time22=$(date -d @"$time2" +'%A, %d %B %Y')
    time33=$(date -d @"$time3" +'%A, %d %B %Y')
    time44=$(date -d @"$time4" +'%A, %d %B %Y')
    tempcurrent=$(jq -r '.main.temp' "/tmp/current.json")
    min2=$(jq -r '.list[1].temp.min' "/tmp/forecast.json")
    min3=$(jq -r '.list[2].temp.min' "/tmp/forecast.json")
    min4=$(jq -r '.list[3].temp.min' "/tmp/forecast.json")
    max2=$(jq -r '.list[1].temp.max' "/tmp/forecast.json")
    max3=$(jq -r '.list[2].temp.max' "/tmp/forecast.json")
    max4=$(jq -r '.list[3].temp.max' "/tmp/forecast.json")
    pressurecurrent=$(jq -r '.main.pressure' "/tmp/current.json")
    pressure2=$(jq -r '.list[1].pressure' "/tmp/forecast.json")
    pressure3=$(jq -r '.list[2].pressure' "/tmp/forecast.json")
    pressure4=$(jq -r '.list[3].pressure' "/tmp/forecast.json")
    humidcurrent=$(jq -r '.main.humidity' "/tmp/current.json")
    humid2=$(jq -r '.list[1].humidity' "/tmp/forecast.json")
    humid3=$(jq -r '.list[2].humidity' "/tmp/forecast.json")
    humid4=$(jq -r '.list[3].humidity' "/tmp/forecast.json")
    windcurrent=$(jq -r '.wind.speed' "/tmp/current.json")
    wind2=$(jq -r '.list[1].speed' "/tmp/forecast.json")
    wind3=$(jq -r '.list[2].speed' "/tmp/forecast.json")
    wind4=$(jq -r '.list[3].speed' "/tmp/forecast.json")
    direcurrent=$(jq -r '.wind.deg' "/tmp/current.json")
    dire2=$(jq -r '.list[1].deg' "/tmp/forecast.json")
    dire3=$(jq -r '.list[2].deg' "/tmp/forecast.json")
    dire4=$(jq -r '.list[3].deg' "/tmp/forecast.json")
    condicurrent=$(jq -r '.weather[].description' "/tmp/current.json")
    condi2=$(jq -r '.list[1].weather[].description' "/tmp/forecast.json")
    condi3=$(jq -r '.list[2].weather[].description' "/tmp/forecast.json")
    condi4=$(jq -r '.list[3].weather[].description' "/tmp/forecast.json")
    if [[ "$local_unit" == imperial ]]; then
windcurrent1="$windcurrent"
wind22="$wind2"
wind33="$wind3"
wind44="$wind4"
symb=$(echo -e "\u2109")
symb2="mph"
    else
windcurrent1=$(awk "BEGIN {print $windcurrent * 3.6}")
wind22=$(awk "BEGIN {print $wind2 * 3.6}")
wind33=$(awk "BEGIN {print $wind3 * 3.6}")
wind44=$(awk "BEGIN {print $wind4 * 3.6}")
symb=$(echo -e "\u2103")
symb2="kph"
    fi
    printf "\033c"
    echo -e '\e[01m'""
    echo -e "Location - $place, $nation:"
    echo ""
    echo -e "Current weather conditions:"
    echo -e '\e[0m'""
    echo -e "Temperature - $tempcurrent $symb"
    echo -e "Atmospheric Pressure - $pressurecurrent hPa"
    echo -e "Humidity - $humidcurrent %"
    echo -e "Wind speed - $windcurrent1 $symb2"
    echo -e "Wind direction - $direcurrent°"
    echo -e "Weather condition - $condicurrent"
    echo -e '\e[01m'""
    echo -e "Forecast for $time22:"
    echo -e '\e[0m'""
    echo -e "Minimum Temperature - $min2 $symb"
    echo -e "Maximum Temperature - $max2 $symb"
    echo -e "Atmospheric Pressure - $pressure2 hPa"
    echo -e "Humidity - $humid2 %"
    echo -e "Wind speed - $wind22 $symb2"
    echo -e "Wind direction - $dire2°"
    echo -e "Weather condition - $condi2"
    echo -e '\e[01m'""
    echo -e "Forecast for $time33:"
    echo -e '\e[0m'""
    echo -e "Minimum Temperature - $min3 $symb"
    echo -e "Maximum Temperature - $max3 $symb"
    echo -e "Atmospheric Pressure - $pressure3 hPa"
    echo -e "Humidity - $humid3 %"
    echo -e "Wind speed - $wind33 $symb2"
    echo -e "Wind direction - $dire3°"
    echo -e "Weather condition - $condi3"
    echo -e '\e[01m'""
    echo -e "Forecast for $time44:"
    echo -e '\e[0m'""
    echo -e "Minimum Temperature - $min4 $symb"
    echo -e "Maximum Temperature - $max4 $symb"
    echo -e "Atmospheric Pressure - $pressure4 hPa"
    echo -e "Humidity - $humid4 %"
    echo -e "Wind speed - $wind44 $symb2"
    echo -e "Wind direction - $dire4°"
    echo -e "Weather condition - $condi4"
    echo -e ""
    "$local_rm" -f "/tmp/forecast.json"
    "$local_rm" -f "/tmp/current.json"
fi
exit 0
###################



Cheers!!!


(07 May 2017) Update Ends:






(19 November 2015) Update  Begins:

Starting from 9 October 2015 OpenweatherMap API requires a valid APPID for access. So you'll need to register at openWeatherMap and get your API key. It's simple and free plan is good enough for most cases. I've updated the script and instructions to reflect these changes. you can get the latest version of pmwf and read updated install instructions on GitHub page here,

pmwf on GitHub

I want to thank PackRat and ozitraveller for bringing this to attention. You guys rock  8)

(19 November 2015) Update Ends:



As per suggestion by VastOne I've modified the original script to display current weather conditions and a 3 days weather forecast.


#!/bin/bash

clear

latit=
longi=
uneet=

curl -s --connect-timeout 30 -o /tmp/current.json "http://api.openweathermap.org/data/2.5/weather?lat=$latit&lon=$longi&units=$uneet&mode=json"
curl -s --connect-timeout 30 -o /tmp/forecast.json "http://api.openweathermap.org/data/2.5/forecast/daily?lat=$latit&lon=$longi&cnt=4&units=$uneet&mode=json"

if [ ! -f /tmp/forecast.json ]; then
echo ""
echo -e "Unable to connect to openweathermap.org!"
echo -e "Check your internet connection!"
echo ""

exit 1

else
place=$(cat /tmp/forecast.json | jq -r '.city.name')
nation=$(cat /tmp/forecast.json | jq -r '.city.country')
time2=$(cat /tmp/forecast.json | jq -r '.list[1].dt')
time3=$(cat /tmp/forecast.json | jq -r '.list[2].dt')
time4=$(cat /tmp/forecast.json | jq -r '.list[3].dt')
time22=$(date -d @"$time2" +'%A, %d %B %Y')
time33=$(date -d @"$time3" +'%A, %d %B %Y')
time44=$(date -d @"$time4" +'%A, %d %B %Y')
tempcurrent=$(cat /tmp/current.json | jq -r '.main.temp')
min2=$(cat /tmp/forecast.json | jq -r '.list[1].temp.min')
min3=$(cat /tmp/forecast.json | jq -r '.list[2].temp.min')
min4=$(cat /tmp/forecast.json | jq -r '.list[3].temp.min')
max2=$(cat /tmp/forecast.json | jq -r '.list[1].temp.max')
max3=$(cat /tmp/forecast.json | jq -r '.list[2].temp.max')
max4=$(cat /tmp/forecast.json | jq -r '.list[3].temp.max')
pressurecurrent=$(cat /tmp/current.json | jq -r '.main.pressure')
pressure2=$(cat /tmp/forecast.json | jq -r '.list[1].pressure')
pressure3=$(cat /tmp/forecast.json | jq -r '.list[2].pressure')
pressure4=$(cat /tmp/forecast.json | jq -r '.list[3].pressure')
humidcurrent=$(cat /tmp/current.json | jq -r '.main.humidity')
humid2=$(cat /tmp/forecast.json | jq -r '.list[1].humidity')
humid3=$(cat /tmp/forecast.json | jq -r '.list[2].humidity')
humid4=$(cat /tmp/forecast.json | jq -r '.list[3].humidity')
windcurrent=$(cat /tmp/current.json | jq -r '.wind.speed')
wind2=$(cat /tmp/forecast.json | jq -r '.list[1].speed')
wind3=$(cat /tmp/forecast.json | jq -r '.list[2].speed')
wind4=$(cat /tmp/forecast.json | jq -r '.list[3].speed')
direcurrent=$(cat /tmp/current.json | jq -r '.wind.deg')
dire2=$(cat /tmp/forecast.json | jq -r '.list[1].deg')
dire3=$(cat /tmp/forecast.json | jq -r '.list[2].deg')
dire4=$(cat /tmp/forecast.json | jq -r '.list[3].deg')
condicurrent=$(cat /tmp/current.json | jq -r '.weather[].description')
condi2=$(cat /tmp/forecast.json | jq -r '.list[1].weather[].description')
condi3=$(cat /tmp/forecast.json | jq -r '.list[2].weather[].description')
condi4=$(cat /tmp/forecast.json | jq -r '.list[3].weather[].description')

if [ "$uneet" == imperial ]
then
windcurrent1="$windcurrent"
wind22="$wind2"
wind33="$wind3"
wind44="$wind4"
symb=°F
symb2=mph
else
windcurrent1=$(perl -le 'print $ARGV[0] * 3.6' "$windcurrent")
wind22=$(perl -le 'print $ARGV[0] * 3.6' "$wind2")
wind33=$(perl -le 'print $ARGV[0] * 3.6' "$wind3")
wind44=$(perl -le 'print $ARGV[0] * 3.6' "$wind4")
symb=°C
symb2=kph
fi

echo ""
echo -e "Location - $place, $nation:"
echo ""
echo -e "Current weather conditions:"
echo ""
echo -e "Temperature - $tempcurrent $symb"
echo -e "Atmospheric Pressure - $pressurecurrent hPa"
echo -e "Humidity - $humidcurrent %"
echo -e "Wind speed - $windcurrent1 $symb2"
echo -e "Wind direction - $direcurrent°"
echo -e "Weather condition - $condicurrent"
echo ""
echo ""
echo -e "Forecast for $time22:"
echo ""
echo -e "Minimum Temperature - $min2 $symb"
echo -e "Maximum Temperature - $max2 $symb"
echo -e "Atmospheric Pressure - $pressure2 hPa"
echo -e "Humidity - $humid2 %"
echo -e "Wind speed - $wind22 $symb2"
echo -e "Wind direction - $dire2°"
echo -e "Weather condition - $condi2"
echo ""
echo ""
echo -e "Forecast for $time33:"
echo ""
echo -e "Minimum Temperature - $min3 $symb"
echo -e "Maximum Temperature - $max3 $symb"
echo -e "Atmospheric Pressure - $pressure3 hPa"
echo -e "Humidity - $humid3 %"
echo -e "Wind speed - $wind33 $symb2"
echo -e "Wind direction - $dire3°"
echo -e "Weather condition - $condi3"
echo ""
echo ""
echo -e "Forecast for $time44:"
echo ""
echo -e "Minimum Temperature - $min4 $symb"
echo -e "Maximum Temperature - $max4 $symb"
echo -e "Atmospheric Pressure - $pressure4 hPa"
echo -e "Humidity - $humid4 %"
echo -e "Wind speed - $wind44 $symb2"
echo -e "Wind direction - $dire4°"
echo -e "Weather condition - $condi4"
echo ""

rm /tmp/forecast.json
rm /tmp/current.json

fi

exit 0



For this script to work you'll need to install one little tool first. Don't worry, it's easy. Just do this in your terminal,


sudo apt-get install jq


Next go to following website and search for the latitude-longitude of your place,

Tageo WorldWide Index

Open the script in your favorite text editor. Right at the beginning of the file you will find three empty variables 'latit', 'longi', and 'uneet'. You need to assign latitude of your location to the variable 'latit', longitude of your location to the variable 'longi' and your preferred units system to the variable 'uneet'. There are two main units systems in use. metric and imperial. Which one should you use? If you prefer to measure temperature in Celsius (Centigrade) & distance in Kilometres (km), use metric. And if you prefer to measure temperature in Fahrenheit & distance in Miles (mi), use imperial.

For example for a VSIDO user in London, UK it would look like this,


latit=51.500
longi=-0.117
uneet=metric


And for someone in New York, US it would look like,


latit=40.714
longi=-74.006
uneet=imperial


Save the script after making the necessary changes with the name 'pmwf' somewhere in your $PATH and 'chmod 755' it.
Whenever you wish to see some weather info for your place simply open terminal, type pmwf, hit Enter and you'll have current weather conditions with a 3 day weather forecast right in terminal.

Cheers!!!
#31
EDIT BEGINS (23, July 2015) :
Made changes to mplayer cache for efficient handling of streams.
EDIT ENDS:

Snap's topic here,
What do you use for radio?
inspired this script. Save it somewhere in your $PATH with the name 'radio_vsido' and 'chmod 755' it. I've included 43 radio stations. If you wish to expand the list or include your own favorite stations all you need to do is open the script in your text-editor, have a good look at it and add the new stations to it. If you have a problem understanding the script you can always ask about it here. The script doesn't have any dependencies outside the standard VSIDO install.
Make sure you run the script with the terminal emulator (xfce4-terminal in VSIDO) maximized to be able to view the complete station list. Looking forward to suggestions-views-reviews.


#!/bin/bash

RED='\e[41m'
BLUE='\e[44m'
NC='\e[0m'

PLAYER="mplayer -nolirc -really-quiet -cache 512 -cache-min 25"

while :
do
clear
echo ""
echo -e "$BLUE RADIO VSIDO $NC"
echo ""
echo ""
echo -e "Station $BLUE List $NC :"
echo ""
echo -e "$BLUE 01 $NC  7 Inch Soul                     $BLUE 02 $NC  BAGeL Radio"
echo -e "$BLUE 03 $NC  Beat Blender                    $BLUE 04 $NC  Boot Liquor"
echo -e "$BLUE 05 $NC  Black Rock FM                   $BLUE 06 $NC  cliqhop idm"
echo -e "$BLUE 07 $NC  Covers                          $BLUE 08 $NC  Deep Space One"
echo -e "$BLUE 09 $NC  DEF CON Radio                   $BLUE 10 $NC  Digitalis"
echo -e "$BLUE 11 $NC  Doomed                          $BLUE 12 $NC  Drone Zone"
echo -e "$BLUE 13 $NC  Dub Step Beyond                 $BLUE 14 $NC  Earwaves"
echo -e "$BLUE 15 $NC  Folk Forward                    $BLUE 16 $NC  Groove Salad"
echo -e "$BLUE 17 $NC  Illinois Street Lounge          $BLUE 18 $NC  Indie Pop Rocks!"
echo -e "$BLUE 19 $NC  Lush                            $BLUE 20 $NC  Mission Control"
echo -e "$BLUE 21 $NC  PopTron                         $BLUE 22 $NC  Secret Agent"
echo -e "$BLUE 23 $NC  SF 10–33                        $BLUE 24 $NC  Sonic Universe"
echo -e "$BLUE 25 $NC  Space Station Soma              $BLUE 26 $NC  Suburbs of Goa"
echo -e "$BLUE 27 $NC  The Trip                        $BLUE 28 $NC  Underground 80s"
echo -e "$BLUE 29 $NC  BBC Radio 1                     $BLUE 30 $NC  BBC Radio 2"
echo -e "$BLUE 31 $NC  BBC Radio 3                     $BLUE 32 $NC  BBC Radio 4"
echo -e "$BLUE 33 $NC  BBC Radio 4 Extra               $BLUE 34 $NC  BBC World Service"
echo -e "$BLUE 35 $NC  All 60s All the Time            $BLUE 36 $NC  Beatles-A-Rama"
echo -e "$BLUE 37 $NC  RADIO ENERGY                    $BLUE 38 $NC  Radio Paradise"
echo -e "$BLUE 39 $NC  Radio Record                    $BLUE 40 $NC  RADIO ROCK"
echo -e "$BLUE 41 $NC  Radio Swing Worldwide           $BLUE 42 $NC  Smooth Jazz"
echo -e "$BLUE 43 $NC  True Oldies Channel             $RED 44 $BLUE  Exit RADIO VSIDO $NC"
echo ""
echo ""
echo -e "Select a $BLUE station $NC between 1 to 43 and hit $BLUE [Enter] $NC to $BLUE PLAY $NC :"
echo ""
echo -e "Select $RED 44 $NC to $BLUE Exit $NC :"
echo ""
read VSIDO
case $VSIDO in

1)
clear
echo ""
echo -e "$BLUE RADIO VSIDO $NC"
echo ""
echo -e "Now $BLUE Playing $NC Station: $BLUE 7 Inch Soul $NC"
echo ""
echo -e "Press $BLUE [Space] $NC to pause Press $BLUE [Q] $NC to stop"
echo ""
$PLAYER http://ice.somafm.com/7soul
continue
;;

2)
clear
echo ""
echo -e "$BLUE RADIO VSIDO $NC"
echo ""
echo -e "Now $BLUE Playing $NC Station: $BLUE BAGeL Radio $NC"
echo ""
echo -e "Press $BLUE [Space] $NC to pause Press $BLUE [Q] $NC to stop"
echo ""
$PLAYER http://ice.somafm.com/bagel
continue
;;

3)
clear
echo ""
echo -e "$BLUE RADIO VSIDO $NC"
echo ""
echo -e "Now $BLUE Playing $NC Station: $BLUE Beat Blender $NC"
echo ""
echo -e "Press $BLUE [Space] $NC to pause Press $BLUE [Q] $NC to stop"
echo ""
$PLAYER http://ice.somafm.com/beatblender
continue
;;

4)
clear
echo ""
echo -e "$BLUE RADIO VSIDO $NC"
echo ""
echo -e "Now $BLUE Playing $NC Station: $BLUE Boot Liquor $NC"
echo ""
echo -e "Press $BLUE [Space] $NC to pause Press $BLUE [Q] $NC to stop"
echo ""
$PLAYER http://ice.somafm.com/bootliquor
continue
;;

5)
clear
echo ""
echo -e "$BLUE RADIO VSIDO $NC"
echo ""
echo -e "Now $BLUE Playing $NC Station: $BLUE Black Rock FM $NC"
echo ""
echo -e "Press $BLUE [Space] $NC to pause Press $BLUE [Q] $NC to stop"
echo ""
$PLAYER http://ice.somafm.com/brfm
continue
;;

6)
clear
echo ""
echo -e "$BLUE RADIO VSIDO $NC"
echo ""
echo -e "Now $BLUE Playing $NC Station: $BLUE cliqhop idm $NC"
echo ""
echo -e "Press $BLUE [Space] $NC to pause Press $BLUE [Q] $NC to stop"
echo ""
$PLAYER http://ice.somafm.com/cliqhop
continue
;;

7)
clear
echo ""
echo -e "$BLUE RADIO VSIDO $NC"
echo ""
echo -e "Now $BLUE Playing $NC Station: $BLUE Covers $NC"
echo ""
echo -e "Press $BLUE [Space] $NC to pause Press $BLUE [Q] $NC to stop"
echo ""
$PLAYER http://ice.somafm.com/covers
continue
;;

8)
clear
echo ""
echo -e "$BLUE RADIO VSIDO $NC"
echo ""
echo -e "Now $BLUE Playing $NC Station: $BLUE Deep Space One $NC"
echo ""
echo -e "Press $BLUE [Space] $NC to pause Press $BLUE [Q] $NC to stop"
echo ""
$PLAYER http://ice.somafm.com/deepspaceone
continue
;;

9)
clear
echo ""
echo -e "$BLUE RADIO VSIDO $NC"
echo ""
echo -e "Now $BLUE Playing $NC Station: $BLUE DEF CON Radio $NC"
echo ""
echo -e "Press $BLUE [Space] $NC to pause Press $BLUE [Q] $NC to stop"
echo ""
$PLAYER http://ice.somafm.com/defcon
continue
;;

10)
clear
echo ""
echo -e "$BLUE RADIO VSIDO $NC"
echo ""
echo -e "Now $BLUE Playing $NC Station: $BLUE Digitalis $NC"
echo ""
echo -e "Press $BLUE [Space] $NC to pause Press $BLUE [Q] $NC to stop"
echo ""
$PLAYER http://ice.somafm.com/digitalis
continue
;;

11)
clear
echo ""
echo -e "$BLUE RADIO VSIDO $NC"
echo ""
echo -e "Now $BLUE Playing $NC Station: $BLUE Doomed $NC"
echo ""
echo -e "Press $BLUE [Space] $NC to pause Press $BLUE [Q] $NC to stop"
echo ""
$PLAYER http://ice.somafm.com/doomed
continue
;;

12)
clear
echo ""
echo -e "$BLUE RADIO VSIDO $NC"
echo ""
echo -e "Now $BLUE Playing $NC Station: $BLUE Drone Zone $NC"
echo ""
echo -e "Press $BLUE [Space] $NC to pause Press $BLUE [Q] $NC to stop"
echo ""
$PLAYER http://ice.somafm.com/dronezone
continue
;;

13)
clear
echo ""
echo -e "$BLUE RADIO VSIDO $NC"
echo ""
echo -e "Now $BLUE Playing $NC Station: $BLUE Dub Step Beyond $NC"
echo ""
echo -e "Press $BLUE [Space] $NC to pause Press $BLUE [Q] $NC to stop"
echo ""
$PLAYER http://ice.somafm.com/dubstep
continue
;;

14)
clear
echo ""
echo -e "$BLUE RADIO VSIDO $NC"
echo ""
echo -e "Now $BLUE Playing $NC Station: $BLUE Earwaves $NC"
echo ""
echo -e "Press $BLUE [Space] $NC to pause Press $BLUE [Q] $NC to stop"
echo ""
$PLAYER http://ice.somafm.com/earwaves
continue
;;

15)
clear
echo ""
echo -e "$BLUE RADIO VSIDO $NC"
echo ""
echo -e "Now $BLUE Playing $NC Station: $BLUE Folk Forward $NC"
echo ""
echo -e "Press $BLUE [Space] $NC to pause Press $BLUE [Q] $NC to stop"
echo ""
$PLAYER http://ice.somafm.com/folkfwd
continue
;;

16)
clear
echo ""
echo -e "$BLUE RADIO VSIDO $NC"
echo ""
echo -e "Now $BLUE Playing $NC Station: $BLUE Groove Salad $NC"
echo ""
echo -e "Press $BLUE [Space] $NC to pause Press $BLUE [Q] $NC to stop"
echo ""
$PLAYER http://ice.somafm.com/groovesalad
continue
;;

17)
clear
echo ""
echo -e "$BLUE RADIO VSIDO $NC"
echo ""
echo -e "Now $BLUE Playing $NC Station: $BLUE Illinois Street Lounge $NC"
echo ""
echo -e "Press $BLUE [Space] $NC to pause Press $BLUE [Q] $NC to stop"
echo ""
$PLAYER http://ice.somafm.com/illstreet
continue
;;

18)
clear
echo ""
echo -e "$BLUE RADIO VSIDO $NC"
echo ""
echo -e "Now $BLUE Playing $NC Station: $BLUE Indie Pop Rocks! $NC"
echo ""
echo -e "Press $BLUE [Space] $NC to pause Press $BLUE [Q] $NC to stop"
echo ""
$PLAYER http://ice.somafm.com/indiepop
continue
;;

19)
clear
echo ""
echo -e "$BLUE RADIO VSIDO $NC"
echo ""
echo -e "Now $BLUE Playing $NC Station: $BLUE Lush $NC"
echo ""
echo -e "Press $BLUE [Space] $NC to pause Press $BLUE [Q] $NC to stop"
echo ""
$PLAYER http://ice.somafm.com/lush
continue
;;

20)
clear
echo ""
echo -e "$BLUE RADIO VSIDO $NC"
echo ""
echo -e "Now $BLUE Playing $NC Station: $BLUE Mission Control $NC"
echo ""
echo -e "Press $BLUE [Space] $NC to pause Press $BLUE [Q] $NC to stop"
echo ""
$PLAYER http://ice.somafm.com/missioncontrol
continue
;;

21)
clear
echo ""
echo -e "$BLUE RADIO VSIDO $NC"
echo ""
echo -e "Now $BLUE Playing $NC Station: $BLUE PopTron $NC"
echo ""
echo -e "Press $BLUE [Space] $NC to pause Press $BLUE [Q] $NC to stop"
echo ""
$PLAYER http://ice.somafm.com/poptron
continue
;;

22)
clear
echo ""
echo -e "$BLUE RADIO VSIDO $NC"
echo ""
echo -e "Now $BLUE Playing $NC Station: $BLUE Secret Agent $NC"
echo ""
echo -e "Press $BLUE [Space] $NC to pause Press $BLUE [Q] $NC to stop"
echo ""
$PLAYER http://ice.somafm.com/secretagent
continue
;;

23)
clear
echo ""
echo -e "$BLUE RADIO VSIDO $NC"
echo ""
echo -e "Now $BLUE Playing $NC Station: $BLUE SF 10–33 $NC"
echo ""
echo -e "Press $BLUE [Space] $NC to pause Press $BLUE [Q] $NC to stop"
echo ""
$PLAYER http://ice.somafm.com/sf1033
continue
;;

24)
clear
echo ""
echo -e "$BLUE RADIO VSIDO $NC"
echo ""
echo -e "Now $BLUE Playing $NC Station: $BLUE Sonic Universe $NC"
echo ""
echo -e "Press $BLUE [Space] $NC to pause Press $BLUE [Q] $NC to stop"
echo ""
$PLAYER http://ice.somafm.com/sonicuniverse
continue
;;

25)
clear
echo ""
echo -e "$BLUE RADIO VSIDO $NC"
echo ""
echo -e "Now $BLUE Playing $NC Station: $BLUE Space Station Soma $NC"
echo ""
echo -e "Press $BLUE [Space] $NC to pause Press $BLUE [Q] $NC to stop"
echo ""
$PLAYER http://ice.somafm.com/spacestation
continue
;;

26)
clear
echo ""
echo -e "$BLUE RADIO VSIDO $NC"
echo ""
echo -e "Now $BLUE Playing $NC Station: $BLUE Suburbs of Goa $NC"
echo ""
echo -e "Press $BLUE [Space] $NC to pause Press $BLUE [Q] $NC to stop"
echo ""
$PLAYER http://ice.somafm.com/suburbsofgoa
continue
;;

27)
clear
echo ""
echo -e "$BLUE RADIO VSIDO $NC"
echo ""
echo -e "Now $BLUE Playing $NC Station: $BLUE The Trip $NC"
echo ""
echo -e "Press $BLUE [Space] $NC to pause Press $BLUE [Q] $NC to stop"
echo ""
$PLAYER http://ice.somafm.com/thetrip
continue
;;

28)
clear
echo ""
echo -e "$BLUE RADIO VSIDO $NC"
echo ""
echo -e "Now $BLUE Playing $NC Station: $BLUE Underground 80s $NC"
echo ""
echo -e "Press $BLUE [Space] $NC to pause Press $BLUE [Q] $NC to stop"
echo ""
$PLAYER http://ice.somafm.com/u80s
continue
;;

29)
clear
echo ""
echo -e "$BLUE RADIO VSIDO $NC"
echo ""
echo -e "Now $BLUE Playing $NC Station: $BLUE BBC Radio 1 $NC"
echo ""
echo -e "Press $BLUE [Space] $NC to pause Press $BLUE [Q] $NC to stop"
echo ""
$PLAYER http://bbcmedia.ic.llnwd.net/stream/bbcmedia_radio1_mf_q
continue
;;

30)
clear
echo ""
echo -e "$BLUE RADIO VSIDO $NC"
echo ""
echo -e "Now $BLUE Playing $NC Station: $BLUE BBC Radio 2 $NC"
echo ""
echo -e "Press $BLUE [Space] $NC to pause Press $BLUE [Q] $NC to stop"
echo ""
$PLAYER http://bbcmedia.ic.llnwd.net/stream/bbcmedia_radio2_mf_q
continue
;;

31)
clear
echo ""
echo -e "$BLUE RADIO VSIDO $NC"
echo ""
echo -e "Now $BLUE Playing $NC Station: $BLUE BBC Radio 3 $NC"
echo ""
echo -e "Press $BLUE [Space] $NC to pause Press $BLUE [Q] $NC to stop"
echo ""
$PLAYER http://open.live.bbc.co.uk/mediaselector/5/select/version/2.0/mediaset/http-icy-aac-lc-a/format/pls/vpid/bbc_radio_three.pls
continue
;;

32)
clear
echo ""
echo -e "$BLUE RADIO VSIDO $NC"
echo ""
echo -e "Now $BLUE Playing $NC Station: $BLUE BBC Radio 4 $NC"
echo ""
echo -e "Press $BLUE [Space] $NC to pause Press $BLUE [Q] $NC to stop"
echo ""
$PLAYER http://bbcmedia.ic.llnwd.net/stream/bbcmedia_radio4fm_mf_q
continue
;;

33)
clear
echo ""
echo -e "$BLUE RADIO VSIDO $NC"
echo ""
echo -e "Now $BLUE Playing $NC Station: $BLUE BBC Radio 4 Extra $NC"
echo ""
echo -e "Press $BLUE [Space] $NC to pause Press $BLUE [Q] $NC to stop"
echo ""
$PLAYER http://bbcmedia.ic.llnwd.net/stream/bbcmedia_radio4extra_mf_q
continue
;;

34)
clear
echo ""
echo -e "$BLUE RADIO VSIDO $NC"
echo ""
echo -e "Now $BLUE Playing $NC Station: $BLUE BBC World Service $NC"
echo ""
echo -e "Press $BLUE [Space] $NC to pause Press $BLUE [Q] $NC to stop"
echo ""
$PLAYER http://wsdownload.bbc.co.uk/worldservice/meta/live/shoutcast/mp3/eieuk.pls
continue
;;

35)
clear
echo ""
echo -e "$BLUE RADIO VSIDO $NC"
echo ""
echo -e "Now $BLUE Playing $NC Station: $BLUE All 60s All the Time $NC"
echo ""
echo -e "Press $BLUE [Space] $NC to pause Press $BLUE [Q] $NC to stop"
echo ""
$PLAYER http://streaming303.radionomy.com:80/keepfree60s
continue
;;

36)
clear
echo ""
echo -e "$BLUE RADIO VSIDO $NC"
echo ""
echo -e "Now $BLUE Playing $NC Station: $BLUE Beatles-A-Rama $NC"
echo ""
echo -e "Press $BLUE [Space] $NC to pause Press $BLUE [Q] $NC to stop"
echo ""
$PLAYER http://streaming303.radionomy.com:80/beatlesarama
continue
;;

37)
clear
echo ""
echo -e "$BLUE RADIO VSIDO $NC"
echo ""
echo -e "Now $BLUE Playing $NC Station: $BLUE RADIO ENERGY $NC"
echo ""
echo -e "Press $BLUE [Space] $NC to pause Press $BLUE [Q] $NC to stop"
echo ""
$PLAYER http://stream.radioreklama.bg:80/nrj.ogg
continue
;;

38)
clear
echo ""
echo -e "$BLUE RADIO VSIDO $NC"
echo ""
echo -e "Now $BLUE Playing $NC Station: $BLUE Radio Paradise $NC"
echo ""
echo -e "Press $BLUE [Space] $NC to pause Press $BLUE [Q] $NC to stop"
echo ""
$PLAYER http://stream-uk1.radioparadise.com:80/mp3-192
continue
;;

39)
clear
echo ""
echo -e "$BLUE RADIO VSIDO $NC"
echo ""
echo -e "Now $BLUE Playing $NC Station: $BLUE Radio Record $NC"
echo ""
echo -e "Press $BLUE [Space] $NC to pause Press $BLUE [Q] $NC to stop"
echo ""
$PLAYER http://air.radiorecord.ru:8101/rr_128
continue
;;

40)
clear
echo ""
echo -e "$BLUE RADIO VSIDO $NC"
echo ""
echo -e "Now $BLUE Playing $NC Station: $BLUE RADIO ROCK $NC"
echo ""
echo -e "Press $BLUE [Space] $NC to pause Press $BLUE [Q] $NC to stop"
echo ""
$PLAYER http://stream.radioreklama.bg:80/radio1rock.ogg
continue
;;

41)
clear
echo ""
echo -e "$BLUE RADIO VSIDO $NC"
echo ""
echo -e "Now $BLUE Playing $NC Station: $BLUE Radio Swing Worldwide $NC"
echo ""
echo -e "Press $BLUE [Space] $NC to pause Press $BLUE [Q] $NC to stop"
echo ""
$PLAYER http://streaming303.radionomy.com:80/radioswingworldwide
continue
;;

42)
clear
echo ""
echo -e "$BLUE RADIO VSIDO $NC"
echo ""
echo -e "Now $BLUE Playing $NC Station: $BLUE Smooth Jazz $NC"
echo ""
echo -e "Press $BLUE [Space] $NC to pause Press $BLUE [Q] $NC to stop"
echo ""
$PLAYER http://hestia.cdnstream.com:80/1256_128
continue
;;

43)
clear
echo ""
echo -e "$BLUE RADIO VSIDO $NC"
echo ""
echo -e "Now $BLUE Playing $NC Station: $BLUE True Oldies Channel $NC"
echo ""
echo -e "Press $BLUE [Space] $NC to pause Press $BLUE [Q] $NC to stop"
echo ""
$PLAYER http://streaming304.radionomy.com:80/trueoldies
continue
;;

44)
clear
echo ""
echo -e "$BLUE 'When I die, just keep playing the records' $RED Jimi Hendrix $NC"
echo ""
sleep 3
clear
break
exit 0
;;

*)
clear
echo ""
echo -e "$RED Wrong Choice!!! $NC"
echo ""
sleep 3
clear
continue
;;

esac
done



Cheers!!!
#32
pmdc is a simple bash script that calculates distance & travel time between two locations. Distance & travel time are calculated using the road network (Driving mode in map parlance). Those of you living in the good ol' US of A can even use short names for their states like ca, ny, dc, etc. etc.
Any dependencies? Well only one. And it's simple to install too,

sudo apt-get install jq


Ready for the script? Here you go,

#!/bin/bash

clear

echo ""
echo -e "pmdc calculates distance & travel time between two locations."
echo ""
echo -e "Distance & travel time are calculated using the road network."
echo ""
echo -e "Press Enter key to continue...."
echo ""
read EnterKey
clear
echo ""
echo -e "Location 1 - From:"
echo ""
echo ""
echo -e "Enter the name of city-town-village"
echo ""
read village
echo ""
echo -e "Enter the name of state-county-province"
echo ""
read province
echo ""
echo -e "Enter the name of country"
echo ""
read country
clear
echo ""
echo -e "Location 2 - To:"
echo ""
echo ""
echo -e "Enter the name of city-town-village"
echo ""
read city
echo ""
echo -e "Enter the name of state-county-province"
echo ""
read state
echo ""
echo -e "Enter the name of country"
echo ""
read name
clear

city_1=$(echo "$village" | sed 's/ \+/+/g')
state_1=$(echo "$province" | sed 's/ \+/+/g')
country_1=$(echo "$country" | sed 's/ \+/+/g')
city_2=$(echo "$city" | sed 's/ \+/+/g')
state_2=$(echo "$state" | sed 's/ \+/+/g')
country_2=$(echo "$name" | sed 's/ \+/+/g')

curl -s --connect-timeout 30 -o /tmp/pmdc.json "https://maps.googleapis.com/maps/api/distancematrix/json?origins=$city_1+$state_1+$country_1&destinations=$city_2+$state_2+$country_2&language=en"

if [ ! -f /tmp/pmdc.json ]; then
echo ""
echo -e "Unable to connect to Internet!"
echo -e "Check your Internet connection!"
echo ""

exit 1

else

addvalid=$(cat /tmp/pmdc.json | grep "NOT_FOUND")

if [[ -n "$addvalid" ]]; then
echo ""
echo -e "No results found!"
echo -e "May be you misspelled a name?!?"
echo ""

exit 1

else

resvalid=$(cat /tmp/pmdc.json | grep "ZERO_RESULTS")

if [[ -n "$resvalid" ]]; then
echo ""
echo -e "Sorry! No distance data is available!"
echo ""

exit 1

else

orgadd=$(cat /tmp/pmdc.json | jq -r '.origin_addresses' | sed -e 's/\"//g' -e 's/\[//g' -e 's/\]//g' -e 's/^[ \t]*//')
desadd=$(cat /tmp/pmdc.json | jq -r '.destination_addresses' | sed -e 's/\"//g' -e 's/\[//g' -e 's/\]//g' -e 's/^[ \t]*//')
distbet=$(cat /tmp/pmdc.json | jq -r '.rows[].elements[].distance.text')
durabet=$(cat /tmp/pmdc.json | jq -r '.rows[].elements[].duration.text')

echo ""
echo -e "From: $orgadd"
echo ""
echo -e "To: $desadd"
echo ""
echo -e "Distance -> $distbet"
echo ""
echo -e "Travel time -> $durabet"
echo ""

rm /tmp/pmdc.json

fi
fi
fi

exit 0



Save this script with the name 'pmdc' somewhere in your $PATH and 'chmod 755' it.
Open terminal and run 'pmdc' whenever you are planning a driving trip and it will give you the exact distance and approximate travel time.
By the way pmdc means Poor Man's Distance Calculator.
Cheers!!!
#33
Good news for all those interested in astronomy and space science. I've created a silly little bash script called 'iss' that gets you the following information right in your terminal,

  • Current position of International Space Station (ISS) in latitude-longitude. And if map data is available for the current location then the script will display name-address of the location.
  • Passing date-time and duration of ISS for your location.
  • Number of people currently in space, their name(s), and the name(s) of spacecraft they are on.
Sounds interesting? Only dependency of this script is 'jq'.

sudo apt-get install jq


Here is the script 'iss',

#!/bin/bash

latit=
longi=
eleva=

curl -s --connect-timeout 30 -o /tmp/issn.json "http://api.open-notify.org/iss-now.json"
curl -s --connect-timeout 30 -o /tmp/issp.json "http://api.open-notify.org/iss-pass.json?lat=$latit&lon=$longi&alt=$eleva&n=10"
curl -s --connect-timeout 30 -o /tmp/astros.json "http://api.open-notify.org/astros.json"

issnowtu=$(cat /tmp/issn.json | jq -r '.timestamp')
issnowth=$(date -d @"$issnowtu" +'%H:%M:%S (%d-%m-%Y)')
latit=$(cat /tmp/issn.json | jq -r '.iss_position.latitude')
longi=$(cat /tmp/issn.json | jq -r '.iss_position.longitude')
isspd1=$(cat /tmp/issp.json | jq -r '.response[0].duration')
isspd11=$(printf '%d:%02d\n' $(($isspd1/60%60)) $(($isspd1%60)))
isspd2=$(cat /tmp/issp.json | jq -r '.response[1].duration')
isspd22=$(printf '%d:%02d\n' $(($isspd2/60%60)) $(($isspd2%60)))
isspd3=$(cat /tmp/issp.json | jq -r '.response[2].duration')
isspd33=$(printf '%d:%02d\n' $(($isspd3/60%60)) $(($isspd3%60)))
isspd4=$(cat /tmp/issp.json | jq -r '.response[3].duration')
isspd44=$(printf '%d:%02d\n' $(($isspd4/60%60)) $(($isspd4%60)))
isspd5=$(cat /tmp/issp.json | jq -r '.response[4].duration')
isspd55=$(printf '%d:%02d\n' $(($isspd5/60%60)) $(($isspd5%60)))
isspd6=$(cat /tmp/issp.json | jq -r '.response[5].duration')
isspd66=$(printf '%d:%02d\n' $(($isspd6/60%60)) $(($isspd6%60)))
isspd7=$(cat /tmp/issp.json | jq -r '.response[6].duration')
isspd77=$(printf '%d:%02d\n' $(($isspd7/60%60)) $(($isspd7%60)))
isspd8=$(cat /tmp/issp.json | jq -r '.response[7].duration')
isspd88=$(printf '%d:%02d\n' $(($isspd8/60%60)) $(($isspd8%60)))
isspd9=$(cat /tmp/issp.json | jq -r '.response[8].duration')
isspd99=$(printf '%d:%02d\n' $(($isspd9/60%60)) $(($isspd9%60)))
isspd10=$(cat /tmp/issp.json | jq -r '.response[9].duration')
isspd100=$(printf '%d:%02d\n' $(($isspd10/60%60)) $(($isspd10%60)))
isspt1=$(cat /tmp/issp.json | jq -r '.response[0].risetime')
isspt11=$(date -d @"$isspt1" +'%d-%m-%Y (%H:%M:%S)')
isspt2=$(cat /tmp/issp.json | jq -r '.response[1].risetime')
isspt22=$(date -d @"$isspt2" +'%d-%m-%Y (%H:%M:%S)')
isspt3=$(cat /tmp/issp.json | jq -r '.response[2].risetime')
isspt33=$(date -d @"$isspt3" +'%d-%m-%Y (%H:%M:%S)')
isspt4=$(cat /tmp/issp.json | jq -r '.response[3].risetime')
isspt44=$(date -d @"$isspt4" +'%d-%m-%Y (%H:%M:%S)')
isspt5=$(cat /tmp/issp.json | jq -r '.response[4].risetime')
isspt55=$(date -d @"$isspt5" +'%d-%m-%Y (%H:%M:%S)')
isspt6=$(cat /tmp/issp.json | jq -r '.response[5].risetime')
isspt66=$(date -d @"$isspt6" +'%d-%m-%Y (%H:%M:%S)')
isspt7=$(cat /tmp/issp.json | jq -r '.response[6].risetime')
isspt77=$(date -d @"$isspt7" +'%d-%m-%Y (%H:%M:%S)')
isspt8=$(cat /tmp/issp.json | jq -r '.response[7].risetime')
isspt88=$(date -d @"$isspt8" +'%d-%m-%Y (%H:%M:%S)')
isspt9=$(cat /tmp/issp.json | jq -r '.response[8].risetime')
isspt99=$(date -d @"$isspt9" +'%d-%m-%Y (%H:%M:%S)')
isspt10=$(cat /tmp/issp.json | jq -r '.response[9].risetime')
isspt100=$(date -d @"$isspt10" +'%d-%m-%Y (%H:%M:%S)')
astrock=$(cat /tmp/astros.json | grep "0,")

curl -s --connect-timeout 30 -o /tmp/gcd.json "https://maps.googleapis.com/maps/api/geocode/json?latlng=$latit,$longi&components=locality&language=en"

issnowl=$(cat /tmp/gcd.json | jq -r '.results[0].formatted_address')
issnowlc=$(cat /tmp/gcd.json | grep "ZERO_RESULTS")
echo ""
#echo -e "International Space Station (ISS) on $issnowth is over,"
echo -e "Current Time -> $issnowth"
echo ""
echo -e "Current Location of ISS :"
echo ""
echo -e "Latitude -> $latit"
echo -e "Longitude -> $longi"
echo ""
echo -e "In layman's term ISS is currently over the skies of,"
echo ""

if [[ -z "$issnowlc" ]]; then
echo -e "$issnowl"
else
echo -e "Some unmapped region of earth."
echo ""
fi

echo ""
echo -e "ISS will pass over your location at these times :"
echo ""
echo -e "Passing Date & Time -> $isspt11"
echo -e "Passing Duration (Minutes:Seconds) -> $isspd11"
echo ""
echo -e "Passing Date & Time -> $isspt22"
echo -e "Passing Duration (Minutes:Seconds) -> $isspd22"
echo ""
echo -e "Passing Date & Time -> $isspt33"
echo -e "Passing Duration (Minutes:Seconds) -> $isspd33"
echo ""
echo -e "Passing Date & Time -> $isspt44"
echo -e "Passing Duration (Minutes:Seconds) -> $isspd44"
echo ""
echo -e "Passing Date & Time -> $isspt55"
echo -e "Passing Duration (Minutes:Seconds) -> $isspd55"
echo ""
echo -e "Passing Date & Time -> $isspt66"
echo -e "Passing Duration (Minutes:Seconds) -> $isspd66"
echo ""
echo -e "Passing Date & Time -> $isspt77"
echo -e "Passing Duration (Minutes:Seconds) -> $isspd77"
echo ""
echo -e "Passing Date & Time -> $isspt88"
echo -e "Passing Duration (Minutes:Seconds) -> $isspd88"
echo ""
echo -e "Passing Date & Time -> $isspt99"
echo -e "Passing Duration (Minutes:Seconds) -> $isspd99"
echo ""
echo -e "Passing Date & Time -> $isspt100"
echo -e "Passing Duration (Minutes:Seconds) -> $isspd100"
echo ""
echo ""

if [[ -z "$astrock" ]]; then

astrop=$(cat /tmp/astros.json | jq -r '.people[] | .name')
astroc=$(cat /tmp/astros.json | jq -r '.people[] | .craft')
astropc=$(paste <(echo "$astrop") <(echo "$astroc"))
astropn=$(cat /tmp/astros.json | jq -r '.number')

echo -e "Do you know there are $astropn humans in space currently!"
echo -e "Here are the names of astronauts & spacecraft they are on,"
echo ""
echo -e "$astropc" | sed -e "s/[[:space:]]\+/ /g"
echo ""
else
echo ""
fi

rm /tmp/issn.json
rm /tmp/issp.json
rm /tmp/astros.json
rm /tmp/gcd.json
exit 0



Save the script 'iss' somewhere in your $PATH and 'chmod 755' it. You need to add values to a few variables in the script before using it. First variable is 'latit'. Assign the latitude of your location to it. The second variable is 'longi'. Assign the longitude of your location to it, Last variable is 'eleva'. Assign the elevation (in meters) of your location to it. Save the changes. Where do you get the latitude-longitude-elevation for your place? Easy! Just go to the following website and search for the laitude-longitude-elevation of your location,

HeavensAbove - Location selector

Type 'iss' in your terminal, hit enter and have sum astronomical fun!
Looking forward to your feedback on this script.
Cheers!!!
#34
Short URLs can be a security risk. 'unshorten' is a simple bash script that displays the original link of a short URL. It doesn't depend on any third party service.


#!/bin/sh
echo ""
echo "Expands a short url & displays the original url."
echo ""
echo "Enter a short url: "
read input_variable
if long=$(curl -s -o /dev/null --head -w "%{url_effective}\n" -L "$input_variable"); then
echo "Original url -> $long"
else
echo "Sorry! Invalid url!"
fi



Save this script some where in your path with the name 'unshorten' and give it 'Execute' permission. Next time you come across a short URL, Don't blindly click-open it in your Browser or Mail Application, Run 'unshorten' from your terminal and enter the short URL when prompted and 'unshorten' will return the original URL.
More info on 'unshorten' can be found here,
unshorten
Cheers!!!
#35
Here is a simple bash script that shortens a long URL using tny.im. It can also shorten email, Bitcoin, Dogecoin, Litecoin addresses.


#!/bin/sh
if [ -t 0 ]; then
if [ -z "$1" ]; then
echo ""
echo "Shortens url with tny.im url shortener."
echo ""
echo "It shortens email & Bitcoin-Dogecoin-Litecoin addresses too."
echo ""
echo "Usage: tny long_url_address keyword"
echo ""
echo "Second argument 'keyword' is optional. Use it to customize the short url."
echo ""
exit 1
fi
url=$1;
else
while read -r line; do
url=$line
done
fi
printf "%s" "Short url -> " && echo `wget -q -O - http://tny.im/yourls-api.php?action=shorturl\&format=simple\&url="$url"\&keyword="$2"`



Save this script some where in your path with the name 'tny' and give it 'Execute' permission. Next time you want to shorten a long URL, simply run 'tny' from your terminal.
More info can be found here,
tny
Cheers!!!
#36
I'm sure there used to be a logout button on vsido site even when visited via a mobile browser. But now I can't seem to find it anywhere! It's not a huge problem but I thought I should bring this to VastOne's attension.
Cheers!!!
#37
Scripts / Poor Man's Youtube Downloader
April 26, 2015, 07:16:47 PM


(11 September 2016) UPDATE BEGINS:

Added support to download videos in 4K and 1080P resolutions.
You can now download entire playlists in 4K -1080P resolutions.
Improved audio only download function. Audio only downloads are much faster now.
Suppressed scary & pointless youtube-dl warnings.

The script has become a bit too big to paste here directly so I'm linking the GitHub repo of pmytd here,
pmytd on GitHub
Please check-out the GitHub repo and update pmytd.

Cheers!!!

(11 September 2016) UPDATE ENDS:





(04 September 2016) UPDATE BEGINS:
A major update! Almost a complete rewrite!
Fixed the youtube-dl update function.
Added dependency check in the script.
Added option to install youtube-dl if it's not available.
Added option to download the video in the best quality skipping the manual selection. Thanks a & Snap!
And many other improvements.
The script has become a bit too big to paste here directly so I'm linking the GitHub repo of pmytd here,
pmytd on GitHub
Please check-out the GitHub repo and update pmytd.
Cheers!!!
(04 September 2016) UPDATE ENDS:





(23 August 2015) UPDATE BEGINS:
Removed overly complicated sudo availability check. Improved update-check part.
So here it is, the latest-greatest version of pmytd.


#!/bin/bash

function ByE (){
clear
echo ""
echo -e '\E[1;31;40m'"It's "'\E[1;32;40m'"funny "'\E[1;33;40m'" how"'\E[1;35;40m'" the"'\E[1;36;40m'" colors"'\E[1;31;40m'" of"'\E[1;32;40m'" the"'\E[1;33;40m'" real"'\E[1;35;40m'" world"'\E[1;36;40m'" only"'\E[1;31;40m'" seem"'\E[1;32;40m'" really"'\E[1;33;40m'" real"
echo -e '\E[1;36;40m'"when "'\E[1;31;40m'"you "'\E[1;32;40m'"viddy "'\E[1;33;40m'"them "'\E[1;35;40m'"on "'\E[1;36;40m'"the "'\E[1;31;40m'"screen."
echo ""
echo -e '\e[0m'"Alex, A Clockwork Orange"
echo ""
sleep 4
clear
exit 0
}

function HelP (){
clear
printf "%s\n" "" "Having problems running PMYTD?" "" "First make sure you have all the required dependencies installed." "You can read more about it in 'Dependencies of PMYTD' option" "in PMYTD MENU." "" "Having problems downloading videos?" "" "Youtube and other video sharing sites continually change their APIs." "So it is advised to keep youtube-dl updated to latest version." "You can check for youtube-dl updates via 'Check for updates' option" "in PMYTD MENU." "If there is a newer version available then please update youtube-dl." "" "For any other queries you can contact me at," "http://hakerdefo.blogspot.com" "" "Press 'q' to return to PMYTD MENU" "" | less
}

function UpdatE (){
clear
ping -q -c 2 yt-dl.org >/dev/null 2>&1 || { clear; echo -e "Can't connect to youtube-dl server! Please try later!" >&2; read -rsp $'Press any key to return to PMYTD MENU...\n' -n1 key; MenU; }
ytdllv=$(curl -sL -w "%{url_effective}\\n" "https://yt-dl.org/downloads/latest/" -o /dev/null | cut -c 29- | sed 's/[/]//g')
ytdlcv=$(youtube-dl --version)
if [ "$ytdllv" == "$ytdlcv" ]; then
echo ""
echo -e "Installed version of youtube-dl - $ytdlcv"
echo -e "Available version of youtube-dl - $ytdllv"
echo ""
echo -e "youtube-dl is up-to-date."
echo ""
read -rsp $'Press any key to return to PMYTD MENU...\n' -n1 key
echo ""
clear
MenU
else
echo ""
echo -e "Installed version of youtube-dl - $ytdlcv"
echo -e "Available version of youtube-dl - $ytdllv"
echo ""
echo -e "youtube-dl update is available."
echo ""
echo -e "Would you like to update youtube-dl?"
echo ""
echo -e "01 Update youtube-dl"
echo -e "02 Return to PMYTD MENU"
echo ""
echo -e "Enter your choice: "
echo ""
read choice
case $choice in
1 | 01)
clear
ytdll=$(which youtube-dl)
if [ -w "$ytdll" ]; then
youtube-dl -U
echo ""
read -rsp $'Press any key to return to PMYTD MENU...\n' -n1 key
echo ""
clear
MenU
else
resu=$(whoami)
echo ""
echo "Please enter password for user $resu"
echo ""
sudo youtube-dl -U
echo ""
read -rsp $'Press any key to return to PMYTD MENU...\n' -n1 key
echo ""
clear
MenU
fi
;;
2 | 02)
clear
MenU
;;
*)
clear
echo ""
echo -e "$choice is an invalid option!"
echo ""
sleep 4
UpdatE
;;
esac
fi
}

function DiE(){
clear
echo ""
echo -e "OOPS!!! Something Went Wrong!!!"
echo -e "Please make sure '$link' exists."
echo -e "Also make sure video is available."
echo ""
exit 1
}

function AplS(){
clear
printf "%s\n" "" "Enter the youtube playlist link: " ""
read link
clear
youtube-dl --continue --yes-playlist --ignore-errors --extract-audio --audio-format "mp3" --audio-quality 0 --output "/home/$USER/Downloads/%(title)s.%(ext)s" "$link"
echo ""
read -rsp $'Press any key to return to PMYTD MENU...\n' -n1 key
echo ""
clear
MenU
}

function VplS(){
clear
printf "%s\n" "" "Enter the youtube playlist link: " ""
read link
clear
youtube-dl --continue --yes-playlist --ignore-errors --output "/home/$USER/Downloads/%(title)s.%(ext)s" "$link"
echo ""
read -rsp $'Press any key to return to PMYTD MENU...\n' -n1 key
echo ""
clear
MenU
}

function AudiO(){
clear
printf "%s\n" "" "Enter the youtube video link: " ""
read link
clear
youtube-dl --continue --extract-audio --audio-format "mp3" --audio-quality 0 --output "/home/$USER/Downloads/%(title)s.%(ext)s" "$link"
echo ""
read -rsp $'Press any key to return to PMYTD MENU...\n' -n1 key
echo ""
clear
MenU
}

function FormaT(){
clear
printf "%s\n" "" "Enter the youtube video link: " ""
read link
clear
youtube-dl --list-formats "$link" || DiE
printf "%s\n" "" "Enter your desired video format code from the above list:" ""
read list
clear
youtube-dl --continue --format "$list" --output "/home/$USER/Downloads/%(title)s.%(ext)s" "$link"
echo ""
read -rsp $'Press any key to return to PMYTD MENU...\n' -n1 key
echo ""
clear
MenU
}

function DependencieS(){
clear
printf "%s\n" "" "PMYTD needs to have following applications installed in order to function," "" "1. youtube-dl" "A small command-line program to download videos from youtube and other" "video sharing sites. It is available in repos of some distros but it" "would most likely be severly outdated. Here is the right way to install it," "Open terminal and run following commands," "'sudo wget https://yt-dl.org/downloads/latest/youtube-dl -O " "/usr/local/bin/youtube-dl'" "'sudo chmod a+x /usr/local/bin/youtube-dl'" "" "youtube-dl homepage -> https://rg3.github.io/youtube-dl/" "" "2. Python" "Python should most likely be installed by default on your system." "If not install it via your distro's package manager." "" "Python homepage -> http://python.org" "" "3. FFmpeg" "Again ffmpeg should already be installed by default on most distros." "If not install it via your distro's package manager." "In some distros it is called avconv. ffprobe or avprobe are also required." "" "FFmpeg homepage -> https://www.ffmpeg.org/" "" "4. cURL" "curl is an open source command line tool and library for transferring data" "with URL syntax, supporting DICT, FILE, FTP, FTPS, Gopher, HTTP, HTTPS, IMAP," "IMAPS, LDAP, LDAPS, POP3, POP3S, RTMP, RTSP, SCP, SFTP, SMB, SMTP, SMTPS," "Telnet and TFTP." "You can easily install it using your package manager." "" "cURL homepage -> http://curl.haxx.se/" "" "5. Ping" "ping uses the ICMP protocol's mandatory ECHO_REQUEST datagram to elicit an" "ICMP ECHO_RESPONSE from a host or gateway." "ping is part of iputils package. Install iputils via your package manager." "" "iputils homepage -> http://www.skbuff.net/iputils/" "" "6. Downloads directory" "PMYTD is hard-wired to download video and audio to the Downloads directory" "under user's home directory." "Downloads directory should already be there by default but just in case make" "sure you have Downloads directory under your home folder." "" "Press 'q' to return to PMYTD MENU" "" | less
}

function AbouT(){
clear
printf "%s\n" "" "PMYTD is a simple script that can," "" "1. Download videos from youtube and other video sharing
websites." "2. Download and extract audio [mp3] from videos on youtube" "and other video sharing websites." "3. Download entire youtube playlists (video and audio)." "" "" "PMYTD is just a helper script for Ricardo Garcia's wonderful" "youtube-dl." "You can view the list of all supported video sharing websites here," "http://rg3.github.io/youtube-dl/supportedsites.html" "" "By the way PMYTD means Poor Man's YouTube Downloader. PMYTD is" "available under CC0 1.0 Universal licesense." "Got any question-suggestion? Please visit," "http://hakerdefo.blogspot.in/" "" "Press 'q' to return to PMYTD MENU" "" | less
}

function MenU(){
clear
echo ""
echo -e "PMYTD MENU"
echo ""
echo -e "01 About PMYTD"
echo -e "02 Dependencies of PMYTD"
echo -e "03 Download a video"
echo -e "04 Download & extract audio from video"
echo -e "05 Download entire youtube playlist"
echo -e "06 Download & extract audio from playlist"
echo -e "07 Check for updates"
echo -e "08 Help"
echo -e "09 Quit PMYTD"
echo ""
echo -e "Enter your choice: "
echo ""
read choice
case $choice in

01 | 1)
AbouT
;;

02 | 2)
DependencieS
;;

03 | 3)
FormaT
;;

04 | 4)
AudiO
;;

05 | 5)
VplS
;;

06 | 6)
AplS
;;

07 | 7)
UpdatE
;;

08 | 8)
HelP
;;

09 | 9)
ByE
;;

*)
clear
echo ""
echo -e "$choice is an invalid option!"
echo ""
sleep 4
;;

esac
}

while :
do

MenU

done



Cheers!!!



(23 August 2015) UPDATE ENDS:






(09 August 2015) UPDATE BEGINS:
A few cosmetic changes and one important change. Updated Dependencies information.
Here is the latest version,


#!/bin/bash

function ByE (){
clear
echo ""
echo -e '\E[1;31;40m'"It's "'\E[1;32;40m'"funny "'\E[1;33;40m'" how"'\E[1;35;40m'" the"'\E[1;36;40m'" colors"'\E[1;31;40m'" of"'\E[1;32;40m'" the"'\E[1;33;40m'" real"'\E[1;35;40m'" world"'\E[1;36;40m'" only"'\E[1;31;40m'" seem"'\E[1;32;40m'" really"'\E[1;33;40m'" real"
echo -e '\E[1;36;40m'"when "'\E[1;31;40m'"you "'\E[1;32;40m'"viddy "'\E[1;33;40m'"them "'\E[1;35;40m'"on "'\E[1;36;40m'"the "'\E[1;31;40m'"screen."
echo ""
echo -e '\e[0m'"Alex, A Clockwork Orange"
echo ""
sleep 4
clear
exit 0
}

function HelP (){
clear
printf "%s\n" "" "Having problems running PMYTD?" "" "First make sure you have all the required dependencies installed." "You can read more about it in 'Dependencies of PMYTD' option" "in PMYTD MENU." "" "Having problems downloading videos?" "" "Youtube and other video sharing sites continually change their APIs." "So it is advised to keep youtube-dl updated to latest version." "You can check for youtube-dl updates via 'Check for updates' option" "in PMYTD MENU." "If there is a newer version available then please update youtube-dl." "" "For any other queries you can contact me at," "http://hakerdefo.blogspot.com" "" "Press 'q' to return to PMYTD MENU" "" | less
}

function UpdatE (){
clear
ping -q -c 2 yt-dl.org >/dev/null 2>&1 || { clear; echo -e "Can't connect to youtube-dl server! Please try later!" >&2; read -rsp $'Press any key to return to PMYTD MENU...\n' -n1 key; MenU; }
ytdllv=$(curl -sL -w "%{url_effective}\\n" "https://yt-dl.org/downloads/latest/" -o /dev/null | tail -c-12 | sed 's/[/]//g')
ytdlcv=$(youtube-dl --version)
if [ "$ytdllv" == "$ytdlcv" ]; then
echo ""
echo -e "Installed version of youtube-dl - $ytdlcv"
echo -e "Available version of youtube-dl - $ytdllv"
echo ""
echo -e "youtube-dl is up-to-date."
echo ""
read -rsp $'Press any key to return to PMYTD MENU...\n' -n1 key
echo ""
clear
MenU
else
echo ""
echo -e "Installed version of youtube-dl - $ytdlcv"
echo -e "Available version of youtube-dl - $ytdllv"
echo ""
echo -e "youtube-dl update is available."
echo ""
echo -e "Would you like to update youtube-dl?"
echo ""
echo -e "01 Update youtube-dl"
echo -e "02 Return to PMYTD MENU"
echo ""
echo -e "Enter your choice: "
echo ""
read choice
case $choice in
1 | 01)
clear
ytdll=$(which youtube-dl)
if [ -w "$ytdll" ]; then
youtube-dl -U
echo ""
read -rsp $'Press any key to return to PMYTD MENU...\n' -n1 key
echo ""
clear
MenU
else
resu=$(whoami)
resu_test=$(sudo -u "$resu" -n true >/dev/null 2>&1)
if [[ -z "$resu_test" ]]; then
echo ""
echo -e "Please enter root password"
echo ""
su -c 'youtube-dl -U'
echo ""
read -rsp $'Press any key to return to PMYTD MENU...\n' -n1 key
echo ""
clear
MenU
else
echo ""
echo "Please enter password for user $resu"
echo ""
sudo youtube-dl -U
echo ""
read -rsp $'Press any key to return to PMYTD MENU...\n' -n1 key
echo ""
clear
MenU
fi
fi
;;
2 | 02)
clear
MenU
;;
*)
clear
echo ""
echo -e "$choice is an invalid option!"
echo ""
sleep 4
UpdatE
;;
esac
fi
}

function DiE(){
clear
echo ""
echo -e "OOPS!!! Something Went Wrong!!!"
echo -e "Please make sure '$link' exists."
echo -e "Also make sure video is available."
echo ""
exit 1
}

function AplS(){
clear
printf "%s\n" "" "Enter the youtube playlist link: " ""
read link
clear
youtube-dl --continue --yes-playlist --ignore-errors --extract-audio --audio-format "mp3" --audio-quality 0 --output "/home/$USER/Downloads/%(title)s.%(ext)s" "$link"
echo ""
read -rsp $'Press any key to return to PMYTD MENU...\n' -n1 key
echo ""
clear
MenU
}

function VplS(){
clear
printf "%s\n" "" "Enter the youtube playlist link: " ""
read link
clear
youtube-dl --continue --yes-playlist --ignore-errors --output "/home/$USER/Downloads/%(title)s.%(ext)s" "$link"
echo ""
read -rsp $'Press any key to return to PMYTD MENU...\n' -n1 key
echo ""
clear
MenU
}

function AudiO(){
clear
printf "%s\n" "" "Enter the youtube video link: " ""
read link
clear
youtube-dl --continue --extract-audio --audio-format "mp3" --audio-quality 0 --output "/home/$USER/Downloads/%(title)s.%(ext)s" "$link"
echo ""
read -rsp $'Press any key to return to PMYTD MENU...\n' -n1 key
echo ""
clear
MenU
}

function FormaT(){
clear
printf "%s\n" "" "Enter the youtube video link: " ""
read link
clear
youtube-dl --list-formats "$link" || DiE
printf "%s\n" "" "Enter your desired video format code from the above list:" ""
read list
clear
youtube-dl --continue --format "$list" --output "/home/$USER/Downloads/%(title)s.%(ext)s" "$link"
echo ""
read -rsp $'Press any key to return to PMYTD MENU...\n' -n1 key
echo ""
clear
MenU
}

function DependencieS(){
clear
printf "%s\n" "" "PMYTD needs to have following applications installed in order to function," "" "1. youtube-dl" "A small command-line program to download videos from youtube and other" "video sharing sites. It is available in repos of some distros but it" "would most likely be severly outdated. Here is the right way to install it," "Open terminal and run following commands," "'sudo wget https://yt-dl.org/downloads/latest/youtube-dl -O " "/usr/local/bin/youtube-dl'" "'sudo chmod a+x /usr/local/bin/youtube-dl'" "" "youtube-dl homepage -> https://rg3.github.io/youtube-dl/" "" "2. Python" "Python should most likely be installed by default on your system." "If not install it via your distro's package manager." "" "Python homepage -> http://python.org" "" "3. FFmpeg" "Again ffmpeg should already be installed by default on most distros." "If not install it via your distro's package manager." "In some distros it is called avconv. ffprobe or avprobe are also required." "" "FFmpeg homepage -> https://www.ffmpeg.org/" "" "4. cURL" "curl is an open source command line tool and library for transferring data" "with URL syntax, supporting DICT, FILE, FTP, FTPS, Gopher, HTTP, HTTPS, IMAP," "IMAPS, LDAP, LDAPS, POP3, POP3S, RTMP, RTSP, SCP, SFTP, SMB, SMTP, SMTPS," "Telnet and TFTP." "You can easily install it using your package manager." "" "cURL homepage -> http://curl.haxx.se/" "" "5. Ping" "ping uses the ICMP protocol's mandatory ECHO_REQUEST datagram to elicit an" "ICMP ECHO_RESPONSE from a host or gateway." "ping is part of iputils package. Install iputils via your package manager." "" "iputils homepage -> http://www.skbuff.net/iputils/" "" "6. Downloads directory" "PMYTD is hard-wired to download video and audio to the Downloads directory" "under user's home directory." "Downloads directory should already be there by default but just in case make" "sure you have Downloads directory under your home folder." "" "Press 'q' to return to PMYTD MENU" "" | less
}

function AbouT(){
clear
printf "%s\n" "" "PMYTD is a simple script that can," "" "1. Download videos from youtube and other video sharing
websites." "2. Download and extract audio [mp3] from videos on youtube" "and other video sharing websites." "3. Download entire youtube playlists (video and audio)." "" "" "PMYTD is just a helper script for Ricardo Garcia's wonderful" "youtube-dl." "You can view the list of all supported video sharing websites here," "http://rg3.github.io/youtube-dl/supportedsites.html" "" "By the way PMYTD means Poor Man's YouTube Downloader. PMYTD is" "available under CC0 1.0 Universal licesense." "Got any question-suggestion? Please visit," "http://hakerdefo.blogspot.in/" "" "Press 'q' to return to PMYTD MENU" "" | less
}

function MenU(){
clear
echo ""
echo -e "PMYTD MENU"
echo ""
echo -e "01 About PMYTD"
echo -e "02 Dependencies of PMYTD"
echo -e "03 Download a video"
echo -e "04 Download & extract audio from video"
echo -e "05 Download entire youtube playlist"
echo -e "06 Download & extract audio from playlist"
echo -e "07 Check for updates"
echo -e "08 Help"
echo -e "09 Quit PMYTD"
echo ""
echo -e "Enter your choice: "
echo ""
read choice
case $choice in

01 | 1)
AbouT
;;

02 | 2)
DependencieS
;;

03 | 3)
FormaT
;;

04 | 4)
AudiO
;;

05 | 5)
VplS
;;

06 | 6)
AplS
;;

07 | 7)
UpdatE
;;

08 | 8)
HelP
;;

09 | 9)
ByE
;;

*)
clear
echo ""
echo -e "$choice is an invalid option!"
echo ""
sleep 4
;;

esac
}

while :
do

MenU

done



Cheers!!!


(09 August 2015) UPDATE ENDS:






(07 August 2015) UPDATE BEGINS:
Another update to 'Poor Man's Youtube Downloader'
So what's new?
'Check for updates' option is vastly improved. It now comapres the installed version of youtube-dl with available version and if an update is available gives user option to update youtube-dl.
The script will also check whether the user has the permission to update youtube-dl or not. If the user doesn't have the permission then the script will check whether the user has access to sudo or not. If the user have access to sudo then the script will use sudo to update youtube-dl else the script will use 'su'. This doesn't directly affect VSIDO but I wanted to make ''Poor Man's Youtube Downloader'' work on any distribution.
This update also make the script handle the errors related to connection and video availability in more efficient way.
View-Reviews-Comments are welcome!
Here is the updated script,


#!/bin/bash

function ByE (){
clear
echo ""
echo -e '\E[1;31;40m'"It's "'\E[1;32;40m'"funny "'\E[1;33;40m'" how"'\E[1;35;40m'" the"'\E[1;36;40m'" colors"'\E[1;31;40m'" of"'\E[1;32;40m'" the"'\E[1;33;40m'" real"'\E[1;35;40m'" world"'\E[1;36;40m'" only"'\E[1;31;40m'" seem"'\E[1;32;40m'" really"'\E[1;33;40m'" real"
echo -e '\E[1;36;40m'"when "'\E[1;31;40m'"you "'\E[1;32;40m'"viddy "'\E[1;33;40m'"them "'\E[1;35;40m'"on "'\E[1;36;40m'"the "'\E[1;31;40m'"screen."
echo ""
echo -e '\e[0m'"Alex, A Clockwork Orange"
echo ""
sleep 4
clear
exit 0
}

function HelP (){
clear
printf "%s\n" "" "Having problems running PMYTD?" "" "First make sure you have all the required dependencies installed." "You can read more about it in 'Dependencies of PMYTD' option" "in PMYTD MENU." "" "Having problems downloading videos?" "" "Youtube and other video sharing sites continually change their APIs." "So it is advised to keep youtube-dl updated to latest version." "You can check for youtube-dl updates via 'Check for updates' option" "in PMYTD MENU." "If there is a newer version available then please update youtube-dl." "" "For any other queries you can contact me at," "http://hakerdefo.blogspot.com" "" "Press 'q' to return to PMYTD MENU" "" | less
}

function UpdatE (){
clear
ytdllv=$(curl -sL -w "%{url_effective}\\n" "https://yt-dl.org/downloads/latest/" -o /dev/null | tail -c-12 | sed 's/[/]//g')
ytdlcv=$(youtube-dl --version)
if [ "$ytdllv" == "$ytdlcv" ]; then
echo ""
echo -e "Installed version of youtube-dl - $ytdlcv"
echo -e "Available version of youtube-dl - $ytdllv"
echo ""
echo -e "youtube-dl is up-to-date."
echo ""
read -rsp $'Press any key to return to PMYTD MENU...\n' -n1 key
echo ""
clear
MenU
else
echo ""
echo -e "Installed version of youtube-dl - $ytdlcv"
echo -e "Available version of youtube-dl - $ytdllv"
echo ""
echo -e "youtube-dl update is available."
echo ""
echo -e "Would you like to update youtube-dl?"
echo ""
echo -e "01 Update youtube-dl"
echo -e "02 Return to PMYTD MENU"
echo ""
echo -e "Enter your choice: "
echo ""
read choice
case $choice in
1 | 01)
clear
ytdll=$(which youtube-dl)
if [ -w "$ytdll" ]; then
youtube-dl -U
echo ""
read -rsp $'Press any key to return to PMYTD MENU...\n' -n1 key
echo ""
clear
MenU
else
resu=$(whoami)
resu_test=$(sudo -u "$resu" -n true >/dev/null 2>&1)
if [[ -z "$resu_test" ]]; then
echo ""
echo -e "Please enter root password"
echo ""
su -c 'youtube-dl -U'
echo ""
read -rsp $'Press any key to return to PMYTD MENU...\n' -n1 key
echo ""
clear
MenU
else
echo ""
echo "Please enter password for user $resu"
echo ""
sudo youtube-dl -U
echo ""
read -rsp $'Press any key to return to PMYTD MENU...\n' -n1 key
echo ""
clear
MenU
fi
fi
;;

2 | 02)
clear
MenU
;;

*)
clear
echo ""
echo -e "$choice is an invalid option!"
echo ""
sleep 4
UpdatE
;;
esac
fi
}

function DiE(){
clear
echo ""
echo -e "OOPS!!! Something Went Wrong!!!"
echo -e "Please make sure '$link' exists."
echo -e "Also make sure video is available."
echo ""
exit 1
}

function AplS(){
clear
printf "%s\n" "" "Enter the youtube playlist link: " ""
read link
clear
youtube-dl --continue --yes-playlist --ignore-errors --extract-audio --audio-format "mp3" --audio-quality 0 --output "/home/$USER/Downloads/%(title)s.%(ext)s" "$link"
echo ""
read -rsp $'Press any key to return to PMYTD MENU...\n' -n1 key
echo ""
clear
MenU
}

function VplS(){
clear
printf "%s\n" "" "Enter the youtube playlist link: " ""
read link
clear
youtube-dl --continue --yes-playlist --ignore-errors --output "/home/$USER/Downloads/%(title)s.%(ext)s" "$link"
echo ""
read -rsp $'Press any key to return to PMYTD MENU...\n' -n1 key
echo ""
clear
MenU
}

function AudiO(){
clear
printf "%s\n" "" "Enter the youtube video link: " ""
read link
clear
youtube-dl --continue --extract-audio --audio-format "mp3" --audio-quality 0 --output "/home/$USER/Downloads/%(title)s.%(ext)s" "$link"
echo ""
read -rsp $'Press any key to return to PMYTD MENU...\n' -n1 key
echo ""
clear
MenU
}

function FormaT(){
clear
printf "%s\n" "" "Enter the youtube video link: " ""
read link
clear
youtube-dl --list-formats "$link" || DiE
printf "%s\n" "" "Enter your desired video format code from the above list:" ""
read list
clear
youtube-dl --continue --newline --format "$list" --output "/home/$USER/Downloads/%(title)s.%(ext)s" "$link"
echo ""
read -rsp $'Press any key to return to PMYTD MENU...\n' -n1 key
echo ""
clear
MenU
}

function DependencieS(){
clear
printf "%s\n" "" "PMYTD needs to have following applications installed in order to function," "" "1. youtube-dl" "A small command-line program to download videos from youtube and other" "video sharing sites. It is available in repos of some distros but it" "would most likely be severly outdated. Here is the right way to install it," "Open terminal and run following commands," "'sudo wget https://yt-dl.org/downloads/latest/youtube-dl -O " "/usr/local/bin/youtube-dl'" "'sudo chmod a+x /usr/local/bin/youtube-dl'" "" "youtube-dl homepage -> https://rg3.github.io/youtube-dl/" "" "2. Python" "Python should most likely be installed by default on your system." "If not install it via your distro's package manager." "" "Python homepage -> http://python.org" "" "3. FFmpeg" "Again ffmpeg should already be installed by default on most distros." "If not install it via your distro's package manager." "In some distros it is called avconv. ffprobe or avprobe are also required." "" "FFmpeg homepage -> https://www.ffmpeg.org/" "" "4. Downloads directory" "PMYTD is hard-wired to download video and audio to the Downloads directory" "under user's home directory." "Downloads directory should already be there by default but just in case make" "sure you have Downloads directory under your home folder." "" "Press 'q' to return to PMYTD MENU" "" | less
}

function AbouT(){
clear
printf "%s\n" "" "PMYTD is a simple script that can," "" "1. Download videos from youtube and other video sharing
websites." "2. Download and extract audio [mp3] from videos on youtube" "and other video sharing websites." "3. Download entire youtube playlists (video and audio)." "" "" "PMYTD is just a helper script for Ricardo Garcia's wonderful" "youtube-dl." "You can view the list of all supported video sharing websites here," "http://rg3.github.io/youtube-dl/supportedsites.html" "" "By the way PMYTD means Poor Man's YouTube Downloader. PMYTD is" "available under CC0 1.0 Universal licesense." "Got any question-suggestion? Please visit," "http://hakerdefo.blogspot.in/" "" "Press 'q' to return to PMYTD MENU" "" | less
}

function MenU(){
clear
echo ""
echo -e "PMYTD MENU"
echo ""
echo -e "01 About PMYTD"
echo -e "02 Dependencies of PMYTD"
echo -e "03 Download a video"
echo -e "04 Download & extract audio from video"
echo -e "05 Download entire youtube playlist"
echo -e "06 Download & extract audio from playlist"
echo -e "07 Check for updates"
echo -e "08 Help"
echo -e "09 Quit PMYTD"
echo ""
echo -e "Enter your choice: "
echo ""
read choice
case $choice in

01 | 1)
AbouT
;;

02 | 2)
DependencieS
;;

03 | 3)
FormaT
;;

04 | 4)
AudiO
;;

05 | 5)
VplS
;;

06 | 6)
AplS
;;

07 | 7)
UpdatE
;;

08 | 8)
HelP
;;

09 | 9)
ByE
;;

*)
clear
echo ""
echo -e "$choice is an invalid option!"
echo ""
sleep 4
;;

esac
}

while :
do

MenU

done



Cheers!!!


(07 August 2015) UPDATE ENDS:







(08 July 2015) EDIT BEGINS:

I've improved 'Check for updates' option. And there are numerous other cosmetic changes. Here is the latest version of pmytd,


#!/bin/bash

function Bye (){
clear
printf "%s\n" "" "Thanks.. Bye Bye.." ""
sleep 2
clear
exit 0
}

function Update (){
ytdllv=$(curl -sL -w "%{url_effective}\\n" "https://yt-dl.org/downloads/latest/" -o /dev/null | tail -c-12 | sed 's/[/]//g')
ytdlcv=$(youtube-dl --version)
printf "%s\n" "" "Installed version of youtube-dl is - $ytdlcv" "" "Latest available version of youtube-dl is - $ytdllv" "" "Press 'q' to return to PMYTD MENU" "" | less
}

function Apls(){
clear
printf "%s\n" "" "Enter the youtube playlist link: " ""
read link
clear
youtube-dl --continue --yes-playlist --ignore-errors --extract-audio --audio-format "mp3" --audio-quality 0 --output "/home/$USER/Downloads/%(title)s.%(ext)s" "$link"
exit 0
}

function Vpls(){
clear
printf "%s\n" "" "Enter the youtube playlist link: " ""
read link
clear
youtube-dl --continue --yes-playlist --ignore-errors --output "/home/$USER/Downloads/%(title)s.%(ext)s" "$link"
exit 0
}

function Audio(){
clear
printf "%s\n" "" "Enter the youtube video link: " ""
read link
clear
youtube-dl --continue --extract-audio --audio-format "mp3" --audio-quality 0 --output "/home/$USER/Downloads/%(title)s.%(ext)s" "$link"
exit 0
}

function Format(){
clear
printf "%s\n" "" "Enter the youtube video link: " ""
read link
clear
youtube-dl --list-formats "$link"
printf "%s\n" "" "Enter your desired video format code from the above list:" ""
read list
clear
youtube-dl --continue --format "$list" --output "/home/$USER/Downloads/%(title)s.%(ext)s" "$link"
exit 0
}

function Dependencies(){
printf "%s\n" "PMYTD needs to have following applications installed in order to function," "" "1. youtube-dl" "A small command-line program to download videos from youtube and other" "video sharing sites. It is available in repos of some distros but it" "would most likely be severly outdated. Here is the right way to install it," "Open terminal and run following commands," "'sudo wget https://yt-dl.org/downloads/latest/youtube-dl -O " "/usr/local/bin/youtube-dl'" "'sudo chmod a+x /usr/local/bin/youtube-dl'" "" "youtube-dl homepage -> https://rg3.github.io/youtube-dl/" "" "2. Python" "Python should most likely be installed by default on your system." "If not install it via your distro's package manager." "" "Python homepage -> http://python.org" "" "3. FFmpeg" "Again ffmpeg should already be installed by default on most distros." "If not install it via your distro's package manager." "In some distros it is called avconv. ffprobe or avprobe are also required." "" "FFmpeg homepage -> https://www.ffmpeg.org/" "" "4. Downloads directory" "PMYTD is hard-wired to download video and audio to the Downloads directory" "under user's home directory." "Downloads directory should already be there by default but just in case make" "sure you have Downloads directory under your home folder." "" "Press 'q' to return to PMYTD MENU" "" | less
}

function About(){
printf "%s\n" "PMYTD is a simple script that can," "" "1. Download videos from youtube and other video sharing
websites." "2. Download and extract audio [mp3] from videos on youtube" "and other video sharing websites." "3. Download entire youtube playlists (video and audio)." "" "" "PMYTD is just a helper script for Ricardo Garcia's wonderful" "youtube-dl." "You can view the list of all supported video sharing websites here," "http://rg3.github.io/youtube-dl/supportedsites.html" "" "Youtube and other video sharing sites continually change their APIs." "So it is advised to keep youtube-dl updated to latest version." "You can check for youtube-dl updates via 'Check for updates' option" "in PMYTD MENU." "If there is a newer version available then you can update youtube-dl" "by running following command in terminal," "'sudo youtube-dl -U'" "" "By the way PMYTD means Poor Man's YouTube Downloader. PMYTD is" "available under CC0 1.0 Universal licesense." "Got any question-suggestion? Please visit," "http://hakerdefo.blogspot.in/" "" "Press 'q' to return to PMYTD MENU" "" | less
}

while :
do
clear
cat << !
PMYTD MENU

1. About PMYTD
2. Dependencies of PMYTD
3. Download a video
4. Download & extract audio from video
5. Download entire youtube playlist
6. Download & extract audio from playlist
7. Check for updates
8. Quit PMYTD

!
echo -n "Enter your choice: "
read choice
case $choice in
1) About ;;
2) Dependencies ;;
3) Format ;;
4) Audio ;;
5) Vpls ;;
6) Apls ;;
7) Update ;;
8) Bye ;;
*) clear; printf "%s\n" "\"$choice\" is an invalid option!"; sleep 3;;
esac
done



(08 July 2015) EDIT ENDS:



It's been a while since I visited the forum! Reason? I'm without any proper Internet connection lately! Anyways I came across this topic by VastOne,
CHALLENGE Muz/gyts script fix/alternatives Yad script
Now I'm not a Bash scripting guru so you are free to improve-modify this script. Just save this script somewhere in your path with the name 'pmytd' and 'chmod 755' it. Run 'pmytd' from your terminal whenever you feel like scraping youtube  :)


#!/bin/bash

function Bye (){
printf "%s\n" "" "Thanks.. Bye Bye.." ""
sleep 3
clear
exit 0
}

function Update (){
youtube-dl --simulate -U | less
}

function Apls(){
printf "%s\n" "" "Enter the youtube playlist link" ""
read link
youtube-dl --continue --yes-playlist --ignore-errors --extract-audio --audio-format "mp3" --audio-quality 0 --output "/home/$USER/Downloads/%(title)s.%(ext)s" "$link"
exit 0
}

function Vpls(){
printf "%s\n" "" "Enter the youtube playlist link" ""
read link
youtube-dl --continue --yes-playlist --ignore-errors --output "/home/$USER/Downloads/%(title)s.%(ext)s" "$link"
exit 0
}

function Audio(){
printf "%s\n" "" "Enter the youtube video link" ""
read link
youtube-dl --continue --extract-audio --audio-format "mp3" --audio-quality 0 --output "/home/$USER/Downloads/%(title)s.%(ext)s" "$link"
exit 0
}

function Format(){
printf "%s\n" "" "Enter the youtube video link" ""
read link
youtube-dl --list-formats "$link"
printf "%s\n" "" "Enter your desired video format code from the above list" ""
read list
youtube-dl --continue --format "$list" --output "/home/$USER/Downloads/%(title)s.%(ext)s" "$link"
exit 0
}

function Dependencies(){
printf "%s\n" "PMYTD needs to have following applications installed in order to function," "" "1. youtube-dl" "A small command-line program to download videos from youtube and other video sharing sites. It is available in repos of some distros but chances are that it is severly outdated. Here is the right way to install it," "Open terminal and run following commands," "'sudo wget https://yt-dl.org/downloads/latest/youtube-dl -O /usr/local/bin/youtube-dl'" "'sudo chmod a+x /usr/local/bin/youtube-dl'" "" "Youtube and other video sharing sites continually change their APIs." "So it is advised to keep youtube-dl updated to latest version." "You can check for youtube-dl updates via 'Check for update' option in PMYTD MENU." "If there is a newer version available then you can update youtube-dl by running following command in terminal," "'sudo youtube-dl -U'" "http://rg3.github.io/youtube-dl/" "" "2. Python" "Python should most likely be installed by default on your system. If not install it via your distro's package manager." "http://python.org" "" "3. FFmpeg" "Again ffmpeg should already be installed by default on most distros. If not install it via your distro's package manager." "In some distros it is called avconv. ffprobe or avprobe are also required." "https://www.ffmpeg.org/" "" "4. Downloads directory" "PMYTD is hard-wired to download video and audio to the Downloads directory under user's home directory." "Downloads directory should already be there by default but just in case make sure you have Downloads directory under your home folder." "" "Press 'q' to return to PMYTD MENU" | less
}

function About(){
printf "%s\n" "PMYTD is a simple script that can," "" "1. Download videos from youtube and other video sharing
websites." "" "2. Download and extract audio [mp3] from videos on youtube and other video sharing websites." "" "3. Download entire youtube playlists (video and audio)." "" "PMYTD is just a helper script for Ricardo Garcia's wonderful youtube-dl." "You can view the list of all supported websites here," "http://rg3.github.io/youtube-dl/supportedsites.html" "" "By the way PMYTD means Poor Man's YouTube Downloader. PMYTD is available under WTFPL licesense." "Got any question-suggestion? Please visit," "http://hakerdefo.blogspot.in/" "" "Press 'q' to return to PMYTD MENU" | less
}

while :
do
clear
cat << !
PMYTD MENU

1. About PMYTD
2. Dependencies of PMYTD
3. Download a video
4. Download & extract audio from video
5. Download entire youtube playlist
6. Download & extract audio from playlist
7. Check for update
8. Quit PMYTD

!
echo -n "Enter your choice "
read choice
case $choice in
1) About ;;
2) Dependencies ;;
3) Format ;;
4) Audio ;;
5) Vpls ;;
6) Apls ;;
7) Update ;;
8) Bye ;;
*) echo "\"$choice\" is invalid"; sleep 3;;
esac
done



Cheers!!!
#38
I've Got a Life / Trouble with upgrades
December 07, 2014, 09:04:04 AM
I stumbled across this gem and felt that I had to share this,
Quote
Last year a friend of mine upgraded GirlFriend 1.0 to Wife 1.0 and found that it's a memory hog leaving very little system resources for other applications. He is only now noticing that Wife 1.0 also is spawning Child-Processes which are further consuming valuable resources. No mention of this particular phenomena was included in the product brochure or the documentation, though other users have informed him that this is to be expected due to the nature of the application.

Not only that, Wife 1.0 installs itself such that it is always launched at system initialization where it can monitor all other system activity. He's finding that some applications such as PokerNight 10.3, BeerBash 2.5, and PubNight 7.0 are no longer able to run in the system at all, crashing the system when selected (even though they always worked fine before). At installation, Wife 1.0 provides no option as to the installation of undesired Plug-Ins such as MotherInLaw 55.8 and BrotherInLaw Beta release. Also, system performance seems to diminish with each passing day.

Some features he'd like to see in the upcoming wife 2.0.

    A "Don't remind me again" button
    Minimize button
    An install shield feature that allows Wife 2.0 be installed with the option to uninstall at anytime without the loss of cache and other system resources.
    An option to run the network driver in promiscuous mode which would allow the systems hardware probe feature to be much more useful.

I myself decided to avoid all of the headaches associated with Wife 1.0 by sticking with Girlfriend 2.0. Even here, however, I found many problems. Apparently you cannot install Girlfriend 2.0 on top of Girlfriend 1.0. You must uninstall Girlfriend 1.0 first. Other users say this is a long standing bug which I should have been aware of. Apparently the versions of Girlfriend have conflicts over shared use of the I/O port. You think they would have fixed such a stupid bug by now. To make matters worse, The uninstall program for Girlfriend 1.0 doesn't work very well leaving undesirable traces of the application in the system.

Another irritating feature -- all versions of Girlfriend continually popup little annoying messages about the advantages of upgrading to Wife 2.0.

***** BUG WARNING *****

Wife 1.0 has an undocumented bug. If you try to install Mistress 1.1 before uninstalling Wife 1.0, Wife 1.0 will delete MSMoney files before doing the uninstall itself. Then Mistress 1.1 will refuse to install, claiming insufficient resources.

***** BUG WORK-AROUNDS *****

To avoid the above bug, try installing Mistress 1.1 on a different system and never run any file transfer applications such as Laplink 6.0.

Also, beware of similar shareware applications that have been known to carry viruses that may affect Wife 1.0. Another solution would be to run Mistress 1.0 via a UseNet provider under an anonymous name. Here again, beware of the viruses which can accidentally be downloaded from the UseNet.

More funny stuff here if you liked this one,
http://www.mipmip.org/tidbits/techie.shtml

Cheers!!!
#39
I know there are gazillion examples out there on the net about this but almost all of them use 'if-then-else' to achieve this. Which in my view is not very efficient. The one I'm going to present here uses built-in arithmetic option of bash shell and there for is more efficient and Eco-friendly  ;)
If the last command you ran in the terminal failed this will turn '$' ['#' for root] in bash prompt (PS1) an angry red like this,


But if the command was successful $' ['#' for root] will remain peaceful white,


If you think this is cool then all you need to do is open '.bashrc' file in your favorite text-editor and just copy-paste the following at the end of the file,

export PS1='${debian_chroot:+($debian_chroot)}\[\e[01;32m\]\u \[\e[01;37m\]> \[\e[01;33m\]\w\n\[\e[$(((($?>0))*31))m\]\$\[\e[0m\] '

Save the file and run the following in your terminal to apply the changes,

source .bashrc

Cheers!!!
#40
This handy script makes it very easy to extract package management details like installation, update, removal, and rollback. Basic usage of script goes like this.
For getting information on packages installed,
apthistory install
For getting information on removed packages,
apthistory remove
To check package upgrades
apthistory upgrade
To list rolledback packages,
apthistory rollback
Ofcourse you can pipe the output and grep to your heart's content  8)
Here's the script,

#!/bin/bash

### Author:      Benjamin York
### Date:        2011-01-08
###
### Based On:
### http://linuxcommando.blogspot.com/2008/08/how-to-show-apt-log-history.html
###
### Hosted At:
### https://github.com/blyork/apt-history
###
### Git Repository:
### git://github.com/blyork/apt-history.git
###
### Description:
### Parses dpkg log files to get package installation, removal, and rollback
### information.
###
### Ubuntu Server likes to split up the dpkg.log file and then compress the
### various pieces. After seeing LinuxCommando's function, I added functionality
### to pull the pieces back together. I also slightly adjusted the output to
### avoid false positives.

function echoHistory(){
    if [[ $1 == *.gz ]] ; then
        gzip -cd $1
    else
        if [[ $1 == *.log || $1 == *.log.1 ]] ; then
            cat $1
        else
            echo "\*\*\* Invalid File: ${1} \*\*\*" 1>&2
        fi
    fi
}

FILES=( `ls -rt /var/log/dpkg.log*` ) || exit 1

for file in "${FILES[@]}"
do
    case "$1" in
        install)
            echoHistory $file | grep " install "
        ;;

        upgrade|remove)
            echoHistory $file | grep " ${1} "
        ;;
                 
        rollback)
            echoHistory $file | grep upgrade | \
                grep "$2" -A10000000 | \
                grep "$3" -B10000000 | \
                awk '{print $4"="$5}'
        ;;

        list)
            echoHistory $file
        ;;

        *)
            echo "Parameters:"
            echo "     install  - Lists all packages that have been installed."
            echo "     upgrade  - Lists all packages that have been upgraded."
            echo "     remove   - Lists all packages that have been removed."
            echo "     rollback - Lists rollback information."
            echo "     list     - Lists all contents of dpkg logs."
            break
        ;;
    esac
done

exit 0

Cheers!!!