Skip to content

Commit 4d6051a

Browse files
author
xtutran
committed
merge
2 parents 4cd8ae8 + e7107a1 commit 4d6051a

File tree

3 files changed

+34
-5
lines changed

3 files changed

+34
-5
lines changed

git/README.md

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,3 +38,30 @@ echo "**/.DS_Store" >> ~/.gitignore_global
3838
echo "**/._.DS_Store" >> ~/.gitignore_global
3939
git config --global core.excludesfile ~/.gitignore_global
4040
```
41+
## Permanently delete sentive file/folder which be uploaded accidently, [ref](https://help.github.com/articles/removing-sensitive-data-from-a-repository/)
42+
43+
- Force delete file
44+
```bash
45+
git filter-branch --force --index-filter \
46+
'git rm --cached --ignore-unmatch YOUR_FILE' \
47+
--prune-empty --tag-name-filter cat -- --all
48+
```
49+
50+
- Force delete folder
51+
```bash
52+
git filter-branch --force --index-filter \
53+
'git rm -r --cached --ignore-unmatch YOUR_FOLDER' \
54+
--prune-empty --tag-name-filter cat -- --all
55+
```
56+
57+
- Force push to overwrite your repo
58+
```bash
59+
git push origin --force --all
60+
```
61+
62+
- Undo delete
63+
```bash
64+
git reset --hard refs/original/refs/heads/master
65+
```
66+
67+
- Tell your collaborators to rebase, not merge

misc/README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@ curl -O <link to download>
55

66
# with proxy
77
curl -O --proxy <[protocol://][user:password@]proxyhost[:port]> <link to download>
8+
9+
# if your password contain special character like '@'
10+
curl -O http://proxy_server:proxy_port --proxy-user username:password <link to download>
811
```
912

1013
## Pip install with proxy

ssh/README.md

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
Example: SSH password-less automatic login from localhost to Cloudera-VM with user cloudera.
44
```
55
SSH Client : localhost ( MacOS )
6-
SSH Remote Host : 127.0.0.1 ( RedHat - cloudera-vm )
6+
SSH Remote Host : 127.0.0.1 ( RedHat - cloudera-vm ) forward port 22 to 3022 in Client
77
```
88

99
### 2. Create Authentication SSH-Kegen Keys on Client machine
@@ -13,25 +13,24 @@ ssh-keygen -t rsa
1313

1414
### 3. Create .ssh Directory on Remote machine
1515
```bash
16-
ssh cloudera@127.0.0.1 mkdir -p .ssh
16+
ssh -p 3022 cloudera@127.0.0.1 mkdir -p .ssh
1717
```
1818

1919
### 4. Upload Generated Public Keys from Client to Remote machine
2020
```bash
21-
cat .ssh/id_rsa.pub | ssh cloudera@127.0.0.1 'cat >> .ssh/authorized_keys'
21+
cat ~/.ssh/id_rsa.pub | ssh -p 3022 cloudera@127.0.0.1 'cat >> ~/.ssh/authorized_keys'
2222
```
2323

2424
### 5. Set Permissions on Remote machine
2525
```bash
26-
ssh cloudera@127.0.0.1 "chmod 700 .ssh; chmod 640 .ssh/authorized_keys"
26+
ssh -p 3022 cloudera@127.0.0.1 "chmod 700 .ssh; chmod 640 ~/.ssh/authorized_keys"
2727
```
2828

2929
### 5. Make an alias for Remote server
3030
```bash
3131
vi ~/.ssh/config
3232
```
3333

34-
* 3022 is forwarding port of 22 from VM to my local machine
3534
```
3635
Host cloudera-vm
3736
HostName 127.0.0.1

0 commit comments

Comments
 (0)