Track Coronavirus Disease 2019 (COVID-19) Statistics From Commandline

It is very difficult time for the entire World! The deadly Coronavirus (COVID-19) is spreading very fast across the Globe. All countries are taking various precautions including lock-down and curfew and trying their best to control this infectious disease. The World Health Organization (WHO) website provides many resources, current situation reports, travel advice, protective measures & awareness and answers for all questions related to the Coronavirus disease outbreak. Besides WHO, many NGOs, individuals and volunteers are doing their part by developing tools and apps to track the Novel Coronavirus statistics. This guide explains how to track Coronavirus disease 2019 (COVID-19) statistics from Commandline using Corona-cliCoronavirus-tracker-cli and COVID-19 Tracker CLI on Linux.

1. Corona-cli

Corona-cli is a command line application written in NodeJS. The corona-cli gets you the following details from commandline:

  • Worldwide Coronavirus disease (COVID-19) report,
  • Active daily report of your country’s COVID-19 statistics,
  • Track Coronavirus statistics of US states,
  • Displays the report by country-wise, cases, deaths, active, recovered, critical, no of cases per-million.

Install Corona-cli on Linux

Make sure you have installed Nodejs on your Linux system as described in the following guide.

After installing Nodejs, run the following command to install Corona-cli on your Linux system:

$ npm install -g corona-cli

Track Coronavirus Disease 2019 (COVID-19) Statistics From Commandline Using Corona-cli

When you run Corona-cli without any options, it displays the world-wide Coronavirus statistics in a neat tabular-column format as shown below.

$ corona

Sample output:

Coronavirus Disease 2019 (COVID-19) Statistics From Commandline

As you can see, each column in the above output contains the following details:

  • Country – Name of the country.
  • Cases – Total number of cases in a country.
  • Cases (today) – Cases in 24 hours GMT/UTC.
  • Deaths – Total number of deaths in a country.
  • Deaths (today) – Deaths in 24 hours GMT/UTC.
  • Recovered – Total number of recovered people.
  • Active – Total number of active patients.
  • Critical – Total number of critical patients.
  • Per Million – Affected patients per million.

It is possible to display Coronavirus statistics by country-wise. For instance, to display the Coronavirus statistics data for India, run:

$ corona India
Coronavirus statistics data for India

We can also sort Coronavirus statistics by various types as given below.

$ corona -s country
$ corona -s cases
$ corona -s cases-today
$ corona -s deaths
$ corona -s deaths-today
$ corona -s recovered
$ corona -s active
$ corona -s critical
$ corona -s per-million

If you’re live in United States, you can display the Coronavirus data by states-wise.

$ corona states
Coronavirus data by states-wise in US

To display states data sorted by active cases, run:

$ corona states --sort active

To display states data sorted by Cases today:

$ corona states -s cases-today

To get help, run:

$ corona --help
  Track the Coronavirus disease (COVID-19).

  Usage
    corona <command> [--option]

  Commands
    country-name         Get data for a given country
    states               Get data for all USA states

  Options
    --xcolor, -x         Single colored output
    --sort, -s           Sort data by type

  Examples
    corona china
    corona states
    corona -x
    corona --sort cases-today
    corona -s critical

  ❯ You can also run command + option at once:
    corona china -x -s cases

For more details, refer the project’s GitHub page given at the end.

2. Coronavirus-tracker-cli

Coronavirus-tracker-cli tracks the Coronavirus (COVID-19) statistics from command line using curl program. It gets the Coronavirus data from the following two sources:

By default, it uses Worldometers API if the source is not explicitly mentioned.

Track Coronavirus Disease 2019 (COVID-19) Statistics From Commandline Using Coronavirus-tracker-cli

Unlike the previous tool, coronavirus-tracker-cli requires no installation! All you have to do is to use curl command which comes pre-installed with many Linux distributions.

To track the Coronavirus stats globally, simply run:

$ curl https://corona-stats.online

Sample output:

Track Coronavirus Disease 2019 (COVID-19) Statistics From Commandline Using Coronavirus-tracker-cli

As I mentioned already, if no source mentioned, It gets the Cornavirus data from Wordometer API by default.

You can also specify source explicitly like below:

$ curl https://corona-stats.online?source=1
$ curl https://corona-stats.online?source=2

Filter Cornavirus stats by country-wise:

To display COVID-19 data for a specific country, mention the country name like below.

