Showing posts with label Web Development. Show all posts
Showing posts with label Web Development. Show all posts

Saturday, 6 June 2020

create vm using hyper-v in windows 10

1.
Enable CPU Virtualization in Your Computer's BIOS
f2 -> bios->advanced -> cpu configuration ->intel virtualization -> ext ->save &reset

2. 
Enable hypver-v by search for turn windows feature on and off
make sure turn on hyper-v platform and hypver-v management tools

3. open hyper-v, create a virtual switch, choose extenral to allow it to connect to outside internet

4. install open-ssh server on linux vm
sudo apt install openssh-server
sudo reboot
https://askubuntu.com/questions/980704/ubuntu-on-vmware-ssh-connection-refused-issue
check ssh status
https://www.cyberciti.biz/faq/howto-start-stop-ssh-server/
5. get ip address of ur vm
ip addr show
6. install gitbash and ssh to your server


Tuesday, 12 May 2020

Convenient way to calculate pagination

// Pseudo Code     

       //  Convenient way to calculate pagination
        $page  = $request->page;
        $item_per_page = $request->limit ? $request->limit : 2000000000;
        $offset = $page ? ($page - 1) * $item_per_page : 0;

Tuesday, 21 January 2020

2021Google Search console index - Get newly hosted website on Google search


   Search 
    site:mydomin.ca 
    to see search results of pages in your domain thats being indexed by google
 
  If no results :
    Need to submit a site map

Any structural changes(new pages, folders) in website will need to regenerate site maps. (If you want faster google search you can resubmit sitemap
   
    a) Create mydomin.ca/mysite.xml, using the following tool

    b) Submit site map to google search console (https://search.google.com/)
            https://developers.google.com/search/docs/advanced/sitemaps/build-sitemap
(Google will periodically look for ur site map in mydomin.ca/mysite.xml for changes, but you can manually upload it again to refresh it right away, just submit mydomin.ca/mysite.xml again)
  • Submit a sitemap using the Sitemaps report.
    • This requires to login google search console
    • Open sitemap report,
    • Add a property domain (your site domain), and follow the steps :
      • Create a txt record with value of provided by google in your domain for google to verify (TXT records are a type of Domain Name System (DNS) record that contains text information for sources outside of your domain. You add these records to your domain settings. https://support.google.com/a/answer/2716800?hl=en))
      • Click Site Maps, and submit mydomin.ca/mysite.xml

   Google takes 2 days or up to 2 weeks to index pages

------------------------------------------------------------------------------------------------------------
2) Claim google my business so your site shows up when people search
      Login to google my business to claim business

3) Add title and meta tags to web page to improve SEO
   (The <metatag provides metadata about the HTML document. ... Meta elements are typically used to specify page description, keywords, author of the document, last modified, and other metadata. The metadata can be used by browsers (how to display content or reload page), search engines (keywords), or other web services. https://www.w3schools.com/tags/tag_meta.asp)


    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta name="description" content="content_1,content_2">
    <meta name="keywords" content="kew_words1,kewords_2">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">

    <title>SharkWriting &#8211; MY TITLE &amp;</title>

4) Google ads, redirect links from other site, paid searches, Facebook ads




Monday, 20 January 2020

OPEN ID, OAuth, OPEN ID Connect, Laravel Framework

Simple Terms

  1. OpenID is about verifying a person's identity (authentication). (usually returns ID_TOKEN)
  2. OAuth is about accessing a person's stuff (authorization). (NO ID_TOKEN but information got pulled)
  3. OpenID Connect does both.
All three let a person give their username/password (or other credential) to a trusted authority instead of to a less trusted app.

OAuth 2.0 is an authorization framework, not an authentication protocol. You can think of this framework as a common denominator for authorization. ... The big difference between OpenID Connect and OAuth2 is the id_token . There is no id_token defined in OAuth2 because the id_token is specific to federated authentication


Laravel Framework 
Open ID Connect implementation :