-
-
Notifications
You must be signed in to change notification settings - Fork 30
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
4989303
commit 014f040
Showing
14 changed files
with
896 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
Bash Cheat Sheet | ||
================ | ||
|
||
## Moving | ||
|
||
| command | description | | ||
|----------|--------------------------------| | ||
| ctrl + a | Goto BEGINNING of command line | | ||
| ctrl + e | Goto END of command line | | ||
| ctrl + b | move back one character | | ||
| ctrl + f | move forward one character | | ||
| alt + f | move cursor FORWARD one word | | ||
| alt + b | move cursor BACK one word | | ||
|
||
## Other | ||
|
||
| command | description | | ||
|----------|--------------------------------| | ||
| ctrl + d | Delete the character under the cursor | | ||
| ctrl + l | Clear the screen (same as clear command) | | ||
| ctrl + p | Fetch the previous command from the history list, moving back in the list (same as up arrow) | | ||
| ctrl + n | Fetch the next command from the history list, moving forward in the list (same as down arrow) | | ||
| ctrl + u | Clear all BEFORE cursor | | ||
| ctrl + k | Clear all AFTER cursor | | ||
| ctrl + r | Search backward starting at the current line and moving 'up' through the history as necessary | | ||
| crtl + s | Search forward starting at the current line and moving 'down' through the history as necessary | | ||
| ctrl + c | kill whatever is running | | ||
| ctrl + d | Exit shell (same as exit command) | | ||
| ctrl + w | delete the word BEFORE the cursor | | ||
| ctrl + t | swap the last two characters before the cursor | | ||
| ctrl + y | paste (if you used a previous command to delete) | | ||
| ctrl + z | Place current process in background | | ||
| ctrl + _ | undo | | ||
| esc + t | Swap last two words before the cursor | | ||
| esc + . | | | ||
| esc + _ | | | ||
| alt + [Backspace] | delete PREVIOUS word | | ||
| alt + < | Move to the first line in the history | | ||
| alt + > | Move to the end of the input history, i.e., the line currently being entered | | ||
| alt + ? | | | ||
| alt + * | | | ||
| alt + . | print the LAST ARGUMENT (ie "vim file1.txt file2.txt" will yield "file2.txt") | | ||
| alt + c | | | ||
| alt + d | | | ||
| alt + l | | | ||
| alt + n | | | ||
| alt + p | | | ||
| alt + r | | | ||
| alt + t | | | ||
| alt + u | | | ||
| ~[TAB][TAB] | List all users | | ||
| $[TAB][TAB] | List all system variables | | ||
| @[TAB][TAB] | List all entries in your /etc/hosts file | | ||
| [TAB] | Auto complete | | ||
| !! | Run PREVIOUS command (ie `sudo !!`) | | ||
| !vi | Run PREVIOUS command that BEGINS with vi | | ||
| cd - | change to PREVIOUS working directory | | ||
|
||
# Kill a job | ||
|
||
n = job number, to list jobs, run `jobs` | ||
|
||
```bash | ||
kill %n | ||
``` | ||
|
||
Example: | ||
|
||
```bash | ||
kill %1 | ||
``` | ||
|
||
## References | ||
|
||
1. http://cnswww.cns.cwru.edu/php/chet/readline/readline.html |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,141 @@ | ||
Git Cheat Sheet | ||
=============== | ||
|
||
## Subtree Example | ||
|
||
### Add sub-project as remote | ||
|
||
```bash | ||
git remote add -f RemoteName RemoteUrl | ||
``` | ||
|
||
### Run `git subtree` command | ||
|
||
```bash | ||
git subtree add --prefix Path/To/Put/Code NameOfRemote master --squash | ||
``` | ||
|
||
#### Pull subtree as needed | ||
|
||
```bash | ||
git fetch NameOfRemote master | ||
git subtree pull --prefix Path/To/Put/Code NameOfRemote master --squash | ||
``` | ||
|
||
### Reference | ||
|
||
* http://blogs.atlassian.com/2013/05/alternatives-to-git-submodule-git-subtree | ||
|
||
## Create a branch without a parent | ||
|
||
Very useful when you are updating a project that you are rewriting. For example, | ||
say you are using semantic versioning and are wanting to start a new major | ||
version. | ||
|
||
```bash | ||
git checkout --orphan BRANCH | ||
``` | ||
|
||
## Delete All Branches that have been merged | ||
|
||
Great for cleaning up local branches that aren't being used any more. | ||
|
||
```bash | ||
git checkout master | ||
git branch --merged | grep -v "\*" | xargs -n 1 git branch -d | ||
``` | ||
|
||
## Ignore changes to a file that is being tracked | ||
|
||
### Ignore | ||
|
||
```bash | ||
git update-index --assume-unchanged [directory|file] | ||
``` | ||
|
||
### Unignore | ||
|
||
```bash | ||
git update-index --no-assume-unchanged [directory|file] | ||
``` | ||
|
||
## How to ignore dirty submodules | ||
|
||
Edit your ``.git/config`` and add ``ignore = dirty``. | ||
|
||
```text | ||
[submodule "path/to/submodule"] | ||
path = path/to/submodule | ||
url = git://github.com/username/repo.git | ||
ignore = dirty | ||
``` | ||
|
||
## Clone a repo and give name other than origin | ||
|
||
```bash | ||
git clone -o upstream https://repo.git | ||
``` | ||
|
||
## Ignore Files for Repository without using `.gitignore` | ||
|
||
Add the file `.git/info/exclude` and fill it with the contents you want to ignore. This will ONLY apply to the | ||
repository and will not be tracked by git. | ||
|
||
## Squash Commits | ||
|
||
```bash | ||
git log | ||
``` | ||
|
||
Count the number of commits that you have made, let's say the previous 5 are your commits. | ||
|
||
```bash | ||
git rebase -i HEAD~5 | ||
``` | ||
|
||
The first commit leave as `pick` the rest will need to be changed to `squash`. After that you will be able to | ||
leave a new commit message or just leave as is to keep the commit messages from all previous commits. | ||
|
||
## Search for a specific line of code/file in the history | ||
|
||
```bash | ||
git log -S[search term] | ||
``` | ||
|
||
Example: | ||
|
||
```bash | ||
git log -SThatOneFile.php | ||
``` | ||
|
||
## Copy file from one branch to current branch | ||
|
||
Copy a file from `branch` and put into staging. | ||
|
||
```bash | ||
git checkout BRANCH path/to/file.ext | ||
|
||
# Real Life Examples | ||
git checkout origin/featureBranch web/js/random.js | ||
# Pulls into your current branch web/js/random.js from | ||
# origin/featureBranch | ||
``` | ||
|
||
## Git Grepping for fun and profit! | ||
|
||
```shell | ||
# Basic grep (case sensitive) | ||
$ git grep 'search term' | ||
|
||
# Case Insensitive search | ||
$ git grep -i 'search term' | ||
|
||
# Search within a directory | ||
$ git grep 'search term' src/ | ||
|
||
# Search only files with `php` extension | ||
$ git grep 'search term' -- '*.php' | ||
|
||
# Grep in the 'src/` directory, only yml files | ||
$ git grep 'search term' -- 'src/**.yml' | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
GnuPG Cheat Sheet | ||
================= | ||
|
||
## Listing Key Pairs | ||
|
||
```bash | ||
gpg --list-keys | ||
``` | ||
|
||
For listing keys with the fingerprint, run | ||
|
||
```bash | ||
gpg --fingerprint | ||
``` | ||
|
||
## Generate New Key Pair | ||
|
||
```bash | ||
gpg --gen-key | ||
``` | ||
|
||
## Encrypt a message on command line | ||
|
||
```bash | ||
echo "Put message here" | gpg --armor --encrypt --recipient Joshua > FILE.gpg | ||
``` | ||
|
||
This will put the encrypted text into `FILE.gpg` which you can send to someone or keep for | ||
later use. For decrypting the message, see the next section. | ||
|
||
## Decrypt a message from the command line | ||
|
||
```bash | ||
cat FILE.gpg | gpg | ||
``` | ||
|
||
Displays the decrypted text on the command line. | ||
|
||
## Only display user X's key information | ||
|
||
```bash | ||
gpg --fingerprint Joshua | ||
``` | ||
|
||
## Signing Messages | ||
|
||
```bash | ||
echo "This is a top secret message" | gpg --clearsign | ||
``` | ||
|
||
## Signing Text Files | ||
|
||
```bash | ||
gpg --clearsign example.txt | ||
``` | ||
|
||
This will create `example.txt.asc` file. | ||
|
||
## Verify Signatures | ||
|
||
```bash | ||
gpg --verifiy example.txt.asc | ||
``` | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
Irssi Cheat Sheet | ||
================= | ||
|
||
M = Meta Key, meta key is either the left alt or esc key. | ||
|
||
| command | description | | ||
|----------|-------------| | ||
| M + p | Scroll up in window | ||
| M + n | Scroll down in window | ||
| ctrl + p | Previous window | ||
| ctrl + n | Next window |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
Jira Cheat Sheet | ||
================ | ||
|
||
## Find by Mentions of current user within the past 7 days | ||
|
||
```sql | ||
comment ~ currentUser() AND updatedDate >= -7d | ||
``` |
Oops, something went wrong.