<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>Forem: Budy mnvenom</title>
    <description>The latest articles on Forem by Budy mnvenom (@xbudy).</description>
    <link>https://forem.com/xbudy</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F601053%2F00172269-488e-461f-9535-37351d980de1.jpeg</url>
      <title>Forem: Budy mnvenom</title>
      <link>https://forem.com/xbudy</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/xbudy"/>
    <language>en</language>
    <item>
      <title>Firebase Send email verification using python</title>
      <dc:creator>Budy mnvenom</dc:creator>
      <pubDate>Mon, 11 Oct 2021 13:10:09 +0000</pubDate>
      <link>https://forem.com/xbudy/firebase-send-email-verification-using-python-32hp</link>
      <guid>https://forem.com/xbudy/firebase-send-email-verification-using-python-32hp</guid>
      <description>&lt;p&gt;CHECK PREVIOUS TUTORIAL AND EXPLANATION   &lt;a href="https://blog.icodes.tech/posts/python-firebase-authentication.html" rel="noopener noreferrer"&gt;Python and firebase auth&lt;/a&gt; &lt;br&gt;
 Now to send an email verification using python. You need to send a POST request to&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;https://identitytoolkit.googleapis.com/v1/accounts:sendOobCode
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You need also the token that you get after ** &lt;a href="https://blog.icodes.tech/posts/python-firebase-authentication.html" rel="noopener noreferrer"&gt;sign in &lt;/a&gt; *&lt;em&gt;or *&lt;/em&gt; &lt;a href="https://blog.icodes.tech/posts/python-firebase-authentication.html" rel="noopener noreferrer"&gt;sign up&lt;/a&gt; **.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import requests

apikey='..................'# the web api key

idToken='eyJh1pVjuYvfX72ewSqUxRNUNoGKgdhsaYdeOjs9OsQ......'#token

def VerifyEmail(idToken):
    headers = {
        'Content-Type': 'application/json',
    }
    data='{"requestType":"VERIFY_EMAIL","idToken":"'+idToken+'"}'
    r = requests.post('https://identitytoolkit.googleapis.com/v1/accounts:sendOobCode?key={}'.format(apikey), headers=headers, data=data)
    if 'error' in r.json().keys():
        return {'status':'error','message':r.json()['error']['message']}
    if 'email' in r.json().keys():
        return {'status':'success','email':r.json()['email']}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  run :
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;VerifyEmail(idToken)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  result:
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Success&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;{'status': 'success', 'email': 'user@example.com'}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The user will receive an email from you like this :&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn.hashnode.com%2Fres%2Fhashnode%2Fimage%2Fupload%2Fv1633957554996%2FRkvLp61ga.jpeg" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn.hashnode.com%2Fres%2Fhashnode%2Fimage%2Fupload%2Fv1633957554996%2FRkvLp61ga.jpeg" alt="imageedit_4_5081572962.jpg"&gt;&lt;/a&gt;&lt;br&gt;
*&lt;em&gt;Failed *&lt;/em&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;{'status': 'error', 'message': 'INVALID_ID_TOKEN'}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



</description>
      <category>python</category>
      <category>programming</category>
      <category>firebase</category>
    </item>
    <item>
      <title>Python binary search</title>
      <dc:creator>Budy mnvenom</dc:creator>
      <pubDate>Wed, 29 Sep 2021 14:19:51 +0000</pubDate>
      <link>https://forem.com/xbudy/python-binary-search-19pf</link>
      <guid>https://forem.com/xbudy/python-binary-search-19pf</guid>
      <description>&lt;p&gt;Source &lt;a href="https://blog.icodes.tech/posts/Python-Binary-search.html"&gt;Python Binary search explained with examples&lt;/a&gt; &lt;/p&gt;

&lt;h2&gt;
  
  
  Binary search algorithm
&lt;/h2&gt;

&lt;p&gt;a binary search does something very similar. So it relies on having a sorted list so you have this list. Let's say it's 1024 items long. And what you do with binary search is you go to the middle item of this sorted list and if that's the item you're looking for then that's it.The search is over.&lt;/p&gt;

