Website Alert Toast with JavaScript/jQuery

There’s a really simple method to show toasts in Android and other mobile apps but you can do the same for your website beautifully.

From the below codes, you can either go with JavaScript or jQuery, as convenient.


function toast(msg,status){
    var body = document.body,
    snack = document.createElement('div');
    snack.innerHTML = '<div id="snackbar" class="snackbar bobx toast bg-'+status+'">'+msg+'</div>';

Or, jQuery

function toast(msg,status){
	$('body').prepend('<div class="snackbar bobx toast bg-'+status+'">'+msg+'</div>');
	setTimeout(function(){ $('.snackbar').remove(); }, 3000);


/* toast bar */
.snackbar {
    z-index: 1000001;
    display: block;
    position: fixed;
    background-color: #ffe0b2f7;
  	color: #fff;
    margin-left: 39%;
    width: 18%;
    text-align: center;
    padding: .5em 2%;
    color: #b48126;
    font-weight: 500;
    text-transform: lowercase;
    -webkit-animation: fadein 0.5s, fadeout 0.5s 2.5s;
    animation: fadein 0.5s, fadeout 0.5s 2.5s;
    border-radius: 5px;
	overflow: hidden;

/* for background color; bg-0 = false/error;bg-1 = true/success */

Webpage Auto Scroll from Browser Console

Automate scroll through huge web pages with a small JavaScript snippet from your browser console.

I hope it’s helpful for someone.
Right click > Inspect > Console Tab > Paste the code

(function() {
    var intervalObj = null;
    var retry = 0;
    var clickHandler = function() { 
        console.log("Clicked; stopping autoscroll");
        document.body.removeEventListener("click", clickHandler);
    function scrollDown() { 
        var scrollHeight = document.body.scrollHeight,
            scrollTop = document.body.scrollTop,
            innerHeight = window.innerHeight,
            difference = (scrollHeight - scrollTop) - innerHeight

        if (difference > 0) { 
            window.scrollBy(0, difference);
            if (retry > 0) { 
                retry = 0;
            console.log("scrolling down more");
        } else {
            if (retry >= 3) {
                console.log("reached bottom of page; stopping");
                document.body.removeEventListener("click", clickHandler);
            } else {
                console.log("[apparenty] hit bottom of page; retrying: " + (retry + 1));

    document.body.addEventListener("click", clickHandler);
    intervalObj = setInterval(scrollDown, 1000);

Resources and Bug Fixes for Machine Learning and Deep Learning on NVIDIA GeForce 1050Ti Devices

We all know how important machine learning has become and developers are trying to train their models from high-end servers to low-tech PCs. I own Dell XPS 15 9570 and have faced several issues while installing resources and libraries on my device. A lack of documentation can make your setup worse and my own GPU lacks that.

Some developers have even shown their disappointment thinking they can’t set up a machine-learning environment on this GPU, because of a lack of enough resources. I’m going to keep it simple and device-specific. For a complete tutorial, you can follow this article – Setup a Python Environment for Machine Learning and Deep Learning and come back here if got stuck anywhere.


  1. Install Anaconda
  2. Update libraries via Anaconda Prompt
    conda update conda
    conda update --all
  3. Install CUDA Toolkit & cuDNN
    There is no mention of 1050Ti on NVIDIA’s official website for CUDA support which made developers scared in the first place. Just download and install CUDA 10.1 for this device-specific.
    For cuDNN, as mentioned in TensorFlow documentation you must select your CUDA-specific cuDNN by cross-referencing the table available. For us, we’ll go with cuDNN 7.6 for CUDA 10.1 from archives (for TensorFlow GPU 2.3.0).
  4. Add cuDNN into Environment Path (System) and, "C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.1\bin" to both System and User Environment Paths. We’re trying to avoid future errors here.
  5. Install the TensorFlow GPU variant
    pip install tensorflow-gpu
  6. Test the installation by printing something in python
    import tensorflow as tf
    hello = tf.constant('Hello, TensorFlow!')
  7. Finally, install Keras
    pip install keras

Now run your Jupyter notebook to test out your models. For starters, give this example a try. Let me know if you received any errors while Installing these libraries, I can test them out.

Setting Up IIS, PHP, and MySQL on AWS EC2 Windows Server

Today we’re going to set up a Windows server on IIS with PHP, MySQL, and OpenSSL, enabling you to configure and host public websites with an encrypted connection. I’ve divided it all into 5 simple steps after which you can start working on it easily and instantly.

Objective: Launching a Windows Server on AWS, Enabling and Configuring IIS for Public Website Hosting with PHP and MySQL.

  1. Launching Windows Instance
  2. Enabling IIS Server and Required Features
  3. Installing Additional Tools Required
  4. Testing PHP and MySQL Connection
  5. Bonus: Setting up OpenSSL for Websites


Log into your AWS Panel (or Sign Up) and from the Services menu, open EC2 Panel. From the Dashboard pane click Launch Instance and search for Windows Server, you can select any preferred base variant (better without Containers or SQL Server if not required by your app as we’re already going to add MySQL later).

EC2 Instance Launch Wizard


Open Server Manager > Add Roles and Feature
From Add Roles and Features Wizard > Features > Web Server IIS (ref. to the screen below)

List of Windows Server Features Installing

Either download tools on your PC and move them to your server or on your server open

Internet Explorer > Internet Options
Security Tab > Internet > Custom level
Security Settings - Internet Zone (window) >
Downloads > File download > Enable
Miscellaneous > Access data sources across domains > Enable
Scripting > Active Scripting > Enable

Now, from Server Manager > Tools open Internet Information Services (IIS) Manager
IIS Manager’s Action Sidebar > Click on Web Platform Components Link and Install the extension.


Download and install the latest PHP Manager for IIS from GitHub.
Restart IIS Manager.
Select Server from Connections > Featured View > Open Web Platform Installer
Search for “PHP” and add the latest variant in the installation queue, from Items to be installed, remove PHP Manager (as we’ve installed it separately).
Search for “URL rewrite”, add it, and start the installation.


Open PHP Manager > View recommendations and update the requested values and click OK.
Now click on Check phpinfo() with the default Website, if everything goes well, you’ll see this output.

Getting PHP Output

Open location "C:\inetpub\wwwroot\" and place your PHP website/script in the directory. Or you can change the Physical path from IIS Manager > Sites > Your Website > Actions > Basic Settings > Physical path.

Now let’s download the MySQL installer for Windows and select what features/products you want to install, we need MySQL Server only. If you want to visualize your database, select Workbench also. Once installation and setup (credentials form) are complete, we’re ready to test the connection.

Create a PHP test script with the following code:

// credentials$server = "localhost";
$user = "username";
$pass = "password";
// create connection
$conn = new mysqli($server, $user, $pass);
// check connection
if ($conn->connect_error) {
   die("connection failed: " . $conn->connect_error);
echo "connected successfully";

If you see a successful connection message, we’re good to go to launch our localhost projects.


OpenSSL is a great way to encrypt your website and secure end-to-end data for your users. OpenSSL supports a number of different cryptographic algorithms: Ciphers. AES, Blowfish, Camellia, Chacha20, Poly1305, SEED, CAST-128, DES, IDEA, RC2, RC4, RC5, Triple DES, GOST 28147-89, SM4.
This step is not for local hosts.

Download the Win ACME Pluggable version and place the extracted files on your server. Now run file "wacs.exe".

Windows ACME Launch Screen

Choose the first option by entering the letter “N”. Then select the website you want the SSL for, by keeping everything recommended. You can still choose either to go with single or all website bindings. The best way to renew the certificate is to keep it in the memory and let the program update the SSL itself.



I’m Ghazi and I created this blog to share some ideas, and issues and solve problems related to programming and tech we face in our daily lives and what I’ve learned through my experiences and mistakes.

Here we are going to work together on multiple open-source projects too. From Web Apps to Android and some ML too. But I must tell you I love talking too much and most of them are indeed trash (that’s why I had to put it in the website title). I hope to create a bond between this blog (me) and my readers.

Not a very great blogger but surely ready to try something new.

I’m self-taught, first thing, so I lack a lot of technical terminology and jargon. So what I do instead is put things forward in as simple terms as possible, which I hope won’t be a big problem, I can always learn things from you guys.

Now let’s go into little detail about my previous projects and dissect them to help you get familiar with my working space.

I started with Java in high school days, not very interested in programming for obvious reasons but slowly it grew on me and I came to love the idea of creating things. So I started with simple calculators, then the advanced chatbots. But I wanted to explore more fluid and visible options available.

After school, I started HTML, and CSS (HTML5 and CSS3 were fairly new), but I was a version behind because I was clueless about what to look for. So to make it programmable, I learned PHP and MySQL with GUIs (not very good at terminals tbh). First, localhost (XAMPP, Wamp, etc) then moved to a remote host, don’t remember the name with a very common blog idea, an entertainment site then a music site build on its very sub-domain (can’t tell how idiot I feel now) for hosting I chose Linux with GUI; cPanel and phpMyAdmin after that moved that website to GoDaddy with Plesk Panel (still Linux).

After exploring almost all the options available for hosting from Shared, to Dedicated to Virtual (as Cloud came later) and multiple OS distributions, I decided to go with Windows for more familiar UI reasons, as I’ve been using Windows PC since the beginning of my programming career.

Then came the big idea of cloud computing, at first I thought of it as just another virtual computing with a different label (to some extent it’s still the case) but when I decided to enter it, I was amazed by the number of possibilities it came with. I’m still exploring the huge horizons of it, and I’m in love with AWS now.

Once web development was in the works, I had to look for new ideas to avoid becoming boring. I started working on Android Development (still learning) and published a few open sources on Java (Kotlin wasn’t introduced yet).

So this was a nice journey I must say, a good beginning in fact. And I hope to create many beautiful things along with you guys.

Let’s do this.