$ curl https://corona-stats.online/India 
$ curl https://corona-stats.online/Spain

Filter Cornavirus stats by country-wise from specific source:

$ curl https://corona-stats.online/uk?source=1
$ curl https://corona-stats.online/gb?source=2

Display top affected countries

To display top ten affected countries by COVID-19, run:

$ curl https://corona-stats.online?top=10
Track Top ten affected countries by COVID-19 Using Coronavirus-tracker-cli

Besides using Curl command, it is possible to install it using npm package manager.

Please note that coronavirus-tracker-cli will conflict with the corona-cli tool. Because both uses the same executable name i.e. corona. So it is recommended to remove the previous one if it is already installed and then install coronavirus-tracker-cli.

$ npm uninstall -g corona-cli

Make sure you have installed NodeJS. After installing Nodejs, run the folllowing command to install Coronavirus-tracker-cli:

$ npm install coronavirus-tracker-cli -g

Now track the Coronavirus stats globally using command:

$ corona

Get Coronavirus data from specific source:

$ corona --source=1

Or,

corona -s=1

Get Coronavirus data country-wise:

$ corona India

Display top N countries afftected by Coronavirus:

$ corona --top=10

Or,

corona -t=10

For more details, refer the project’s GitHub page given at the end.

3. COVID-19 Tracker CLI

COVID-19 Tracker CLI is yet another command line program to track Coronavirus Disease 2019 (COVID-19) cases around the world. It is also written in NodeJS. It uses Worldometer API to collect the COVID-19 data.

Concerning about the features, we can list the following:

  • Real-Time updates.
  • Optimized application.
  • Fast response time (~< 100ms).
  • Simple layout and easy to understand.
  • By country query.
    • e.g. (/country).
  • Windows CMD support.
    • e.g. (/cmd or /cmd/country).
  • Plain or Basic version.
    • e.g. (/plain or /plain/country) or (/basic, /basic/country).
  • Random health saying on footer.
  • No installation required!
  • Free and Open source!!

Track Coronavirus Disease 2019 (COVID-19) Statistics From Commandline Using COVID-19 Tracker CLI

As I already mentioned, COVID-19 Tracker CLI doesn’t require any installation. All you need to do is Curl or Wget commands. Both are comes pre-installed in most Linux distributions.

To track COVID-19 data worldwide, simply run:

$ curl https://covid19tracker.xyz

Or,

$ wget -i https://covid19tracker.xyz && cat index.html

Sample output:

Track Coronavirus Disease 2019 (COVID-19) Statistics From Commandline Using COVID-19 Tracker CLI

As you can see in the above outputs, COVID-19 Tracker CLI program displays the COVID-19 global cases in a simple tabular-column format with the following details:

  • Total number COVID-19 cases,
  • Total number of deaths,
  • Total number of recovered cases,
  • Mortality rate in %.
  • Recovered rate in %.

There is also a random health saying or precaution message at the bottom. Very cool!

You can also track the COVID-19 cases by country-wise by mentioning the country name like below.

$ curl https://covid19tracker.xyz/India
Track the COVID-19 cases by country-wise Using COVID-19 Tracker CLI

To me tracking COVID-19 cases with curl command is much better than wget method. Anyway, you can use any method that suits for you.

For more details, look at the project’s GitHub page given at the end.

Useful online resources that provides live Coronavirus statistics

If you don’t want to install anything, use the following online resources to track the Coronavirus data from an Internet-connected desktop/mobile/tablet:

Stay informed about Coronavirus:

Protect yourself from Coronavirus

There is a popular proverb – “Prevention is better than cure.”. I fully concur with it. Since there is currently no vaccine to prevent coronavirus disease, follow all advises suggested by the WHO, Doctors and local healthcare authorities to protect yourself and your family from Coronavirus:

  1. Wash your hands frequently with soap and water or with an alcohol-based solution.
  2. Maintain social-distancing (at least 1 metre from others).
  3. Cover your mouth/nose with your elbow while coughing and sneezing.
  4. Avoid touching your face, particularly eyes, nose and mouth.
  5. Stay in your HOME as much as possible.

Resources:

  1. Corona-cli GitHub Repository
  2. Coronavirus-tracker-cli GitHub Repository
  3. COVID-19 Tracker CLI GitHub Repository

Source: https://www.ostechnix.com/track-coronavirus-disease-2019-covid-19-statistics-from-commandline/

Stop User Enumeration in WordPress