&lt;p&gt;if the item is not the item you're looking for but is higher than it in numerical value or in the latter value depending what it is that you're searching for. Then you can say well the item that I'm looking for must be in the left part of the list because I know these are in the correct order they're sorted.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--wxWyr9BX--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_880/https://cdn.hashnode.com/res/hashnode/image/upload/v1632925042968/VRkJ91qok.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--wxWyr9BX--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_880/https://cdn.hashnode.com/res/hashnode/image/upload/v1632925042968/VRkJ91qok.gif" alt="ezgif-7-e1fca7ee4861.gif"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;So if I've landed on the midpoint of this list and I'm the item I land on is higher in value than the item I'm looking for.I can get rid of all of the items to the right of me to the to the right of the item that I've landed on because I know that they are also going to be too high. And then you repeat that process.&lt;br&gt;
Source &lt;a href="https://blog.icodes.tech/posts/Python-Binary-search.html"&gt;Python Binary search explained with examples&lt;/a&gt; &lt;/p&gt;

</description>
      <category>python</category>
      <category>algorithms</category>
    </item>
    <item>
      <title>python and firebase auth Sign in anonymously</title>
      <dc:creator>Budy mnvenom</dc:creator>
      <pubDate>Mon, 27 Sep 2021 23:39:06 +0000</pubDate>
      <link>https://forem.com/xbudy/python-and-firebase-auth-sign-in-anonymously-5gf9</link>
      <guid>https://forem.com/xbudy/python-and-firebase-auth-sign-in-anonymously-5gf9</guid>
      <description>&lt;p&gt;Visit &lt;a href="https://blog.icodes.tech/python-firebase-authentication.html"&gt;Python firebase authentication Definitive guide (2021)&lt;/a&gt; for more&lt;/p&gt;

&lt;h3&gt;
  
  
  Sign in anonymously
&lt;/h3&gt;

&lt;p&gt;Sometimes you need to use user's features without creating an account. So you can do it on firebase  just by sending another &lt;strong&gt;POST&lt;/strong&gt; request to :&lt;/p&gt;

&lt;p&gt;&lt;a href="https://identitytoolkit.googleapis.com/v1/accounts:signUp"&gt;https://identitytoolkit.googleapis.com/v1/accounts:signUp&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;But You have to enable it first&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--ql7_DvWN--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://1.bp.blogspot.com/-6HoJsHJ_EBk/YTYizJfJ-iI/AAAAAAAAAaA/TO7Dg6yPDlgxbz5RNk9MaoEyMH6NhV6nQCLcBGAsYHQ/s987/imageedit_9_6641761152.webp" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--ql7_DvWN--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://1.bp.blogspot.com/-6HoJsHJ_EBk/YTYizJfJ-iI/AAAAAAAAAaA/TO7Dg6yPDlgxbz5RNk9MaoEyMH6NhV6nQCLcBGAsYHQ/s987/imageedit_9_6641761152.webp" alt="python firebase enable sign in anonymously"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Code :&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import requests

apikey='...................'# the web api key

def SignInAnonymously():
    headers = {
        'Content-Type': 'application/json',
    }
    data='{"returnSecureToken":"true"}'
    r = requests.post('https://identitytoolkit.googleapis.com/v1/accounts:signUp?key={}'.format(apikey), headers=headers, data=data)
    if 'error' in r.json().keys():
        return {'status':'error','message':r.json()['error']['message']}
    if 'idToken' in r.json().keys():
        return {'status':'success','idToken':r.json()['idToken']}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;Output :&lt;/p&gt;

&lt;p&gt;{'status': 'success',&lt;br&gt;
 'idToken': 'eyJhbGciOiJSUzI1NiIsImtpZCI6IjkwMDk1YmM2ZGM2ZDY3NzkxZDdkYTFlZWIxYTU1OWEzZDViMmM0'}&lt;/p&gt;

&lt;p&gt;Read more &lt;a href="https://blog.icodes.tech/python-firebase-authentication.html"&gt;Python firebase authentication Definitive guide (2021)&lt;/a&gt;&lt;/p&gt;

