Skip to content

Instantly share code, notes, and snippets.

View hanfeiyu's full-sized avatar
🤡

ChitandaEru hanfeiyu

🤡
  • Stevens Institute of Technology
  • Hoboken, New Jersey, USA
  • 12:40 (UTC -04:00)
View GitHub Profile
@hanfeiyu
hanfeiyu / github_commit_as_init.md
Last active September 2, 2025 00:37
Make the current commit as the initial commit on github repo

Remove all history

rm -rf .git

Reconstruct the git repo with only the current commit

git init
git add .
git config --global user.email [email protected]
@hanfeiyu
hanfeiyu / clean_py.sh
Created October 19, 2023 03:42 — forked from hbsdev/clean_py.sh
Recursively remove all .pyc files and __pycache__ directories in the current directory.
#!/bin/sh
# recursively removes all .pyc files and __pycache__ directories in the current
# directory
find . | grep -E "(__pycache__|\.pyc$)" | xargs rm -rf
@hanfeiyu
hanfeiyu / chmod-400.cmd
Created July 25, 2023 15:56 — forked from jaskiratr/chmod-400.cmd
Set permission of file equivalent to chmod 400 on Windows.
# Source: https://stackoverflow.com/a/43317244
$path = ".\aws-ec2-key.pem"
# Reset to remove explict permissions
icacls.exe $path /reset
# Give current user explicit read-permission
icacls.exe $path /GRANT:R "$($env:USERNAME):(R)"
# Disable inheritance and remove inherited permissions
icacls.exe $path /inheritance:r
@hanfeiyu
hanfeiyu / private_fork.md
Last active December 30, 2024 22:30 — forked from 0xjac/private_fork.md
Create a private fork of a public repository

The repository for the assignment is public and Github does not allow the creation of private forks for public repositories.

The correct way of creating a private frok by duplicating the repo is documented here.

For this assignment the commands are:

  1. Create a bare clone of the repository. (This is temporary and will be removed so just do it wherever.)

git clone --bare [email protected]:usi-systems/easytrace.git