Tech – Deep Focus https://fazals.ddns.net/ Embrace it! Wed, 13 Jan 2021 14:36:54 +0000 en-US hourly 1 https://wordpress.org/?v=5.6.1 https://fazals.ddns.net/wp-content/uploads/2020/08/react-native-300-150x150.png Tech – Deep Focus https://fazals.ddns.net/ 32 32 173186184 How to turn your Raspberry Pi as a downloading client [Both Torrent and regular downloads] and NAS https://fazals.ddns.net/how-to-turn-your-raspberry-pi-as-a-downloading-client-both-torrent-and-regular-downloads-and-nas/ Mon, 27 Jul 2020 13:26:23 +0000 https://fazals.ddns.net/?p=2508

It’s always ideal to use your Raspberry Pi as a dedicated downloads server and as a NAS or “Network Attached Storage”.

Leaving your desktop or Laptop turned on for a prolonged period of time, not only is energy intensive, but also waste of resources. An average Desktop PC in a typical home or small office is likely to cost you a bill of around 15,000 Indian Rupees. (Roughly 200$).

The Raspberry Pi comes to the rescue. The new Raspberry Pi 4 costs only 35$, which is way cheaper than any laptop or a desktop and is not likely to add 0’s at the end of your electricity bills. A typical Raspberry Pi is likely to consume energy that costs less than 250 Indian Rupees yearly. Adding an external Hard Drive is pretty much not going to increase that.

Additionally, you can run the Raspberry Pi headlessly, without a monitor & without even Keyboard and Mouse. All you need is a WiFi/Ethernet connection and a USB power supply.

Sounds Good? So lets start converting your Raspberry Pi to a headless downloading machine that can download anything from the web.

Lets gather the stuff we need

1. The Raspberry Pi

We will assume that you have a Raspberry Pi (the version doesn’t really matter, but i recommend the Raspberry Pi 4B as it has a Gigabit Ethernet) running the latest version of Raspbian. (Now renamed to Raspberry OS)

2. An External USB Drive

It’s not necessary to have an external drive, but I do recommend you to use one which is USB 3, as it has better speed and doesn’t bottle neck the transfers.

Remember that if you are running the Raspberry Pi headlessly, you need to configure SSH to access it remotely. Setting up VNC is also a good choice. If you need any information on setting up Raspberry Pi headlessly, I strongly suggest you the follow the following guides.

  1. Everything you need to know to setup SSH, VNC on a Raspberry Pi and run it headlessly.
  2. How to set up Raspberry Pi as a Network Attached Storage.

Let’s get started

Assuming that you have the Raspberry Pi up and running with an internet connection, either from the Ethernet or the WiFI, we will get started with building our Raspberry Pi downloading client and NAS.

Step 1: Update & Upgrade

Before we start with the actual setup, take a moment to update and upgrade your Raspberry Pi to the latest version available. Open a terminal window and run the commands one after the other.

sudo apt update
sudo apt upgrade -y

Step 2: The prerequisites

Once that is done, its time to begin the installing the required software components for this project.

  1. We will be using Transmission as our torrent downloading client. And Aria2 as our non-torrent downloading client.
    But the directory in which the downloads are saved, can be the same for both or different based on your preference.
  2. For the NAS part, i recommend SAMBA. It is a free implementation of the SMB networking – the one used on windows. SFTP is also a very good choice, but SAMBA is windows ready.

Run the command below one by one in a terminal window to install all the required components.

sudo apt install samba samba-common-bin transmission-daemon aria2

We will also need the Apache http server installed on the Raspberry Pi for the Aria2 web interface. Run the following command to install Apache2 with php support.

sudo apt install apache2 php

Step 3: Create the download directories

We need some place where all of our downloads will be stored. And the same will be later accessed remotely from the NAS over the network. We will create the download directories in the home directory of the default user pi.

Run the following commands one by one in the terminal to create download directories, change ownership and to grant proper read-write permissions.

cd
mkdir Downloads
sudo chown -R pi: Downloads
sudo chmod -R 775 Downloads

The Download directory is now configured so that everyone can read and the root and logged in users can read and write.

Step 4: Edit the configuration files

Now that we are done with installing all the prerequisites, and creating the shared directories, we need to edit the configuration files for Transmission and SAMBA. But, any configuration file that we edit will be over written by the application while they are running in the background.

Run the following commands to terminate the downloading client’s and the SAMBA server’s background processes.

sudo service transmission-daemon stop
sudo service smbd stop

Firstly, we will edit the settings.json file.It is Transmission, our torrent downloading client’s configuration file. The file is located in the /etc/transmission-daemon directory.

sudo nano sudo nano /etc/transmission-daemon/settings.json

Within this file, we will modify the following configuration options.

"download-dir": "/home/pi/Downloads",

Change Your_Password with the one you will be using to login to the client

"rpc-password": "Your_Password",

Next, we change the username we want to use to connect to Transmission. The default will be “transmission”

"rpc-username": "Your_Username",

Whitelisting your local IPs should do that job if you are planning to use the downloading client from your local network, which in most cases starts from 192.168… Change the IP accordingly. *.*.*.* allows all IP addresses to access the client which is not recommended unless you know what you are doing.

"rpc-whitelist": "192.168.*.*",

Next we need to edit the SAMBA configuration file – smb.cong, located at /etc/samba/. I suggest you to go through the configuration file once as we will be creating a new configuration file and the default one will no longer be needed.