</description>
      <category>python</category>
      <category>firebase</category>
      <category>database</category>
    </item>
    <item>
      <title>Use python on mobile (Android/IOS) Full guide</title>
      <dc:creator>Budy mnvenom</dc:creator>
      <pubDate>Tue, 14 Sep 2021 13:30:43 +0000</pubDate>
      <link>https://forem.com/xbudy/use-python-on-mobile-android-ios-full-guide-2mgi</link>
      <guid>https://forem.com/xbudy/use-python-on-mobile-android-ios-full-guide-2mgi</guid>
      <description>&lt;p&gt;A lot of people want to learn python programming until they found all courses online made with laptops and desktops. so, they get disappointed and lose interest in learning. Today, I decided to help you with this problem and show you how you can  run python on mobile phone.&lt;/p&gt;

&lt;h2&gt;
  
  
  Using Mobile Apps IDE
&lt;/h2&gt;

&lt;p&gt;The first way is using mobile applications ( python mobile IDE ) to run python codes on.&lt;/p&gt;

&lt;h3&gt;
  
  
  Mobile applications IDE
&lt;/h3&gt;

&lt;p&gt;The first way is using mobile applications ( python mobile IDE ) to run python codes on.&lt;br&gt;
 &lt;a href="https://blog.icodes.tech/2021/08/25/learn-python-programming-on-mobile-phone.html"&gt;List of Python ide on mobile (android/ios)&lt;/a&gt; &lt;/p&gt;

&lt;h2&gt;
  
  
  Using online ide on browser
&lt;/h2&gt;

&lt;p&gt;Personally i use online python IDE's a lot because it has fast internet access and you can store your code online.Here's a &lt;a href="https://blog.icodes.tech/2021/08/25/learn-python-programming-on-mobile-phone.html"&gt;list of my favorites python websites ide&lt;/a&gt; &lt;/p&gt;

</description>
      <category>python</category>
      <category>android</category>
      <category>ios</category>
    </item>
    <item>
      <title>Python Firebase auth (Sign up with email / password)</title>
      <dc:creator>Budy mnvenom</dc:creator>
      <pubDate>Mon, 13 Sep 2021 16:44:21 +0000</pubDate>
      <link>https://forem.com/xbudy/python-firebase-auth-sign-up-with-email-password-4h06</link>
      <guid>https://forem.com/xbudy/python-firebase-auth-sign-up-with-email-password-4h06</guid>
      <description>&lt;p&gt;&lt;strong&gt;Check  &lt;a href="https://blog.icodes.tech/posts/python-firebase-authentication.html"&gt;Python firebase authentication Definitive guide (2021)&lt;/a&gt;  for the full tutorial.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;To create a new user account on firebase Auth using python you need to send a POST request to this URL&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;https://identitytoolkit.googleapis.com/v1/accounts:signUp
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;then if the registration succeeded we will get a token to use it later.&lt;/p&gt;

&lt;p&gt;Don't panic it's all easy&lt;/p&gt;

&lt;p&gt;This is how you do it in python using requests module.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import requests

apikey='.....................'# the web api key

def NewUser(email,password):
    details={
        'email':email,
        'password':password,
        'returnSecureToken': True
    }
    # send post request
    r=requests.post('https://identitytoolkit.googleapis.com/v1/accounts:signUp?key={}'.format(apikey),data=details)
    #check for errors in result
    if 'error' in r.json().keys():
        return {'status':'error','message':r.json()['error']['message']}
    #if the registration succeeded
    if 'idToken' in r.json().keys() :
            return {'status':'success','idToken':r.json()['idToken']}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now this is simple all you have to do is call the function like this :&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;NewUser('anemail@email.com','password')# use the email and the password

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Output:&lt;/p&gt;

&lt;p&gt;You will get something like this if everything is okay  :&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;{'status': 'success',
 'idToken': 'eyJhbGciOiJSUzI1NiIsImtpZCI6IjkwMDk1YmM2ZGM2ZDY3NzkxZDdkYTFlZWIxYTU1OWEzZDViMmM0ODYiLCJ0eXAiOiJKV1QifQ.eyJpc3MiOiJodHRwczovL3NlY3VyZXRva2VuLmdvb2dsZS5jb20vaGFja2Vybm9vbi1hcHAiLCJhdWQiOiJoYWNrZXJub29uLWFwcCIsImF1dGhfdGltZSI6MTYzMDA4NTAwOSwidXNlcl9pZCI6Ilk0Q3luTHFVNVRRZGRSSE52MDRzWU54ZWFpdTIiL'}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;or&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;{'status': 'error', 'message': 'EMAIL_EXISTS'}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;it means that the email already registered.&lt;/p&gt;

