How to deploy a create react app to Github pages

1. Add homepage

Open your package.json file present inside your react app and add homepage property.

"homepage":"https://yourusername.github.io/repository-name"

replace the above url with your github username and repository name.


2. Install gh-pages

Next, we need to install a package called gh-pages.

npm install --save-dev gh-pages

3. Deploy script

It’s time to add a deploy script commands in our package.json file.

"scripts":{
 "predeploy": "npm run build",
 "deploy": "gh-pages -d build",
}

Now in your terminal run npm run deploy

4. Setup source to gh-pages branch.

Once you successfully deployed open your GitHub code repository and click on settings tab if you scroll down you can see a GitHub Pages then choose a branch to gh-pages.

react app ghpages setup

That’s it now you can see your react app URL like in the above image.

Password Protect Folder with Apache .htaccess file

Create new file named “.htaccess” in the folder with this Content

AuthName "Password Protected!"
AuthType Basic
AuthUserFile /home/cpanel_user_name/public_html/folder_name/.htpasswd
require valid-user

Create new file named “.htpasswd” in the same folder with this Content (Username:Password)

asiq:12345

*Change cpanel_user_name & folder_name

How To Increase VirtualBox’s Disk Space

Open a Command Prompt Window (Run as Administrator)
Change to VirtualBox’s Program Files Folder
Then type the code below in the Command Prompt.

VBoxManage modifyhd YOUR_HARD_DISK.vdi --resize SIZE_IN_MB

replacing YOUR_HARD_DISK and SIZE_IN_MB with your Hard Disk name and desired size.
Like,

VBoxManage modifyhd D:\VB\Win10\win10.0.vdi --resize 20480

How To Manage Hibernate Mode in Windows 7 (hiberfil.sys File)

If you don’t use the Hibernate option in Windows 7, you can save some disk space by disabling it. Here we will look at a few different ways to manage hibernate options in Windows 7.

Enable or Disable Hibernate Through Command Prompt

To Enable Hibernate Mode Run this code in Command Prompt.
powercfg /hibernate on

To Disable Hibernate Mode Run this code in Command Prompt.
powercfg /hibernate off

How to Change Windows Virtual Memory (pagefile.sys File Size)

To change windows Virtual Memory follow these step:
  1. Open System by clicking the Start button, Right-Clicking Computer, and then clicking Properties.
  2. In the left panel, click Advanced system settings.  If you’re prompted for an administrator password or confirmation, type the password or provide confirmation.
  3. On the Advanced tab, under Performance, click Settings.
  4. Click the Advanced Tab, and then, under Virtual Memory, click Change.
  5. Uncheck the Automatically Manage Paging File Size for all Drives Checkbox.
  6. Under Drive [Volume Label], click the drive that contains the paging file you want to change.
  7. Click Custom Size, type a new size in megabytes in the Initial size (MB) or Maximum size (MB) box, click Set, and then click OK.

Note

Increases in size usually don’t require a restart for the changes to take effect, but if you decrease the size, you’ll need to restart your computer. We recommend that you don’t disable or delete the paging file.

How do i know who had visited my timeline most

To know it follow these steps

  1. Go to your timeline and press Ctrl + u or mouse right click and chose “View Page Source”.
  2. Then find “InitialChatFriendsList” by pressing Ctrl + f.
  3. After that word you will see some Facebook use ID number (like 100003309186884)
  4. Now go to “https://facebook.com/” and Add that number after it. It will take you to that person profile page who had visited your profile most.

Create or Delete Partition with Windows Command Line

Open Windows command Line and follow these steps.

  1. Run Command diskpart
  2. Run Command list disk
  3. Note the disk number that corresponds to your USB drive (it should be obvious going by size)
  4. Run Command select disk X (where X is the number from step 4)
  5. Run Command list partition – There should be two, numbered 0 and 1, each about 7 GB
  6. Run Command select partition 0
  7. Run Command delete partition
  8. Run Command select partition 1
  9. Run Command delete partition
  10. Run Command create partition primary
  11. Exit Command Prompt (type exit or just close the window)

In Windows, go to Computer and try to open the disk. It will ask you to format it.
Format it with the default settings and give it a name if you want.