This tutorial explains how to block user-enumeration scans in WordPress. As explained in greater depth here, user enumeration happens when some malicious script scans a WordPress site for user data by requesting numerical user IDs. For example, requests for author=1 through some number, say, author=1000, may reveal the usernames for all associated users. With a simple enumeration script, an attacker can scan your site and obtain a list of login names in a matter of seconds.

How it works

When scanning a site for user IDs, disclosure of user data happens in two ways. First, for permalink-enabled sites, requests for ?author=n (where n equals any integer) are redirected to the permalink version of the URL for that user, which by default includes the author’s login username. So for example, on a permalink-enabled site, the following URI requests:

http://example.com/?author=1
http://example.com/?author=2
http://example.com/?author=3
.
.
.

..automatically are redirected by WordPress to their “pretty permalink” counterparts:

http://example.com/author/admin-user/
http://example.com/author/wordpress-user/
http://example.com/author/some-other-user/
.
.
.

..of course, the actual usernames will vary depending on your site, but you get the idea.

The second reason that user enumeration works to reveal user data is that theme templates typically display the author name on author-archive pages, in post meta information, and possibly in other locations, depending on the theme.

For more details on user enumeration, check out my article on blocking user ID phishing requests over at htaccessbook.com.

Should you be worried?

If you are sure that all of your users are using strong passwords that are updated regularly, then there is nothing to worry about. This tutorial is aimed at sites with multiple authors who may not be “password savvy”. If an author is being lazy with their passwords, then user-enumeration could definitely put your site at risk. Equipped with a known username, a perpetrator quickly may gain access using a simple brute-force attack.

So to be safe, check out the following techniques to protect your site against user-enumeration and brute-force attacks. They take only a minute to implement, and will serve to harden your WordPress-powered site with additional layers of security.

Step 1: Disable the scans

The first thing we want to do is block the malicious enumeration scanning. This can be done in one of two ways:

  • Add a code snippet to your theme’s functions.php file
  • Add a code snippet to your site’s root .htaccess file

Let’s check out each of these methods..

Block user-enumeration via functions.php

To block user-enumeration via functions.php, add the following code to your theme’s functions file:

// block WP enum scans
// https://m0n.co/enum
if (!is_admin()) {
	// default URL format
	if (preg_match('/author=([0-9]*)/i', $_SERVER['QUERY_STRING'])) die();
	add_filter('redirect_canonical', 'shapeSpace_check_enum', 10, 2);
}
function shapeSpace_check_enum($redirect, $request) {
	// permalink URL format
	if (preg_match('/\?author=([0-9]*)(\/*)/i', $request)) die();
	else return $redirect;
}

No editing is required for this to work, just copy/paste and done. Here’s how it works:

  1. Check if the request is for any page in the WP Admin Area
  2. Block the request if it’s for a query-string author archive

That’s the basic gist of it. Hit me up in the comments section for more specifics on what this code is doing, how it works, etc.

Block User Enumeration via .htaccess

If you would rather block requests at the server level, you can add the following slice of .htaccess to your site’s root .htaccess file:

# Block User ID Phishing Requests
<IfModule mod_rewrite.c>
	RewriteCond %{QUERY_STRING} ^author=([0-9]*)
	RewriteRule .* http://example.com/? [L,R=302]
</IfModule>

The only edit that’s required is the domain/URI, http://example.com/, which you should change to match your own. For more information about this technique, check out my tutorial on blocking user-id phishing.

FYI: You can also stop user enumeration with BBQ Pro Firewall »

Step 2:

At this point, we’ve added a code snippet (in either functions or .htaccess) that will block those nasty user-enumeration scans. The second part of the equation is to make sure that your theme does not disclose the login username of any authors or users. Unfortunately, there is no quick, one-step solution for this step, as it requires careful examination of your theme. Here are some things to check:

  • Author name displayed for each post
  • Author name displayed for author-archive views
  • Author name displayed anywhere else on the front-end

If your theme displays author names anywhere (as most themes do), there are few ways to prevent username disclosure:

  • Change all user Display Names to anything other than the login name
  • Make sure any author/user template tags are not displaying the login name
  • Remove any template tags that display author/user login names
  • Disable author archives entirely (if not needed)

Of course, this is a general guide that may not be applicable to every theme on the face of the planet (there’s only like a billion of them). But it should be enough to give you the idea and help you implement the best possible solution for your site.

Source: https://perishablepress.com/stop-user-enumeration-wordpress/