&lt;p&gt;Read more &lt;a href="https://blog.icodes.tech/posts/python-firebase-authentication.html"&gt;Python firebase authentication Definitive guide (2021)&lt;/a&gt; &lt;/p&gt;

</description>
      <category>python</category>
      <category>firebase</category>
      <category>api</category>
    </item>
    <item>
      <title>Build role-based api Python and firebase authentication</title>
      <dc:creator>Budy mnvenom</dc:creator>
      <pubDate>Tue, 07 Sep 2021 14:36:13 +0000</pubDate>
      <link>https://forem.com/xbudy/build-role-based-api-python-and-firebase-authentication-cb0</link>
      <guid>https://forem.com/xbudy/build-role-based-api-python-and-firebase-authentication-cb0</guid>
      <description>&lt;p&gt;This is my complete guide to use &lt;strong&gt;python firebase Auth&lt;/strong&gt; in 2021. I used  &lt;strong&gt;Firebase Auth REST API &lt;/strong&gt; official documentation to build a simple and clean python codes (api) that allows you to  :&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;  Sign up with email / password.&lt;/li&gt;
&lt;li&gt;  Sign in with email / password.&lt;/li&gt;
&lt;li&gt;  Send email verification.&lt;/li&gt;
&lt;li&gt;  Sign in anonymously.&lt;/li&gt;
&lt;li&gt;  Send password reset email.&lt;/li&gt;
&lt;li&gt;  Get user data.&lt;/li&gt;
&lt;li&gt;  Delete account.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;After this article you will be able also to make your own api.&lt;/p&gt;

&lt;p&gt;So if you want use firebase authentication in one of your project, You will love today's article.&lt;/p&gt;

&lt;p&gt;Let's dive in.&lt;/p&gt;

&lt;h2&gt;
  
  
  What is firebase authentication
&lt;/h2&gt;

&lt;p&gt;Firebase Authentication provides back-end services, &lt;strong&gt;easy-to-use , and ready-made UI libraries to authenticate users to your app&lt;/strong&gt; . It supports authentication using passwords, phone numbers, popular federated identity providers like Google, Facebook and Twitter, and more.&lt;/p&gt;

&lt;p&gt;It is also &lt;strong&gt;free&lt;/strong&gt; !&lt;/p&gt;

&lt;h2&gt;
  
  
  Create Firebase Project
&lt;/h2&gt;

&lt;p&gt;To create a firebase project :&lt;br&gt;
&lt;a href="https://blog.icodes.tech/posts/python-firebase-authentication.html"&gt;Keep reading&lt;/a&gt;&lt;/p&gt;

</description>
      <category>python</category>
      <category>firebase</category>
    </item>
    <item>
      <title>Discover all ip address connected to your network (Network scanner)</title>
      <dc:creator>Budy mnvenom</dc:creator>
      <pubDate>Sun, 05 Sep 2021 08:54:48 +0000</pubDate>
      <link>https://forem.com/xbudy/discover-all-ip-address-connected-to-your-network-network-scanner-58cb</link>
      <guid>https://forem.com/xbudy/discover-all-ip-address-connected-to-your-network-network-scanner-58cb</guid>
      <description>&lt;h2&gt;
  
  
  Intro :
&lt;/h2&gt;

&lt;p&gt; Hello, today we are going to code a network scanner to scan our network and find the ip address connected we are going to use the ping command ... follow&lt;/p&gt;

&lt;p&gt;In my case i am using linux ..&lt;/p&gt;

&lt;p&gt;This script is going to show all connected devices on our network&lt;/p&gt;

&lt;h2&gt;
  
  
  Start coding :
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Setup the script file :
&lt;/h3&gt;

&lt;h4&gt;
  
  
  Create file :
&lt;/h4&gt;

&lt;p&gt;First you have to create a file with python extension (ends with .py)&lt;/p&gt;

&lt;p&gt;i will name it scan.py&lt;/p&gt;

&lt;h4&gt;
  
  
  Import required modules:
&lt;/h4&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import sh    
from subprocess import Popen, PIPE
import re
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;h3&gt;
  
  
  Function to get the Mac address of the ip :
&lt;/h3&gt;

