Tag Archives: bash

Top 5 reasons in favor or against a programming language

Computer Binary Code

Top 5 reasons why JavaScript is so popular

  1. People have learned JavaScript at school or for their first private website, and want to continue using that skill for everything else to come.
  2. See #1
  3. See #1
  4. See #1
  5. See #1

Top 5 reasons why people hate C++

  1. They don't know C++.
  2. They are afraid of pointers.
  3. They are afraid of pointers.
  4. They are afraid of pointers.
  5. They are ▓ of memory leaks.▓▓▓▓▓▓▓▓▓▓

Top 5 reasons why big projects slowly move away from Java

  1. JVM needs too much memory.
  2. See #1
  3. See #1
  4. See #1
  5. See #1
  6. See #1
  7. See #1
  8. See #1
  9. See #1
  10. Runtime.getRuntime().gc();

Top 5 reasons why Python is so insanely popular

  1. Everyone else is using it.
  2. Nobody cares about multithreading. ("Hey, today's computers are fast anyway, right?")
  3. Kids today don't remember source code structuring by indentation used in early programming languages like Cobol, Fortran or AS400, so they think it's the new cool thing to create easy to read, structured source code. Here we go again ... ("At least it is different from old school Java, so it must be a step forward, right?")
  4. import #1, #2, #3
  5. import #1, #2, #3

Top 5 reasons why PHP still is so popular

  1. sudo -u root "People are afraid that CGI might return."
  2. action="1.cgi"
  3. action="1.cgi"
  4. action="1.cgi"
  5. action="1.cgi"

Top 5 reasons why people use Go

  1. It was created by Google. Maybe when I apply for a job at Google, they check out my GitHub projects.
  2. I <3 Google
  3. I <3 Google
  4. I <3 Google
  5. git push

Top 5 reasons why people are embarrassed to mention Bash

  1. echo "Shell scripting is not real programming." | tee 2. 3. 4. 5.

Top 5 reasons why CSS is considered a programming language

  1. Who cares?

Top 5 reasons why people don't even look at Perl anymore

5. programming style: two words
4. See #3
3. See #2
2. See #1
1. See #5

Share

Check for new versions of Firefox, Thunderbird

This little Bash script reads your locally installed Firefox and Thunderbird versions and compares them to the newest versions available for download.

#!/bin/bash 
 
function checkVersion() { 
        V1=$(echo $1 | tr -d [:alpha:])
        V2=$(echo $2 | tr -d [:alpha:])
        MAJ1=$(echo $V1 | cut -d. -f1) 
        MIN1=$(echo $V1 | cut -d. -f2) 
        REV1=$(echo $V1 | cut -d. -f3) 
 
        MAJ2=$(echo $V2 | cut -d. -f1) 
        MIN2=$(echo $V2 | cut -d. -f2) 
        REV2=$(echo $V2 | cut -d. -f3) 
 
        if [[ $MAJ1 -lt $MAJ2 ]] ; then 
                return 1; 
        fi 
 
        if [[ $MAJ1 -eq $MAJ2 ]] ; then 
                if [[ -n "$MIN2" ]] ; then 
                        if [[ -n "$MIN1" ]] ; then 
                                if [[ $MIN1 -lt $MIN2 ]] ; then 
                                        return 1; 
                                fi 
 
                                if [[ $MIN1 -eq $MIN2 ]] ; then 
                                        if [[ -n "$REV2" ]] ; then 
                                                if [[ -n "$REV1" ]] ; then 
                                                        if [[ $REV1 -lt $REV2 ]] ; then 
                                                                return 1; 
                                                        fi 
                                                else 
                                                        return 1; 
                                                fi 
                                        fi 
                                fi 
                        else 
                                return 1; 
                        fi 
                fi 
        fi 
 
        return 0; 
} 
 
# Check Thunderbird 
TB=$(curl -s https://ftp.mozilla.org/pub/thunderbird/releases/ | sed -n "s/^\s\+<td><a href=\".*\">\(.*\)\/<\/a><\/td>$/\1/gp" | sort -g | egrep -iv "b|esr" | tail -n 1 ) 
TBL=$(thunderbird -v | sed -n "s/^\s*Thunderbird\s*\(.*\)$/\1/gp") 
 
checkVersion $TBL $TB 
if [[ $? -eq 1 ]] ; then 
        echo "Update Thunderbird ($TBL -> $TB)" 
fi 
 
# Check Firefox 
TB=$(curl -s https://ftp.mozilla.org/pub/firefox/releases/ | sed -n "s/^\s\+<td><a href=\".*\">\(.*\)\/<\/a><\/td>$/\1/gp" | sort -g | egrep -iv "b|esr" | tail -n 1 ) 
TBL=$(firefox -v | sed -n "s/^.*Firefox\s*\(.*\)$/\1/gp") 
 
checkVersion $TBL $TB 
if [[ $? -eq 1 ]] ; then 
        echo "Update Firefox ($TBL -> $TB)" 
fi

Settings in about:config for built-in automatic update check in both Firefox and Thunderbird:

  • app.update.interval
  • app.update.url
Share