My First Post      My Facebook Profile      My MeOnShow Profile      W3LC Facebook Page      Learners Consortium Group      Job Portal      Shopping @Yeyhi.com

Pages










Showing posts with label Access. Show all posts
Showing posts with label Access. Show all posts

Tuesday, March 10, 2026

How to set new Github PTA when old expired

I ran into a situation. My Personal Access Token on Git expired and I wanted to generate and set in my git terminal locally. The problem was that my git was still taking old PTA from command line. I kept on asking for old PTA which was now expired. Let me walk you through what was done next.

But first - Let's learn to set a new Personal Access Token (PAT) on your Mac, you need to first generate it on the GitHub website and then enter it into your terminal when prompted.

Step 1: Generate a New PAT on GitHub

  1. Log into GitHub.com and go to your Settings (click your profile photo in the top right).
  2. On the left sidebar, scroll to the bottom and click Developer settings.
  3. Click Personal access tokens -> Tokens (classic).
  4. Click Generate new token (classic).
  5. Note: Give it a name (e.g., "MacBook Pro").
  6. Expiration: Choose a duration (or "No expiration" if you prefer).
  7. Scopes: Select the repo checkbox (this is required for push/pull access).
  8. Click Generate token and copy the token immediately. You will not be able to see it again.

To update your Personal Access Token (PAT) because Git is still using an old, expired one, you must clear the existing credentials from your system's storage so Git can prompt you for the new one.
1. Clear Old Credentials (Required)
Choose the steps for your specific Operating System:
  • Windows:
    1. Open the Start Menu, search for "Credential Manager", and open it.
    2. Select Windows Credentials.
    3. Find entries for git:https://github.com and click Remove.
  • macOS:
    1. Open Keychain Access (use Command + Space and type it).
    2. Search for github.com.
    3. Right-click the entry and select Delete "github.com".
  • Linux (Command Line):
    • Run: git config --global --unset credential.helper.
    • If you used the "store" helper, delete the credentials file: rm ~/.git-credentials

**But sometimes this step does not work. For that use following:
git remote set-url origin https://github.com


Step 2: Set the Token in your Terminal
Since you already cleared your Keychain earlier, Git will now ask you for the new token the next time you try to connect.
  1. In your terminal, run:
    git pull origin main
  2. Username: Type your GitHub username and press Enter.
  3. Password: Paste your new PAT and press Enter.
    • Note: The terminal will not show any dots or characters while you paste. This is normal security behavior.
But in my case I was getting an error - git pull origin main says fatal: repository 'https://github.com/' not found



Run this command to fix it (replace your-username and your-repo-name with your actual names):
bash
git remote set-url origin https://github.com
Use code with caution.
Now, try to pull again:
bash
git pull origin main
Use code with caution.
What will happen next:
  1. It will ask for your Username: Type it and hit Enter.
  2. It will ask for your PasswordPaste your new PAT here and hit Enter. (You won't see any characters appear while pasting).
Why it says "Not Found":
In your previous steps, the remote URL accidentally got set to https://github.com/. GitHub doesn't see any code there, so it tells you the "repository" doesn't exist. Pointing it back to the full URL fixes this. eg: git remote set-url origin https://github.com/Anwar/Artudio

    Permissions Required for Your PAT
    Depending on which type of token you created, ensure these settings are enabled:
    • Fine-grained Token (Recommended):
      • Repository access: Select "Only select repositories" and choose your specific repository (e.g., Anwar-Faiz/artudio), or select "All repositories".
      • Permissions: Under "Repository permissions", find "Contents" and change the access to Read and Write.
      • I also give Pull Request Read and Write
      • Metadata: as Read only


Wednesday, May 13, 2020

How to update git password on terminal: Command line utility to reset github password / access credentials

On macOS, you can use

git config --global credential.helper osxkeychain

A username and password prompt will appear on your next Git action (pull, clone, push, etc.).
Eg: If you do git clone: gttps://mfaiz@www.repository.git .

As soon as you press Enter key, you will be prompted for a password.
You can use the updated password here. And, you will be able to access and password also gets updated automatically!


For Windows, it's the same command with a different argument:

git config --global credential.helper wincred


Isn't this simple :)
Cheers.

Thursday, January 19, 2012

File access problem: PHP htaccess

Once I was asked a question related to File access over the web server.
The question was asked as follows...
"I have built an information maintenance system where files can be uploaded. Anyone can view those files.
But, the problem is when a file is viewed in the browser at that time if someone just copy the URL in some text file after that any body from any where can view that file by just pasting that URL in the browser's address bar.

How to prohibate this thing. PLZZZZZZZZZZZZZZZZZZZ help me...............

its verrrrrrrrrrrrrrrrry serious problem.............."

It was answered by a web expert Mr. Longor (his user id;) )as follows
"There's lots of ways to do this...the one that springs to mind is have a simple referer check at the top of your file-page and if the referer is not coming from your site, then simply redirect the browser to an error page of your choosing.