&lt;p&gt;First, we are going to create a function to get the Mac address of the ip we have:&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;def getMac(ip):

    pid = Popen(["arp", "-n", ip], stdout=PIPE)
    s = pid.communicate()[0]
    a=re.search(r"(([a-f\d]{1,2}\:){5}[a-f\d]{1,2})", str(s))
    if a ==None:
        b=('this')
        return b
    else:
        mac = a.groups()[0]
        return mac
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;This function :&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt; Uses the command arp -n to get the information of the ip.&lt;/li&gt;
&lt;li&gt; Then it uses the regex to get the mac .&lt;/li&gt;
&lt;li&gt; The if statement is for checking if the ip is our ip&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;On &lt;strong&gt;Linux&lt;/strong&gt; operating systems, the &lt;strong&gt;arp command&lt;/strong&gt; manipulates or shows the kernel's IPv4 network neighbour cache. It can add entries to the table, delete one, or display the current content. &lt;strong&gt;ARP&lt;/strong&gt; stands for Address Resolution Protocol, which is used to find the address of a network neighbor for a given IPv4 address.&lt;/p&gt;

&lt;h3&gt;
  
  
  Generate some ip address:
&lt;/h3&gt;

&lt;p&gt;Now we are going to do a for loop to generate some ip address&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;for num in range(1,256):  
    ip = "192.168.1."+str(num)    
    try:  
        sh.ping(ip, "-c 1",_out="/dev/null")  
        mac=getMac(ip)
        print ("PING ",ip , "OK ",mac) 

    except sh.ErrorReturnCode_1:  
        #print ("PING ", ip, "FAILED") 
        pass 
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;This loop:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt; Generates an ip&lt;/li&gt;
&lt;li&gt; Then it runs the command ping to check if this ip is alive&lt;/li&gt;
&lt;li&gt; Then it gets the mac address&lt;/li&gt;
&lt;li&gt; After that it print the ip if everything is okay&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Ping is a computer network administration software utility used to test if an host is reachable on an Internet Protocol network.you can do it on all operating systems that have network access, including most embedded network administration software.&lt;/p&gt;

&lt;p&gt;NOTE : the ip variable i used can be different of yours first you have to check what types of ip address your router uses.&lt;/p&gt;

&lt;p&gt;To check what ip address your router uses you can simply run the command :&lt;/p&gt;

&lt;p&gt;ifconfig&lt;/p&gt;

&lt;p&gt;and you will see an output like that :&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;inet 192.168.1.6  netmask 255.255.255.0  broadcast 192.168.1.255
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;in my case you can see that my ip is 192.168.1.6 so all others ip will be start with 192.168.1. that's why i used 192.168.1.  to generate ip address.&lt;/p&gt;

&lt;h2&gt;
  
  
  Full code :
&lt;/h2&gt;


&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import sh&lt;br&gt;&lt;br&gt;
from subprocess import Popen, PIPE&lt;br&gt;
import re

&lt;p&gt;def getMac(ip):&lt;br&gt;
    pid = Popen(["arp", "-n", ip], stdout=PIPE)&lt;br&gt;
    s = pid.communicate()[0]&lt;br&gt;
    a=re.search(r"(([a-f\d]{1,2}:){5}[a-f\d]{1,2})", str(s))&lt;br&gt;
    if a ==None:&lt;br&gt;
        b=('this')&lt;br&gt;
        return b&lt;br&gt;
    else:&lt;br&gt;
        mac = a.groups()[0]&lt;br&gt;
        return mac&lt;/p&gt;

&lt;p&gt;for num in range(1,256):&lt;br&gt;&lt;br&gt;
    ip = "192.168.1."+str(num)&lt;br&gt;&lt;br&gt;
    try:&lt;br&gt;&lt;br&gt;
        sh.ping(ip, "-c 1",_out="/dev/null")&lt;br&gt;&lt;br&gt;
        mac=getMac(ip)&lt;br&gt;
        print ("PING ",ip , "OK ",mac) &lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;except sh.ErrorReturnCode_1:  
    #print ("PING ", ip, "FAILED") 
    pass 
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;h3&gt;
&lt;br&gt;
  &lt;br&gt;
  &lt;br&gt;
  Run the script :&lt;br&gt;
&lt;/h3&gt;

&lt;p&gt;open the folder contains the script on a terminal and run:&lt;/p&gt;

