Let's talk about whois, a fantastic tool and protocol that I use with funceble to get information about domain.

What is WHOIS?

whois is a program that will tell us the owner or at least the hosting company of any domain name.

Example

Let's try to get the information about google.com

$ whois google.com

As you can see once you executed the command, you get all information about google.com.

Let's talk about nslookup, a fantastic program that I use with funceble to get information about domain(s).

What is NSLOOKUP ?

nslookup is a program that will help us or a sysadmin find out the corresponding IP address of a domain name. It can also give us the host name for an IP address.

Example

Let's try to get the information about funilrys.com

Valid domain name

$ nslookup funilrys.com
Server:        192.168.178.1
Address:    192.168.178.1#53

Non-authoritative answer:
Name:    funilrys.com
Address: 217.160.0.131
Name:    funilrys.com
Address: 2001:8d8:100f:f000::22e

Invalid domain name

$ nslookup funilrys.comm
Server:        192.168.178.1
Address:    192.168.178.1#53

** server can't find funilrys.comm: NXDOMAIN

This is pretty useful if we want to know if a domain is still active or not.

Non-authoritative answer:

 Name

It's the domain name.

Address

It's the corresponding IP (IPv6 and IPv4) address of the domain name.

Today I start a new adventure with funceble, a new script to check domains or IP availability.

Funceble is now described as:

[an] excellent script for checking ACTIVE, INACTIVE and EXPIRED domain names.

Where does the idea come from?

The idea of the script came under a discussion around the famous Steven Black's hosts file(s). Indeed, the hosts file is really great but the main problem is that the there's probably many domains that do not exist anymore.

So I planned to write funceble.

An explanation of the script ?

A full releases changelog can be found here.


Special Thanks

Thank you for your awesome hosts lists, support or contributions which helped (and/or still help) me build this script. :smile: :+1:

Contributors

Thank you for your awesome ideas or contributions which make or made funceble better!! :+1: :100: :1st_place_medal:


Supporting the project

Funceble and dead-hosts are powered by :coffee:!

This project helps you and or you like it? Why don't you Buy me a cup of coffee? :smile_cat:

Today I explain how to generate some random background with javascript!

Functions

In order to be more efficient I choose to write some Functions.

backgrounds()

We need a function which return a list of link (or filename) to use as background.

/**
 * Return a list of URL
 */
function backgrounds() {
    // We create a variable
    var imageURLs = [
        // We assign in an array the list of URL/filename we want as background
        "https://wallpapers.wallhaven.cc/wallpapers/full/wallhaven-301322.jpg",
        "https://wallpapers.wallhaven.cc/wallpapers/full/wallhaven-103541.jpg",
        "https://wallpapers.wallhaven.cc/wallpapers/full/wallhaven-279000.jpg",
        "https://wallpapers.wallhaven.cc/wallpapers/full/wallhaven-106689.jpg",
        "https://wallpapers.wallhaven.cc/wallpapers/full/wallhaven-365847.jpg",
        "https://wallpapers.wallhaven.cc/wallpapers/full/wallhaven-284161.jpg"
    ];

    // We return the created variable
    return imageURLs;
}

randomNumber()

We need a function that return a random in range [0-x] where x is the length of backgrounds().

/**
 * Return a random number in range [0-x] where x is the length of backgrounds
 * @param {int} max
 * @returns {int}
 */
function randomNumber(max) {
    return Math.floor((Math.random() * max));
}

getBackground()

We need a function that return a background from backgrounds() with randomNumber() as index.

/**
 * Get a random url from backgrounds
 * @returns {str}
 */
function getBackground() {
    var numberOfImages = backgrounds().length,
        uniqueNumber = randomNumber(numberOfImages);
    return backgrounds()[uniqueNumber];
}

showBackground()

we need a function that return a well formatted css for the background.

/**
 * show background on screen
 * @returns {DOM}
 */
function showBackground() {
    document.body.style.backgroundImage = "url('" + getBackground() + "')";
    document.body.style.backgroundPosition = "center center";
    document.body.style.backgroundRepeat = "no-repeat";
    document.body.style.backgroundAttachment = "fixed";
}

Load all on page loading

// On load, we show the background on screen
window.onload = showBackground();

Final script

Known issue

This script doesn't work on safari.

Intelligence defends peace. Intelligence has a horror of war.

Honoré de Balzac