App-Cheats
view release on metacpan or search on metacpan
# Fetch (sync) from the assigned repository (but do NOT checkout any files)
git fetch
# Fetch from repository (origin)
git fetch origin
# Sync with a specific repository (but do NOT checkout any files)
git fetch <url>
# Pull down changes to branch from origin
git pull origin master
git pull github master
# Warning when pulling from github/gitlab:
X11 forwarding request failed on channel 0
#
vi ~/.ssh/config
#
Host git.otrs.com
ForwardX11 no
# When there is a conflict when pulling a branch,
# this will pull in the changes and put your commits
# as last
git pull --rebase
# Push upstream to origin from the branch
git push -u origin master
git push github addsvn
# Remove a remote branch
git push --delete origin <branch name>
# Checkout latest commit version of a single file
git init
git fetch <url>
git checkout FETCH_HEAD <file>
# Checkout select commit version of a single file
git init
git fetch <url>
git checkout -m <commit_id> <file>
# Checkout a specific version of a single file
git checkout -m <commit_id> file
# Checkout a file from another branch
git checkout master file1
# Checkout a file from 2 revisions back
git checkout master~2 file1
# Protect your changes when pulling from origin
git stash
# Unprotect changes
git stash apply
# To periodically update the repo on GitHub with what you have in GitLab
git fetch -p origin
git push --no-verify --mirror
#############################################################
## Git - Prune Commands
#############################################################
# warning: There are too many unreachable loose objects; run 'git prune' to remove them.
git gc
# Clean the git repo removing large objects in the history.
# Note: THIS IS DESTRUCTIVE!!!
#
# https://netdevops.me/2021/remove-binaries-and-big-files-from-git-repo/
git filter-repo --strip-blobs-bigger-than 3M
pip3 install git-filter-repo
#
# Need to set this again
git remote add origin <PATH>
#############################################################
## Git - Rev-Parse Commands
#############################################################
# Figure out path to git root.
git rev-parse --show-toplevel
#############################################################
## Git - Branch Commands
#############################################################
# View all branches
git branch
# View all branches details
git branch -v
# View all branches (including remote)
git branch -a
# Create a branch of the local master
git branch my_branch
# Get current branch name
git branch --show-current
# Check out a branch
git checkout my_branch
# Create a new branch and check it out
git checkout -b my_branch
# Create a new branch (and check it out) from origin/master (repository/branch)
git checkout -b my_branch origin/master
# Rename branch
git branch -m svn_update SR15308587
# List git branch but without the asterisk
openfiles.exe /local on
# restart PC
#############################################################
## Windows - Outlook
#############################################################
# Windows Outlook.
# Monospaced font
Courier New
#############################################################
## Windows - Registry
#############################################################
# Registry file location on windows 10
C:\Users\<USER>\NTUSER.DAT
# Script to update the windows registry
#
@echo off
echo.
cd ..
reg add HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\MY_PATH /t REG_SZ /v AppPath /d %cd% /f
echo.
echo AppPath = %cd%
echo.
pause
# Dump windows 10 registry to a file (query,view,search)
reg export "HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\MY_PATH" my.reg
reg export "HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\MY_PATH" my.reg /y
# Enable Restore Points in Windows 10
Win + r
Type: regedit
Computer\HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\SystemRestore
Double - Click "DisableSR"
1 - Disabled
0 - Enabled
#
# Restart PC for changes to take effect.
# Add the "Open command window here" option back to windows 10 commamd prompt (registry,DOS)
# when doing right click.
#
# Go to the regestry
Win + r
type: regedit
#
# For these paths:
Computer\HKEY_CLASSES_ROOT\Directory\shell\cmd
Computer\HKEY_CLASSES_ROOT\Directory\background\shell\cmd
#
# Update permissions:
- Right-click the PowerShell (folder) key, and click Permissions.
- Click the Advanced button.
- On "Advanced Security Settings," click the Change link next to "Owner".
- Type your account name in the provided field, click Check Names to verify
you're typing the account name correctly, and click OK.
- Check the Replace owner on subcontainers and objects option.
- Click Apply.
- Click OK.
- On "Permissions," select the Administrators group.
- Under "Permissions for Administrators," select Allow for the Full Control option.
- Click Apply.
- Click OK.
#
# Show option:
- Inside the cmd (folder) key, right-click the HideBasedOnVelocityId DWORD,
and click Rename.
- Change the DWORD name from HideBasedOnVelocityId to ShowBasedOnVelocityId,
and press Enter.
#
# Hide option (undo the change):
- rename the DWORD from from ShowBasedOnVelocityId to HideBasedOnVelocityId
#############################################################
## Windows - Variables
#############################################################
# Get windows script directory (DOS,pwd,windows vars)
echo %~dp0
# Start in currect script directory (windows vars)
cd /d %~dp0
#############################################################
## Windows Commands - ipconfig
#############################################################
# Internet not working on Windows
# Disable all adapters, but Ethernet 2.
# Then:
ipconfig /renew
ipconfig /release
# Enable the adapters again.
#############################################################
## Windows Commands - net
#############################################################
# See which folders are being shared on windows 10
net share
#############################################################
## Windows Commands - netstat
#############################################################
# Special Addresses
netstat -ano -p tcp | findstr 8080
# Address 0.0.0.0 allows access by another machine.
# Address 127.0.0.1 allows faking a server by using the loopback adapter.
( run in 2.203 seconds using v1.01-cache-2.11-cpan-0bb4e1dffa6 )