&lt;p&gt;python3 scan.py&lt;/p&gt;

&lt;h3&gt;
  
  
  OUTPUT :
&lt;/h3&gt;

&lt;p&gt;PING  192.168.1.1 OK  00:00:00:00:00&lt;br&gt;&lt;br&gt;
PING  192.168.1.2 OK  00:00:00:00:00&lt;br&gt;&lt;br&gt;
PING  192.168.1.5 OK  00:00:00:00:00&lt;br&gt;&lt;br&gt;
PING  192.168.1.10 OK  00:00:00:00:00&lt;br&gt;&lt;br&gt;
PING  192.168.1.14 OK  00:00:00:00:00&lt;/p&gt;

&lt;p&gt;You will see mac address instead of 00:00:00:00:00&lt;/p&gt;

&lt;p&gt;Don't forget to share this post..&lt;/p&gt;

&lt;p&gt;Happy coding ...&lt;/p&gt;

</description>
      <category>python</category>
      <category>security</category>
      <category>programming</category>
      <category>linux</category>
    </item>
    <item>
      <title>Automate boring files organizing using python (Python files organizer)</title>
      <dc:creator>Budy mnvenom</dc:creator>
      <pubDate>Mon, 30 Aug 2021 12:11:34 +0000</pubDate>
      <link>https://forem.com/xbudy/automate-boring-files-organizing-using-python-python-files-organizer-21f4</link>
      <guid>https://forem.com/xbudy/automate-boring-files-organizing-using-python-python-files-organizer-21f4</guid>
      <description>&lt;h2&gt;
  
  
  Intro
&lt;/h2&gt;

&lt;p&gt;Hello today we are going to code a files organizer using python script it will organize the files by their types for example it will put all files with extension (.png) in a folder called Pictures let's code ... (this post is published here &lt;a href="https://blog.icodes.tech/2021/06/12/python-files-organizer-automate-boring-files-organizing-using-python.html"&gt;Python files organizer, automate boring files organizing using python&lt;/a&gt;)&lt;/p&gt;

&lt;h2&gt;
  
  
  Coding
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Importing needed modules
&lt;/h3&gt;

&lt;p&gt;those are the modules we are going to use&lt;/p&gt;

&lt;p&gt;if you have any problem you can post it on comments&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import os
import pathlib
import shutil
import fnmatch
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;h3&gt;
  
  
  Preparing the default folder for every type of files
&lt;/h3&gt;

&lt;p&gt;So now we are going to set a folder for every type for example we want to move the pictures to the folder in path '/home/rin/Downloads/'&lt;/p&gt;