Message: Need GroupName!

ERROR: OTRS-CGI-10 Perl: 5.16.3 OS: linux Time: Tue Sep 11 16:06:31 2018

Message: Need GroupName!

RemoteAddress: XXXXXXXXXXXXXXXX
RequestURI: /otrs/index.pl?Action=Admin

Traceback (1636):
Module: Kernel::System::Group::PermissionCheck Line: 945
Module: Kernel::Output::HTML::NavBar::ModuleAdmin::Run Line: 77
Module: Kernel::Output::HTML::Layout::NavigationBar Line: 3242
Module: Kernel::Modules::Admin::Run Line: 35
Module: Kernel::System::Web::InterfaceAgent::Run Line: 1116
Module: ModPerl::ROOT::ModPerl::Registry::opt_otrs_bin_cgi_2dbin_index_2epl::handler Line: 40
Module: (eval) (v1.99) Line: 207
Module: ModPerl::RegistryCooker::run (v1.99) Line: 207
Module: ModPerl::RegistryCooker::default_handler (v1.99) Line: 173
Module: ModPerl::Registry::handler (v1.99) Line: 32

 

Solution:

Use this script to correct value.

https://gist.githubusercontent.com/reneeb/8e57d2415d963e3650051d1278984491/raw/beb6e2bf064467fa8df2b5143dea64c85ceeeeb4/CheckNavBar.pl

#!/usr/bin/perl

use v5.10;

use strict;
use warnings;

use lib qw(/opt/otrs /opt/otrs/Kernel/cpan-lib);

use Kernel::Config::Files::ZZZAAuto;

my $Config = {};

Kernel::Config::Files::ZZZAAuto->Load( $Config );

for my $Key ( qw/Frontend::NavigationModule Frontend::Module/ ) {
    check_config_key( $Key );
}


sub check_config_key {
    my ($Key) = @_;

    MODULE:
    for my $Module ( keys %{ $Config->{$Key} || {}  } ) {
        next MODULE if !ref $Config->{$Key};
        next MODULE if 'HASH' ne ref $Config->{$Key};

        my $Data = $Config->{$Key}->{$Module};
 
        TYPE:
        for my $Type ( qw/Group GroupRo/ ) {
            next TYPE if !ref $Data->{$Type};
 
            GROUP:
            for my $Group ( @{ $Data->{$Type} || [] } ) {
                next GROUP if defined $Group && $Group ne '0' and $Group ne '';
                say sprintf 'Please check attribute %s of SysConfig setting %se###%s: "%s" is not a valid Group', $Type, $Key, $Module, $Group;
            }
        }
    }
}

Microsoft Power Bi – Add image, text, video, and more to your dashboard

Add tile

The Add tile control lets you directly add an image, text box, video, streaming data, or web code to your dashboard.

  1. Select Add tile from the top menu bar. Depending on space limitations, you may see only the plus  sign.

  2. Select which type of tile to add: ImageText boxVideoWeb content, or Custom streaming data.

Add an image

Say you want your company logo on your dashboard, or some other image. You’ll need to save the image file online and link to it. Make sure special credentials aren’t required to access the image file. For example, OneDrive and SharePoint require authentication, so images stored there can’t be added to a dashboard this way.

  1. Select Image > Next.

  2. Add image information to the Tile details pane.

    • to display a title above the image, select Display title and subtitle and type a title and/or subtitle.
    • enter the image URL
    • to make the tile a hyperlink, select Set custom link and enter the URL. When colleagues click this image or title, they’ll be taken to this URL.
    • Select Apply. On the dashboard, resize and move the image as needed.

Add a text box or dashboard heading

  1. Select Text box > Next.

    NOTE: To add a dashboard heading, type your heading in the text box and increase the font.

  2. Format the text box:

    • to display a title above the text box, select Display title and subtitle and type a title and/or subtitle.
    • enter and format content for the text box.
    • Optionally, set a custom link for the title. However, in this example we’ve added hyperlinks within the text box itself, so leave Set custom link unchecked.
  3. Select Apply. On the dashboard, resize and move the text box as needed.

Add a video