You can rename or delete the existing the configuration file. I prefer renaming as you have the original file to restore, in case something goes wrong. Run the following commands to rename the existing file and to create a new one using nano.

sudo mv smb.conf smb.conf.old
sudo nano smb.conf

Now copy the following lines of code to the new file.

[homes]
   comment = Downloads Shared Folder
   browseable = yes
   path = /home/pi/Downloads
   read only = no
   create mask = 0775
   directory mask = 0775
   public = yes

Save the modified file using Ctrl+X , y then Enter.
And that should complete the configuration.

Step 5: Start transmission and SAMBA & Aria2.

Now that we have completed editing the configuration files. We can safely start Transmission Daemon and SAMBA server.

Run the following commands to start transmission and SAMBA. And also run Aria2 – our non-torrent downloading client in background.

sudo service smbd start
sudo service transmission-daemon start
sudo nohup aria2c --enable-rpc --rpc-listen-all &

Step 6: Setting up Aria2 Web UI

Next we need to navigate to the http server’s root directory and download the files from GitHub for Aria2.
Run the following commands in a terminal window.

cd /var/www/html
git clone https://github.com/ziahamza/webui-aria2.git
sudo mv webui-aria2/docs/* .

And that’s all you have to do.

Accessing the Interfaces

The Transmission’s Web UI can be accessed on the port 9091 on the IP address of your Raspberry Pi. Where as the Aria2 Web UI can be accessed on post 80, the default http port.
Open your web browser connected to your local network and enter the ip address of your Raspberry Pi. For example: 192.168.x.x. This should open the Aria2 WebUI exactly like the picture below.

Aria2 Web Interface

You can add downloads from the add button, you can also pause and resume most of the downloads. You can also add torrents in the Aria2 download client. Yes you can download torrents in Aria2, but transmission is a better torrent client, Why? Check out the FAQ Section.

Now to access the Transmission WebUI you need to enter the ip address of the Raspberry Pi followed by a semicolon and the transmission RPC port which defaults to 9091. eg: 192.168.x.x:9091.

You should be getting a login prompt asking your Transmission User ID and password. Enter the user id and password you entered in the Transmission configuration file.

Now that you have your downloading clients ready, just go on and download something into the shared folder. And then access them on the SAMBA share. You can readily access them on your Windows PC (of course you have to have network discovery and file sharing turned on), and linux. For accessing it on android, you can use some file manager application which supports SMB. Like the ES File Explorer.

Accessing the SAMBA share

1. Accessing the SAMBA Share on Windows and Linux

Accessing the SAMBA share on windows is fairly simple. Open run and type \\ipAddressOfRaspberryPi, just like in the image shows below.

On Linux, Open your File Explorer and you should have it in the network section.

2. Accessing the SAMBA Share on Android

Download the ES File Explorer and install the application. Then go on to the LAN section in the Menu, your Raspberry Pi should show up in the application. If not you can always manually add it, all you need to know is the Raspberry Pi’s IP address.

3. Accessing the SAMBA Share on iOS

You need to install an application called as Document from the App Store and add the SMB Share in it.

Conclusion

There are other Torrent clients that you might want to investigate installing if you decide you do not like Transmission. The range is pretty limited for the Raspberry Pi but be sure to check them out.

At this point you should now have successfully setup the Transmission torrent client, Aria2 download client, and setup SAMBA on the Raspberry Pi. If you run into any issues, feel free to drop a comment below.😀

1. Why Transmission and not just Aria2?

Well, the answer is simple. Transmission also has a supported mobile app. You can use the app to directly push downloads to Transmission client and I find it more intriguing than the Web UI. You can download the Transmission Remote app to enhance your downloading experience.
]]>
2508
How can I get 100% free domain for my website? https://fazals.ddns.net/how-can-i-get-free-domain/ Sun, 24 May 2020 12:36:38 +0000 https://fazals.ddns.net/?p=1461 How can I get 100% free domain for my website? Read More »

]]>
Have you been searching for a domain name for your website that costs nothing? Have you ever got it and had to pay for it later?
Getting a free domain name for your free website is not an easy task. I have had a tough time searching for ways to get free domain name for my website. If you ask me, I would say it’s rather impossible to get a free domain, unless you have some kind of a coupon or free a give away. You cannot, ever get a free domain name for your website.

But I have seen people using free domains.

Well, what you have seen are not free domains but are free subdomains. Now, a subdomain is a part of a larger domain. Take the example of this website fazals.ddns.net. Here the root domain is ddns.net which remains the sole property of its owner and is called the top level domain. However, the prefix to the domain, here fazals, defines a subdomain.

Fun Fact: Subdomains could or couldn’t be free, even if they are free, they might have “some restrictions”.

What kind of restrictions on a free subdomain?

Well, most of the free subdomain providers restrict the use of subdomain to only A or AAAA type. Meaning that they can only be used to point to an IP address, be it IPv4 or IPv6.

Can I create any number of subdomains?

Well, this is the second restriction you will usually have. The domain providers restrict the number of subdomains you can use. For example No-IP restricts you to use only 3 subdomains at any time. FreeDNS allows a maximum of 5.

Are free subdomains worth it?

Well they are free, so definitely, they are worth it. You are using something for which others have already paid.
Who?
The owners of the root or the top level domain.

That’s enough answering questions, lets jump on to how you can get one.

There are number of domain name providers that will offer you a free domain name. Yes, domain and not subdomain, but only when you purchase a hosting plan which is quite expensive. Well at least for me.

A few most famous web hosting and domain name providers

Bulletproof your Domain for $4.88 a year!namecheap promo

Luckily, there are many free subdomain providers that actually provide subdomain for free. And yes, they have some restrictions, but they can definitely be ignored when compared to what is being provided.

Create a website for free and that too without coding, fascinating right? Check it out.

Free subdomain providers

I personally prefer using No-IP and FreeDNS as they are a little more versatile and provide fast updates. You can literally use any of them.

No-IP and FreeDNS also provide Dynamic DNS clients so that you will be able to use them of self hosted website whose ip address keeps on changing.

Whats Dynamic DNS and why should I use it?

Have you ever noticed that your ip address on your mobile and broadband network keep changing?
If yes, then your ip address is dynamic, and not static. Imagine you have a dynamic ip address allocated, the one which keeps changing and you are hosting a website. You setup a domain name to point toward that ip address.

For time being, you are able to access the website. Then, your ip address has suddenly changed. You can no longer access your website. You need to manually change the domain-ip mapping. Instead of doing it manually, the Dynamic DNS or the DDNS clients that run either on the router or on any other computer on your network update the domain-ip mapping automatically whenever a change in ip is detected.

So that’s how you get a free domain name. It’s simple, it’s easy and the most economically efficient way of getting a domain name.

Feel free to comment and share. Follow me on social media.

]]>
1461
How to connect seven segment display with 8051| Easiest method | Proteus Simulation https://fazals.ddns.net/seven-segment-display-with-8051-proteus-simulation/ Sat, 02 May 2020 10:21:25 +0000 https://fazals.ddns.net/?p=745 How to connect seven segment display with 8051| Easiest method | Proteus Simulation Read More »

]]>
In this post you will learn how to interface seven segment display with the 8051 microcontroller (AT89C51) in multiplexed method, alternatively rolling seven segment display in a simulation software called Proteus.

The basic concept behind multiplexed seven segment display is to turn on one display at a time, at a rate so fast that it seems to our eyes that all of the displays are turned on. I will be using 8 such displays and show you how to use them in the right way.

Introduction to seven segment display

As it can be seen from the picture beside that the digit 8 is made up of 7 segments which can be indivisually turned on or off to display a character. Also, make a note that it can be used to display all the numbers, but not all the letters. For instance, letters like Z, N, G, J, K, M, Q, R, and so on can’t be displayed. While letters like O, B, D cause a lot of confusion when interpreting.

The displays can be used in 2 modes or 2 configurations.
1. Common Anode (common +ve terminal)
2. Common Cathode (common ground)
We will be using the 2nd one, the common cathode or the common ground because it causes less confusions in logics.

We will be using the entire 8 bit port. So we have to connect led A to the MSB, led B to next LSB and so on up till the last one. This will make the led G connect to the last but one bit. The last bit will have to be connected to the DP, or the point.

So inorder to display the letter A, you must turn on led E, F, A, B, C, G and turn off the rest. That combination would give us 11101110 in binary that has to be sent to the required port. Like wise, to display the letter E, would have to send 10011110 in binary to the required port. This covers the basics.

The Hardware

Indeed the first thing you need to do is to set up the hardware. Connect the seven segment displays as shown in the schematic. If you have indivisual displays and not blocks of them. Just connect them in parallel and then connect them to the microcontroller.

Seven Segment Display
The 8051 μController

The assembly code

In order to use the seven segment display, we need to use the lookup table method. Lookup table method is a way to access the data based on the addresses or in programming terminology, the indexed. So we will write the table starting from location 500h on the ROM as follows.

org 500h
numbers: db 11111100b, 01100000b, 11011010b, 11110010b, 01100110b, 10110110b, 10111110b, 11100000b, 11111110b, 11110110b
_H: db 01101110b
_E: db 10011110b
_L: db 00011100b
_O: db 11111100b
_A: db 11101110b
_F: db 10001110b
_Z: db 11011010b
_C: db 10011100B
_: db 00000001b

The 1st bit from the right, in other words, the LSB, corresponds to the point (DP) led on the seven segment display. So sending the value 00000001b to the displays will turn on the point. The MSB bit corresponds to the segment A, the next bit to B, the next one to C and so on up to G.

The main program

org 0000h
mov p1, #0ffh
mov p2, #00h

Port 1 is set to turn off all the displays, and Port 2 is cleared to configure it as output port.

startOver:mov dptr, #_H
acall display1
mov dptr, #_E
acall display2
mov dptr, #_L
acall display3
mov dptr, #_L
acall display4
mov dptr, #_O
acall display5
mov dptr, #_
acall display6
mov dptr, #_
acall display7
mov dptr, #_
acall display8
sjmp startOver

the command mov dptr, #_H loads the hex value of code from the lookup table. Since we have used 8 displays in multiplexed mode, the subroutine acall display1 send the data to 1st display and turns the display ON for some time and then turns it OFF. Similarly, acall display2 sends the data to 2nd display, turns it ON for some time and then turns it OFF. The rest of the commands similar to acall display* send the data to corresponding display, turns it ON for some time and then turns it OFF again.

Since this process is repeated at a very high rate, our eyes perceives them as if all the displays are turned ON simultainously.

acall routine:clr a
movc a, @a+dptr
mov p2, a
acall lessDelay                   ;CAN BE OMITTED
ret

display1:clr p1.7
acall routine
setb p1.7
ret

display2:clr p1.6
acall routine
setb p1.6
ret

display3:clr p1.5
acall routine
setb p1.5
ret

display4:clr p1.4
acall routine
setb p1.4
ret

display5:clr p1.3
acall routine
setb p1.3
ret

display6:clr p1.2
acall routine
setb p1.2
ret

display7:clr p1.1
acall routine
setb p1.1
ret

display8:clr p1.0
acall routine
setb p1.0
ret

Now the delay function is as follows. You can omit the delay part if you want

lessDelay:mov r0, #0fh
loop5:mov r1, #127
loop4:djnz r1, loop4
djnz r0, loop5
ret

Download the assembly language codes, .asm file as well as the Proteus file from here.

You can customize the code and workaround to have your content displayed.

Visit my github github icon page for more codes like this.

Intrested in creating a website for free ? Or setting up your own Blynk server for IoT ?

Care to share.😄

]]>
745
Android screen mirroring to Windows/Linux/Mac in just 2 mins using scrcpy https://fazals.ddns.net/scrcpy-android-screen-mirroring/ Tue, 28 Apr 2020 17:06:10 +0000 https://fazals.ddns.net/?p=816 Android screen mirroring to Windows/Linux/Mac in just 2 mins using scrcpy Read More »

]]>
Android screen mirroring is not as popular as other android customization like rooting. It’s namely because many people are just unaware of it, or it’s just they don’t want to face the hassel in doing so. Windows 10’s new android screen mirroring only works with a few phones. But there are other better alternatives to do this. If you ever wanted to control android phone from pc via wifi ? Read till the end and learn how to install and use scrcpy.

The best working choices you have.

  1. Scrcpy
  2. Vysor

Firstly, Vysor is an amazing app to mirror android screens to PC’s but most of the features are restricted to the paid version of the app. It costs $2.50 per month, $10 an year, or $40 for lifetime.

however, on the other hand, the best way to do it, is by using Scrcpy.
Scrcpy’s latest version is loaded with mesmerizing features and is the most simplest to use. It is an application that provides solution to display, as well as control your Android devices connected over USB ot TCP/IP. In short, wirelessly. It works just prefectly with Linux, Windows and macOS. And most importantly, it’s free and Open-Source.

The project scrcpy focuses on the following

  • lightness
  • Performance (30~60 fps on both USB and over TCP/IP)
  • Quality (1080p and even 4K)
  • Very low latency (35~70ms)

Features of scrcpy

  • Mirror and Control Android
  • High Quality
  • Full Screen
  • Wireless
  • Drag and drop file transfer
  • Customizable frame rate, resolution and bitrate.

Install scrcpy for screen mirroring

Firstly, you need to enable Developer Options on your phone.

Time Required: 5 minutes

  • Navigate to Settings > About Phone

  • Tap on the Build number until you get “No need, you are already a developer”.

  • Go back to Settings and navigate to System.

  • Click on Advanced and then on Developer Options.

  • Scroll down and enable USB debugging.

Connect your phone to your PC. And that’s all you have to do on your phone.

Get the app

Linux

On Debian and Ubuntu 20.04

sudo apt install scrcpy

A snap package is also available (For Ubuntu version < 20.04)

sudo snap install scrcpy

Windows

Download the zip archive with all the dependencies.
scrcpy-win64-v1.12.1.zip

macOS

The application for macOS is available in Homebrew. Just run to install it.

brew install scrcpy

Time to Run

Plug in your Android device in one of the USB ports and execute in terminal / CMD.

scrcpy

And thats it. You should see your Android’s screen on your PC. For further documentation, visit the github page.

FAQs

What does scrcpy stand for ?

Scrcpy can split into 2 parts. The first one as scr which means screen and cpy stands for copy.

Can scrcpy be used wirelessly ?

In simple terms, the answer is yes. Connect your android to the same network as your laptop/PC and then connect it wirelessly using the command adb connect ip_address:port command. And then run scrcpy

No audio when using scrcpy ?

Unfortunately, scrcpy doesn’t support audio transmission natively, but is possible in linux using an alternate method. Visit the official documentation for more information on audio transmission.

How do you set the resolution in scrcpy ?

The answer to that is very simple. Just append the parameter -m followed by the resolution, for example scrcpy -m720, it will automatically adjust the maximum resolution of the longer side to 720p.

Can scrcpy be used to capture Netflix ?

Yes, scrcpy can be used to capture netflix, but you need to record the audio separately as it is not natively supported by scrcpy

Feature Usage Shortcuts

ActionShortcut
Switch fullscreen modeCtrl/Cmd+f
Click on HOMECtrl/Cmd+h | Middle-click
Click on BACKCtrl/Cmd+b | Right-click
Click on APP_SWITCHCtrl/Cmd+s
Click on MENUCtrl/Cmd+m
Click on VOLUME_UPCtrl/Cmd+ (up)
Click on VOLUME_DOWNCtrl/Cmd+ (down)
Click on POWERCtrl/Cmd+p
Power onRight-click
Turn device screen off (keep mirroring)Ctrl/Cmd+o
Rotate device screenCtrl/Cmd+r
Expand notification panelCtrl/Cmd+n
Collapse notification panelCtrl/Cmd+Shift+n
Copy device clipboard to computerCtrl/Cmd+c
Paste computer clipboard to deviceCtrl/Cmd+v
Copy computer clipboard to deviceCtrl/Cmd+Shift+v
Enable/disable FPS counter (on stdout)Ctrl/Cmd+i

Intrested in reading about Google Cloud and Services it offers ?

Learn how to setup a custom blynk server and start your IOT projects.

]]>
816
What is cloud ? | Google Cloud Platform in 10 mins. https://fazals.ddns.net/what-is-cloud/ Sun, 26 Apr 2020 08:12:28 +0000 https://fazals.ddns.net/?p=790 What is cloud ? | Google Cloud Platform in 10 mins. Read More »

]]>
So the first question I’m going to answer is what is cloud? So before I answer that question specifically, let’s cover a little bit of history.

The history behind cloud

I’m going to go through three different stages of how companies and people use computers. And then we’re going get into what cloud actually is.

So first of all, we’re gonna look into the world as we used to know it.Whice is, when companies were in the on premise world, so basically this is back in the day.

let’s say I’m a startup and I’m spinning up the newest social media website, let’s call it like facenotebook.com or something like that. And I have five users at that point. I have one server sitting in my closet and I have one person just managing that server. Everything’s fine because I only have five users.
The next day though, word spreads and I have a thousand users, and then my website keeps crashing, why is that happening ? Does anyone know the answer?

It’s because I only have one server and, one server is not capable of handling that heavy traffic. So I have to do something called as scaling. And nowadays if we think about scaling, that’s another buzz word that startups love to use. But back in the days scaling was this. I had to go to a store, buy a brand new computer, put it on top of the other computer in my closet. Download code on that, do a bunch of other stuff to add it to my network. And then it could handle a thousand users and that took almost an entire day. That was a huge headache.

And so, this was just that’s basically one of the things that led to cloud.

What’s time sharing?

But the pain point is what led to the thing called time sharing. So we have startups that have these computers. But the other side of the aisle, we have these huge companies think like IBM, Google, and they have a lot of money they can buy gigantic sets of computers. They don’t need to guess and say,

“okay, we have a thousand users today, and what if I have a million tomorrow and then we are going to buy that many computers to basically manage that traffic.”

IBM and Google, they could just go out and buy a million computers, right? But what if they over-budget and now they have like 200 computers that are not being used. And then one smart person says

“hey let’s rent these out. Let’s allow other companies like these startups to rent out these computers for certain amounts of time. So that then it’s cheaper for them and we’re making passive income.”

And so that’s how we got to the idea called time sharing.

The emergence of “the cloud”

And then this got more and more popular and it just became mainstream. It became very normal for smaller startups companies to go to large companies and rent out their computers for a certain amount of time.

And then, after a while these bigger companies said,

“oh! What if we can make more money off of this time sharing thing? What if we provided additional services on top of this infrastructure that we’re renting out?”

And these additional services, or the suite of services that was created then is what’s called as cloud.

So cloud is often broken up into three different umbrellas or categories of tools. And the first set of tools is what’s known as infrastructure as a service. Infrastructure as a service is timesharing. That is if you have a computer and you are not using it all the time. So you sell it for a certain amount of time to other companies.

You have storage discs. You sell it, that’s infrastructure. It’s literally the hardware that you can touch and feel. So you are selling that. And then companies said –

“what if we can add additional tooling to this infrastructure? What if we just had a tool that could handle tens of millions of users?”

It’s basically infrastructure with some software involved – The second set of tools.

And then lastly is software as a service. This is basically the tools that you know. Like Google Docs ,Drive, Slides and Sheets.

In conclusion cloud is a set of tools that helps developers spend less time managing and spend more time creating.

And so now what is GCP? and the services it offers

GCP or the Google Cloud Platform is obviously a cloud tool but it’s many things altogether. Before we get into the specifics of GCP, lets discuss Google Cloud as a whole.

GCP vs G Suite

Google Cloud is the mixture of both GCP and G Suite. GCP in a basic sense is the infrastructure and platform where you can run codes, store data things like that. And then G Suite as you all probably know is things like Google Docs, Google Drive, that is the software as a service. G Suite also has a ton of APIs that you can use to enhance the GCP user experience.

So, on GCP you can do a lot of things. First of all, you can run a virtual machine and you can literally run a giant script that’ll take a week. Instead of running it on your own computer and worrying about the battery dying, and this and that. You can just put it on a virtual machine in the cloud. Or, you can deploy a web application and have the code run on cloud.

Services

You can store data on the SQL databases and the NoSQL databases. There are tools for networking, and monitoring. So let’s say you have all these tools in your cloud and you want to monitor how they’re working. For instance, if one thing crashes, you can see why that happened.

There are tools like IoT. Core that can help you build internet of things projects. There are tools to build your own API, its called Apairy. There are some open source tools like TensorFlow. It’s a machine learning platform, totally open source, many other software companies and developers use it as well.

Learn more on how to use google cloud platform. Learn how to setup your own Blynk server.

]]>
790 12.3325477 76.6807412 12.3325477 76.6807412
Create & setup your own Blynk server in 5 mins https://fazals.ddns.net/blynk-server-setup/ https://fazals.ddns.net/blynk-server-setup/#comments Thu, 23 Apr 2020 04:30:00 +0000 https://fazals.ddns.net/?p=698 Create & setup your own Blynk server in 5 mins Read More »

]]>
What is Blynk?

Blynk is an IOT platform which helps you to integrate and control various devices remotely with a mobile application. Not just that, it also supports REST Api, meaning that you can create your own mobile and desktop application using literally any programming language. You can use it to control various edge devices including your Raspberry Pis, Arduino Boards, and many more using internet. In other words, it helps you to quickly build interfaces for controlling and monitoring your hardware using your Android and iOS devices.

All you need to do is download the app from play store or the app store depending on your device. Subsequently create a project dashboard, and add buttons, sliders and other UI elements on to the dashboard and start building your hardware. Also, download the app, click on the links below.

Besides want to jump to Blynk Server Installation?

Get it for Android

Get it for iOS

Once the app is downloaded, you need to start building your hardware. Besides you can go to the Blynk documentation to learn more on how to setup your device. Its simple and easy to use. However, there are limitations on using the default Blynk Server. You are allowd to add limited number of wigets to your project. But, you can over come this by using a private server.

List of supported devices are given below.

Want to setup your own Blynk Server?

You can also setup your own Blynk server you your Windows, Linux or even Mac. Moreover to be able to run the server there are certain minimum software requirements.

Requirements

  • Java 8/11 required (OpenJDK, Oracle)
  • Any OS that can run java (Windows, Linux or Mac)
  • At least 30 MB of RAM (could be less with tuning)
  • Open ports 9443 (for app and hardware with ssl), 8080 (for hardware without ssl)

Select your Operating System
1. Windows
2. Linux

In addition, want to learn to create your own website for free? Click here.
Also, tired of ads on YouTube and other webpages? learn how to remove them here.

How to install Blynk Server on Windows ?

For Windows download Java from here and install.
Get the latest server builds from here.

Unlike linux, just double click the .jar file downloaded, and you should be good to go. No windows or pop-up will open. The server will execute in the background. As a result, you should see two folders appear in the directory where your .jar file is executed from, namely logs and static.

How to install Blynk Server on Unix Systems (Linux)?

Install Java on linux (Ubuntu)

sudo add-apt-repository ppa:openjdk-r/ppa 
sudo apt-get update
sudo apt install openjdk-11-jdk -y

Install Java on Raspberry Pi

sudo apt install openjdk-8-jdk openjdk-8-jre

Check your Java installation

java -version
Output: java version "1.8"

Download the server jar file

wget "https://github.com/blynkkk/blynk-server/releases/download/v0.41.12/server-0.41.12-java8.jar"

Run the server on default ports

java -jar server-0.41.12-java8.jar -dataFolder /home/pi/Blynk

How to setup your Blynk App?

Do absolutely no changes in the server configuration if using the default Blynk server. On the other hand, if you are using a private server, do the following.

To use your own server in your blynk app.
1. Open the blynk app and click on Create New Account.
2. Click on the small icon just above the Sign Up button.
3. Choose CUSTOM on the Server Settings.
4. In the place of Host address enter the IP address of your server. Do not change the port number from 9443.
5. And then click on OK.
6. Enter your Email and Password to Sign Up only for the first time.
Then on, you just need to Log In and not Sign Up. All of your settings will be saved online on the server.

Don’t have a private server but want more energy? in the step 4 above, replace the IP address with fazals.ddns.net.

Now connect your hardware and start blynking🤘.

Just make sure, when you are coding your hardware, you have to change the server preferences to connect to your new private server. To do so, replace the following line of code.

 Blynk.begin(auth, ssid, pass);

with

Blynk.begin(auth, ssid, pass, IPAddress(192,168,1,100), 8080);

To connect to the server hosted on this website use the following.

Blynk.begin(auth, ssid, pass, "fazals.ddns.net", 8080);

In this case ssid is your WiFi Name and pass is your WiFi Password.

Thats it! 😎 Care to share? If you face any kind of error, do visit the official documentation here.

]]>
https://fazals.ddns.net/blynk-server-setup/feed/ 1 698
Generate a square wave using 8051 in Proteus https://fazals.ddns.net/generate-a-square-wave-using-8051/ Mon, 20 Apr 2020 08:42:55 +0000 https://fazals.ddns.net/?p=611 Generate a square wave using 8051 in Proteus Read More »

]]>
In order to generate a square wave using 8051 or in otherwords the AT89C51, we will be using proteus. Its a software used to simulate the project. We will also need a DAC, a Digital to Analog Converter in short, and the AT89C51 microcontroller itself.

The DAC we will be using is a simple DAC0808. Its a 16 pin DIP package and easy to use.

The 8051 has two timers which can be configured in 3 modes. We will not be using the timers for the delay but instead the software delays to produce an approxiamate delay.

Steps to generate a square wave using 8051

  1. Set the output of any port on the 8051 to logic high.
  2. Wait for some time.
  3. Set the output of the same port to logic low.
  4. Again wait for the same amount of time as you did earlier.
  5. Loop around the same.

Subsequently, for obtaining the desired frequency on the square wave. We have to manipulate with the delay. We know that the machine cycle frequency is 1/12 of the crystal oscillator frequency. So, with the crystal oscillator’s frequency as 11.0592 Mhz the machine cycle frequency is 921.6 Khz. To sum up, thats equivalent to 1.085 μsecond.

To generate a square wave of 1 KHz, in other words, a wave of time period 1 millisecond, we have to use the delay in such a way that it causes a delay of 1 millisecond. We will have to loop around doing nothing for about 461 machine cyclesto generate a square wave of 50% duty cycle. That is to say, an on time and an off time of 0.5 millisecond.

Now, since we know the logic behind the generation of square wave, we can work on the hardware.

The Hardware

One of the major mistake people do is to write the code first and then build the hardware. Thats ok when you are simulating or building a mini project. But in the long run, when you are working on big projects, starting on with the hardware is the best way to do it.

So, lets build the hardware. The components that we are using are as follows

  1. The AT89C51 μcontroller.
  2. DAC0808.
  3. Resistors.
  4. Capacitors.
  5. An opamp – the DAC0808 output is known current. The opamp is to convert it to known voltage.
  6. CRO to visualize the wave.

The Placements and Connections

Firstly, place the μcontroller and the DAC0808 IC from the libraries in Proteus workspace. Connect the reset pin to the power source (Vcc). We will be connecting the DAC0808’s data pins to the port 1 of the μcontroller. Make sure you are connecting the MSB bit to the A1 pin (pin number 5) on DAC0808 and the LSB pin to the A8 pin (pin 12 physically). To avoid any confusions, follow the schematic below.

The code to generate a square wave using 8051

Lets start off with the line. Since we need the wave to start from logic 0, we pass on the data 00h to port 1.

org 0000h
mov a, #00h
mov p1, a

Next, we need to add some delay so that we get a constant high DC voltage – logic high. We do it by defining a function or sub-routine called as delay.

acall delay
delay:          mov r1, #0ffh
loop2:          mov r0, #0ah
loop:           djnz r0, loop
                djnz r1, loop2
                ret

Then we need to send logic high to the DAC connected to port 1, and then call the delay sub-routine again.

mov a, #0ffh
mov p1, a
acall delay

Now that we have created the first wave. We need to loop the program so that it keeps on running as long as the μcontroller is on. So we loop it by using the SJMP command.

sjmp startOver

and also add a lebel at the beginning of the code. So, replace

mov a, #00h

with

startOver:mov a, #00h

or any other label name you used.

Need the complete code file..? Get it from my GitHub repo here.

Compilation

Further, we need to compile the code written. I for instance prefer compiling in Keil μVision because i am more familiar with it, you can use any other compiler. Make sure your option to generate hex file is enabled, as shown below.

Subsequently, open your Proteus File and double Click the μcontroller, you should see a pop-up window asking you to select the debug file. You should select the hex file, it is usually placed in the Objects folder in your keil project folder.

To sum up, you have just learnt how to generate a square wave using 8051 μcontroller. And also simulated it in proteus. Well, congratulation on that. So if you have any doubts, drop them in the comments section.

Care to Share? Check out my other posts here.

]]>
611
How to install linux on Windows 10 https://fazals.ddns.net/linux-on-windows/ Thu, 16 Apr 2020 19:00:53 +0000 https://fazals.ddns.net/?p=499 How to install linux on Windows 10 Read More »

]]>
To install linux on windows 10, you need to make sure that “Windows Sub-System for Linux is enabled” to do so.

But before you begin installation, remember this method will only work for Windows 10. Windows 8.1 and earlier need to use linux as a Virtual Machine (VM) and not as a Sub-system.

Open Windows PowerShell as Administrator and run.

Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Windows-Subsystem-Linux

If this doesn’t work for you, follow the listed steps below.

Install Linux on Windows 10

Time Required 1 minute

  1. Go to Start and search for Control Panel

  2. Click on Programs

  3. Then click on Turn Windows features on or off.

  4. And then enable Windows Subsystem for Linux

After that, restarting your system will completes the basic setup.

Install the linux Distribution of your choice

You can download and install any linux distro available on the store. A list of those has been provided. Choose one…

The will take you to the Windows Store where you’ll be able to install it in just a click.

After the download is done. Click on the installed application in the Start menu to set it up and start using.

Want to learn how to create a website? And that too without HTML? Check out my post on How to create a Website.

]]>
499
Create website for free without coding https://fazals.ddns.net/create-website-for-free/ https://fazals.ddns.net/create-website-for-free/#comments Tue, 14 Apr 2020 12:48:13 +0000 https://fazals.ddns.net/?p=409 Create website for free without coding Read More »

]]>
Ever wanted to create website for free? Has creating your website for free always been so tough and confusing thing to you? Or has it been too expensive to hire a web designer to maintain your website? All of your problem regarding creating your website for free can be solved, just follow along and you should be good to go.

At the end of this article, you should be able to get your website up and running on your local machine, something people call self hosted websites. 

You can also set up a website on a web host for free, but has certain limitations as its free.

Firstly, trust me you need not know HTML, PHP, Javascripts to create a website.

But, I do encourage you to learn html from W3School. If you don’t have a Linux system for this tutorial, you can Install Linux on Windows to get started.We will be creating the website using an open source content management system called Wordpress.

There are a few requirements to start off with a self hosted website.

A linux Operating System

A computer running any linux operating system would work. Ubuntu, Fedora, Cent OS, Debian, even a SBC like a Raspberry PI would work, all you need is the root access to the terminal, and basic knowlege on a few most used linux commands.

Apache HTTP Server

Above all in the bucket list, will be installation of the apache2 server on your linux machine.

But, before running any command in any linux machine its recomended to run the apt update and the apt upgrade commands, just to ensure everything is up to date.

MySQL

MySQL is an OPEN SOURCE database management system. SQL stands for Structured Query Language.

The Installation

Copy paste the commands below in the terminal and you would be good to go.

sudo apt update && sudo apt upgrade -y

This update command updates all the apt package list that contains all the packages, and the upgrade command upgrades the packages.

Next command will install the latest version of Apache httpd server on your linux machine. the “d” in the httpd stands for daemon, meaning that it runs in the background. And thus it has no GUI.

sudo apt install apache2 -y

Next command is used to install all other dependencies for running the website.

sudo apt install php php-mysql mysql-server -y

And if you are doing it in a Raspberry PI, the package mysql-server is discontinued. Hence run the following command.

sudo apt install php php-mysql mariadb-server -y #Only for Raspberry Pi 

At this point all of your dependencies are successfully installed. Next this in to get the wordpress files into the webserver directory.

Change your current working directory to webserver directory, and delete everything inside it.

cd /var/www/html/
sudo rm -r *

The result of the code can be seen by typing

ls

As a result, you will be able to see that the directory is empty.

Download the compressed WordPress file and extract it. A new folder named wordpress will be created. We need to transfer the content of the foldel to the main directory, that is to webserver directory.

sudo wget http://wordpress.org/latest.tar.gz
tar xzf latest.tar.gz
sudo mv wordpress/* .
sudo rm -r wordpress latest.tar.gz

Now that the wordpress part is done. We need to create a MySQL database for wordpress to access and save information. But before that we need to make our MySQL installation secure.

Securing MySQL installation

sudo mysql_secure_installation
  • You will be asked Enter current password for root (enter for none): — press Enter. (Because the default password is blank)
  • Type in Y and press Enter to Set root password?.
  • Type in a password at the New password: prompt, and press Enter
    Important: remember this root password, as you will need it later to set up WordPress.
  • Remove anonymous users?Press Y and click Enter.
  • Type in Y to Disallow root login remotely.
  • Type in Y to Remove test database and access to it.
  • For Reload privilege tables now do the same. Y and Enter.

When complete, you will be able see the message All done! and Thanks for using MariaDB!.

Create a WordPress Database

sudo mysql -uroot -p

Enter the root password you created earlier.

at the MariaDB [(none)]> prompt

create database wordpress;

You must get an output response as :

Query OK, 1 row affected (0.00 sec)
GRANT ALL PRIVILEGES ON wordpress.* TO 'root'@'localhost' IDENTIFIED BY 'YOURPASSWORD';
FLUSH PRIVILEGES;

This completes your database setup. All you need to do now is to configure wordpress to access the database.

If you have installed the LAMP Stack in your own computer and not any other device, got to http://localhost else you need to type the IP Address of the computer in your URL / Address Bar.

You should be able to see a page like this on your web browser.

Configuring WordPress

Select your language and press Continue

You will be presented with a welcome screen, one like this.

Click on Let’s go! as a result a new page will open up. Now fill out the basic information in that page as follows:

Database namewordpress
Database usernameroot
Database password{password you created}
Database hostlocalhost
Table prefixwp_

Click on Submit and then Run Installation

Fill out the information: Site title, username, password, e-mail ID and hit Install WordPress

Congrats you are up with your own self hosted WordPress website. Go on, explore it.

Conclusion

WordPress is very customisable. Clicking on the site name in the WordPress banner at the top of the page after logging in will take you to the Dashboard. From there, from there you can change themes, you can add and modify pages, posts, edit menus, play around with plugins and much much more.

Well you just created a free website. Did you use any code? Tell us about your experience in the comment section.

You can also host a website on a web host for free and not on your computer. That’s even more simpler.

Hit the Like button if you found the tutorial to be useful to you. and Share it. 😋 😎

]]>
https://fazals.ddns.net/create-website-for-free/feed/ 1 409
Want to Access Blocked Websites ? here’s how… https://fazals.ddns.net/want-to-access-blocked-websites-heres-how/ Thu, 09 Apr 2020 05:49:03 +0000 http://34.67.2.195/?p=280 Want to Access Blocked Websites ? here’s how… Read More »

]]>
“Your requested URL has been blocked as per the directions received from Department of Telecommunications, Government of India.”

If you ever came accross the above page and lost all hopes of accessing that Website, firstly this post is for you guys.

Secondly, there are many ways to access these kinds of webpages. All you need is a tiny little bit of hack or a workaround. Luckily, there are many ways to do it. I’ll be listing down a few of them.

  • Proxies
  • VPN
  • IP Addresses

Proxy Servers

Proxies are a good way to access blocked websites. Proxy server is an application layer that acts as an intermediary for requests from your devices seeking resources from servers which provides the required resources – which are unfortunately blocked. In order to access a website using a proxy server, you need the website’s URL. Just copy it down and paste it in one of the proxy providers.

VPN

VPN or a Virtual Private Network is one among the most popular way to access any blocked website. People use it to ensure their privacy, to ensure that their ISP (Internet Service Provider) is not tracking them. Well, both the Paid as well as Free versions of VPN, both for PCs and Mobile devices. You can install an application on your phone to connect to the VPN service.

A few of the free VPN applications for Mobile devices is below.

Secure VPN logo

Secure VPN

Psiphon pro logo

Psiphon PRO

Meanwhile, after reading this, if you are able to access blocked websites, do drop your comment below.

Want to learn how to create a free website? Check out my post on how to create a self hosted website for free here.

]]>
280