&lt;p&gt;in my case i am using linux on windows the paths will look like ' C:\rin\Brink\Pictures'&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;## define path for every category
file_folder={
    'Music':'/home/rin/Downloads/',
    'Pictures':'/home/rin/Pictures/',
    'Documents':'/home/rin/Documents/',
    'Archives':'/home/rin/Archives/',
    'Videos':'/home/rin/Videos/',
    'Codes':'/home/rin/Codes/'
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;h3&gt;
  
  
  Defining the type of file by the extension
&lt;/h3&gt;
&lt;h4&gt;
  
  
  What's extension ?
&lt;/h4&gt;

&lt;p&gt;A &lt;strong&gt;file extension&lt;/strong&gt; or &lt;strong&gt;file name extension&lt;/strong&gt; is the ending of a file that helps identify the type of file in operating systems, such as Microsoft Windows. In Microsoft Windows, the file name extension is a period that is often followed by three characters but may also be one, two, or four characters long.&lt;/p&gt;

&lt;p&gt;As an example, the file name "myfile.txt" has a file extension of ".txt," which is a file name extension associated with text files.&lt;/p&gt;

&lt;p&gt;So code :&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;## define the type of every extension
file_type={'Pictures':['.jpg', '.jpeg', '.jpe','.png','.jp2','.ico', '.wbmp','.j2k', '.jpf', '.jpx', '.jpm', '.mj2','.svg', '.svgz','.webp','.gif']
,'Music':['mp3']
,'Videos':['.mp4','.srt','.mkv','.3gp','.m4a']
,'Documents':['.pdf','.docx','.doc','.csv','.txt','.xls','.xlsx','.log']
,'Archives':['.zip','.tar']
,'Codes':['.py']}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;h3&gt;
  
  
  Main code
&lt;/h3&gt;

&lt;p&gt;Now we take the path of the folder contains the files we want organize as example for me i want clean my download folder &lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;path='/home/rin/Downloads/'
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;So now what we want to do is extracting all the files in the folder and check the type of every file then move it to the folder contains its type&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;files=os.listdir(path)# list of files in the folder
for file in files:#for for every file in the list
    extension=pathlib.Path(file).suffix #extension of file ex:(.txt)
    #Documents
    if extension in file_type['Documents']:#check if the file is a document
        move=pathlib.Path(path+file).rename(file_folder['Documents']+file)# move the file to the folder conatins documents
        #move=shutil.move(path+file,file_folder['Documents'])
        print('success #### {} to {}'.format(file,move))
    #Music    
    if extension in file_type['Music']:
        move=pathlib.Path(path+file).rename(file_folder['Music']+file)
        #move=shutil.move(path+file,file_folder['Music'])
        print('success #### {} to {}'.format(file,move))
    #Pictures
    if extension in file_type['Pictures']:
        move=pathlib.Path(path+file).rename(file_folder['Pictures']+file)
        #move=shutil.move(path+file,file_folder['Pictures'])
        print('success #### {} to {}'.format(file,move))
    #Videos
    if extension in file_type['Videos']:
        move=pathlib.Path(path+file).rename(file_folder['Videos']+file)
        #move=shutil.move(path+file,file_folder['Videos'])
        print('success #### {} to {}'.format(file,move))
    #Archives
    if extension in file_type['Archives']:
        move=pathlib.Path(path+file).rename(file_folder['Archives']+file)
        #move=shutil.move(path+file,file_folder['Archives'])
        print('success #### {} to {}'.format(file,move))
    #Codes
    if extension in file_type['Codes']:
        move=pathlib.Path(path+file).rename(file_folder['Codes']+file)
        #move=shutil.move(path+file,file_folder['Codes'])
        print('success #### {} to {}'.format(file,move))
    else:
        print('## '+file)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;&lt;strong&gt;Note : You can add more types&lt;/strong&gt; &lt;/p&gt;

&lt;h2&gt;
  
  
  Full source code 
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;DON'T FORGET TO CHANGE THE PATHS ALSO YOU CAN ADD MORE CATEGORY BE SMART ..&lt;/strong&gt;&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import os
import pathlib
import shutil
import fnmatch
## define path for every category
file_folder={
    'Music':'/home/rin/Downloads/',
    'Pictures':'/home/rin/Pictures/',
    'Documents':'/home/rin/Documents/',
    'Archives':'/home/rin/Archives/',
    'Videos':'/home/rin/Videos/',
    'Codes':'/home/rin/Codes/'
}
## define the type of every extension
file_type={'Pictures':['.jpg', '.jpeg', '.jpe','.png','.jp2','.ico', '.wbmp','.j2k', '.jpf', '.jpx', '.jpm', '.mj2','.svg', '.svgz','.webp','.gif']
,'Music':['mp3']
,'Videos':['.mp4','.srt','.mkv','.3gp','.m4a']
,'Documents':['.pdf','.docx','.doc','.csv','.txt','.xls','.xlsx','.log']
,'Archives':['.zip','.tar']
,'Codes':['.py']}

path='/home/rin/Downloads/'
files=os.listdir(path)# list of files in the folder
for file in files:#for for every file in the list
    extension=pathlib.Path(file).suffix #extension of file ex:(.txt)
    #Documents
    if extension in file_type['Documents']:#check if the file is a document
        move=pathlib.Path(path+file).rename(file_folder['Documents']+file)# move the file to the folder conatins documents
        #move=shutil.move(path+file,file_folder['Documents'])
        print('success #### {} to {}'.format(file,move))
    #Music    
    if extension in file_type['Music']:
        move=pathlib.Path(path+file).rename(file_folder['Music']+file)
        #move=shutil.move(path+file,file_folder['Music'])
        print('success #### {} to {}'.format(file,move))
    #Pictures
    if extension in file_type['Pictures']:
        move=pathlib.Path(path+file).rename(file_folder['Pictures']+file)
        #move=shutil.move(path+file,file_folder['Pictures'])
        print('success #### {} to {}'.format(file,move))
    #Videos
    if extension in file_type['Videos']:
        move=pathlib.Path(path+file).rename(file_folder['Videos']+file)
        #move=shutil.move(path+file,file_folder['Videos'])
        print('success #### {} to {}'.format(file,move))
    #Archives
    if extension in file_type['Archives']:
        move=pathlib.Path(path+file).rename(file_folder['Archives']+file)
        #move=shutil.move(path+file,file_folder['Archives'])
        print('success #### {} to {}'.format(file,move))
    #Codes
    if extension in file_type['Codes']:
        move=pathlib.Path(path+file).rename(file_folder['Codes']+file)
        #move=shutil.move(path+file,file_folder['Codes'])
        print('success #### {} to {}'.format(file,move))
    else:
        print('## '+file)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;Feel free to develop the code and post any problem or request in the comments&lt;/p&gt;

</description>
      <category>python</category>
      <category>programming</category>
      <category>files</category>
    </item>
    <item>
      <title>What You can do with python (Quick 2021 guide)</title>
      <dc:creator>Budy mnvenom</dc:creator>
      <pubDate>Fri, 27 Aug 2021 12:14:19 +0000</pubDate>
      <link>https://forem.com/xbudy/what-comes-after-learning-python-basics-quick-2021-guide-4k0m</link>
      <guid>https://forem.com/xbudy/what-comes-after-learning-python-basics-quick-2021-guide-4k0m</guid>
      <description>&lt;h2&gt;
  
  
  Intro
&lt;/h2&gt;

&lt;p&gt;Everyone after learning basics asks what should I do now and gets confused and sometimes unmotivated so i decided to give some help&lt;/p&gt;

&lt;h2&gt;
  
  
  Solve problems and Quizzes
&lt;/h2&gt;

&lt;p&gt;I love this one so much because it's very helpful and i recommend it for every beginner. There is a lot of Websites who gives you problems and quizzes to practice with. and here's a list.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt; &lt;a href="https://www.hackerrank.com/domains/python"&gt;Hackerrank&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt; &lt;a href="https://leetcode.com/"&gt;LeetCode&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt; &lt;a href="https://www.codechef.com/problems/school/?itm_medium=navmenu&amp;amp;itm_campaign=problems"&gt;CodeChef&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt; &lt;a href="https://www.interviewbit.com/coding-interview-questions/"&gt;Interviewbit&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt; &lt;a href="https://www.w3schools.com/quiztest/quiztest.asp?qtest=PYTHON"&gt;W3schools&lt;/a&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Learn more
&lt;/h2&gt;

&lt;p&gt;After getting familiar with Python. You should go deeper into learning and more specified. here's a list of what you can learn&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt; AI and Machine learning&lt;/li&gt;
&lt;li&gt; Data visualization, and analysis&lt;/li&gt;
&lt;li&gt; Web Development&lt;/li&gt;
&lt;li&gt; Game development&lt;/li&gt;
&lt;li&gt; Cyber security check &lt;a href="https://blog.icodes.tech/2021/08/15/network-scanner-discover-all-ip-address-on-your-network.html"&gt;Network scanner&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt; Mobile apps development&lt;/li&gt;
&lt;li&gt; Data science&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Projects
&lt;/h2&gt;

&lt;p&gt;The best way to practices what you've learned is by building projects but what kind of projects you can build?&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt; Create a bot&lt;/li&gt;
&lt;li&gt; Scrape data from websites -- &lt;a href="https://blog.icodes.tech/2021/03/12/pick-random-movie-with-a-python-script.html"&gt;Scrape movies from imdb&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt; Build a website with web development frameworks&lt;/li&gt;
&lt;li&gt; Build an Android app&lt;/li&gt;
&lt;li&gt; build a game&lt;/li&gt;
&lt;li&gt; Script to automate something &lt;a href="https://blog.icodes.tech/2021/06/12/python-files-organizer-automate-boring-files-organizing-using-python.html"&gt;Automate files organizing&lt;/a&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The end.&lt;br&gt;
I would be happy to read your feedback about my programming blog : &lt;a href="https://blog.icodes.tech/"&gt;blog.icodes.tech&lt;/a&gt; &lt;/p&gt;

</description>
      <category>python</category>
      <category>programming</category>
    </item>
  </channel>
</rss>