You can also use .htaccess on linux servers to accomplish this type of thing."


I answered as follows:
"yes neil dear
that was to appen
actually u r asking a questionn of basic security

what u can do is to change the access configurations from .htaccess file

or else use MySql at the back end and save those info in a database (password protected)

This will surely solve the problem!!"


To the answer by previous web expert I replied as follows...
"langsor gave a good solution

Bt basic problem is that the solution posted by him works only if your pages are php. But they may be simple text files also. Because i feel u r using flat files as your database.

so .htaccess solution as adviced by him and me both are correct.

and if in case your pages are php. then well good and fine. go on with the method of longor."


And then the person who asked the question clarified more as follows...
"Sorrrrrrry everyone,

actually i did not clear the problem to you, My files are in ".pdf" format...

Suppose,

http://localhost/information/sample.pdf

can be viewd ....... no login is required to do so..

if I cross the browser and after that in a new browser if I paste this URL then it should not be viewd......."



And then my final answer was
"ya i suppose now u gave correct explanation of ur problem

now only possible things are .htaccess

i need others to speak on this

Anyone to rescue neil of his situation??

easy bit... neil
lets see who solves first"

And guess what..
No one answered after this.
I was personally emailed to tell that the problem was solved by my approach. Gr888!!

The entire thread can be read at http://www.daniweb.com/web-development/php/threads/138376

Wednesday, June 22, 2011

Access copy Share files between Host and guest file system in VMware virtual machine

There is definitely ways to achieve the task. It all depends on the choice of the host machine you are using and the guest OS in the VMware. Just keep in mind the following matrix:






HostGuestTool
WinWinwindows file sharing
WinLinuxsamba, ssh
linuxwinsmbmount
linuxlinuxnfs,ftp,telnet

The same above in graphics is

To summarize:
# If Both systems run Windows operating system, you can use Windows file sharing
# If You are connecting from a Linux system to a Windows system, you can use smbmount
# If You are connecting from a Windows system to a Linux system, use Samba
# If Both systems run Linux operating systems, use NFS, FTP and Telnet

For more detailed description you can also visit VMWare official website document on this topic at the following location. Click Here for VMWare Help

In order to share folders between the host operating system and the guest operating system you can use VMWare settings. Go to VM->Settings->options

The same is shown in the adjacent snapshot.
Added notes in July 2012 :-- VMware Workstation 4 Features | Documentation | Knowledge Base | Discussion Forums Prev Contents Last Next Using Shared Folders With shared folders, you can easily share files among virtual machines and the host computer. To use shared folders, you must have the current version of VMware Tools installed in the guest operating system and you must use the Virtual Machine Control Panel to specify which directories are to be shared. You can use shared folders with virtual machines running the following guest operating systems: Windows Server 2003 Windows XP Windows 2000 Windows NT 4.0 Linux with a kernel version of 2.4 or higher To set up one or more shared folders for a virtual machine, be sure the virtual machine is open in Workstation and click its tab to make it the active virtual machine. Go to Edit > Virtual Machine Settings > Options and click Shared folders. You can add one or more directories to the list. Those directories may be on the host computer or they may be network directories accessible from the host computer. In a Windows virtual machine, shared folders appear in My Network Places (Network Neighborhood in a Windows NT virtual machine) under VMware Shared Folders. For example, if you specify the name Test files for one of your shared folders, you can navigate to it by opening My Network Places > VMware Shared Folders > .host > Shared Folders > Test files. You can also go directly to the folder using the UNC path \\.host\Shared Folders\Test files. You can map a shared folder to a drive letter just as you would with a network share. Note: To see shared folders displayed in this way, you must update VMware Tools in the virtual machine to the current version. If your guest operating system has the version of VMware Tools that shipped with VMware Workstation 4.0, shared folders appear as folders on a designated drive letter. In a Linux virtual machine, shared folders appear under /mnt/hgfs. So the shared folder in this example would appear as /mnt/hgfs/Test files.

Vmware and sharing rocks!!