When you add a YouTube or Vimeo video tile to your dashboard, the video plays right on your dashboard.

  1. Select Video > Next.

  2. Add video information to the Tile details pane.

    • to display a title and subtitle at the top of the video tile, select Display title and subtitle and type a title and/or subtitle. In this example, we’ll add a subtitle and then turn it into a hyperlink back to the entire playlist on YouTube.
    • enter the URL for the video
    • Add a hyperlink for the title and subtitle. Perhaps after your colleagues watch the embedded video you’d like them to view the entire playlist on YouTube — add a link to your playlist here.
    • Select Apply. On the dashboard, resize and move the video tile as needed.

  3. Select the video tile to play the video.

  4. Select the subtitle to visit the playlist on YouTube.

Add streaming data

Add web content

Paste or type in any HTML content. Power BI adds it, as a tile, to your dashboard. Enter the embed code by hand or copy/paste from sites such as Twitter, YouTube, embed.ly, and more.

  1. Select Web content > Next.

  2. Add information to the Add web content tile pane.

    • to display a title above the tile, select Display title and subtitle and type a title and/or subtitle.
    • enter the embed code. In this example we’re copying and pasting a Twitter feed.
    • Select Apply. On the dashboard, resize and move the web content tile as needed.

Tips for embedding web content

  • For iframes, use a secure source. If you enter your iframe embed code and get a blank tile, check to see if you’re using http for the iframe source. If so, change it to https.
  https://xyz.com

If you’d like the player to resize to fit the tile size, set width and height to 100%.

  
  • This code embeds a tweet and retains, as separate links on the dashboard, links for the AFK podcast, @GuyInACube’s Twitter pageFollow#analyticsreplyretweet, and like. Selecting the tile itself takes you to the podcast on Twitter.
  <blockquote class="twitter-tweet" data-partner="tweetdeck">
  <p lang="en" dir="ltr">Listen to
  <a href="https://twitter.com/GuyInACube">@GuyInACube</a> talk to
  us about making videos about Microsoft Business Intelligence
  platform
  <a href="https://t.co/TmRgalz7tv">https://t.co/TmRgalz7tv </a>
  <a href="https://twitter.com/hashtag/analytics?src=hash">
  #analytics</a></p>&mdash; AFTK Podcast (@aftkpodcast) <a
  href="https://twitter.com/aftkpodcast/status/693465456531771392">
  January 30, 2016</a></blockquote> //platform.twitter.com/widgets.js

Edit a tile

To make changes to a tile…

  1. Hover over the top right corner of the tile and select the ellipses.

  2. Select the edit icon to re-open the Tile details pane and make changes.

Considerations and troubleshooting

  • To make it easier to move the tile on your dashboard, add a title and/or subtitle.

  • If you’d like to embed some content from a website, but the website doesn’t give you embed code to copy and paste, check out embed.ly for help generating the embed code.

Source: https://powerbi.microsoft.com/en-us/documentation/powerbi-service-add-a-widget-to-a-dashboard/

How to use StatSVN to Monitor Developer Commits and Lines of Code

StatSVN can be used to monitor Subversion repositories and generate timelines for lines of code, commits by days/hours, directory stats, file sizes, graphs and more. This can be a very useful tool for monitoring developers and the lines of code they touch per day. In the following article I give examples of how to use StatSVN using CentOS command line (CentOS release 6.7 in this example).

Install Java

StatSVN requires Java, so check if it is installed: # which java

/usr/bin/javaIf no Java program is displayed install Java, for example: # yum install java-1.8.0-openjdk.x86_64Check install: # java -Xmx4m -version

openjdk version "1.8.0_65"

OpenJDK Runtime Environment (build 1.8.0_65-b17)

OpenJDK 64-Bit Server VM (build 25.65-b01, mixed mode)

Get StatSVN

Download the latest StatSVN JAR file here or download v0.7.0 here

Run StatSVN

Next run StatSVN to generate a series of report files. First, a Subversion repository log is required for StatSVN. Create this log file by running a Subversion command, for example: # cd /var/svn/my-project

# svn log --xml -v > svn.logNext execute the StatSVN JAR file using the command java -jar statsvn.jar <svn log path> <svn project directory path>, for example: # cd /var/svn/my-project

# mkdir statsvn

# cd statsvn

# cp /my-downloads/statsvn.jar ./

# java -jar statsvn.jar /var/svn/my-project/svn.log /var/svn/my-projectThis should execute the JAR file and begin generating files. After the output is complete open the /var/svn/my-project/statsvn/index.html in a Web browser – which should display development statistics for the Subversion repository.

Source: http://www.shayanderson.com/linux/how-to-use-statsvn-to-monitor-developer-commits-and-lines-of-code.htm