-
-
Save nguyensach/d6bf5f6868edcbc31a0ca5a6e4fe8a8f to your computer and use it in GitHub Desktop.
Revisions
-
hofmannsven revised this gist
Mar 24, 2018 . 1 changed file with 6 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -144,4 +144,9 @@ Create file: `%` ### NERDTree Toggle sidebar: `:NERDTreeToggle` ### CtrlP Switch from file to file: `ctrl + p` -
hofmannsven revised this gist
Mar 13, 2018 . 1 changed file with 3 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -11,6 +11,9 @@ Vim CLI Basics ## Config Custom config: `~/.vimrc` ## Colorschemes - https://github.com/rakr/vim-one ## Commands ### Navigation -
hofmannsven revised this gist
Mar 13, 2018 . 1 changed file with 41 additions and 4 deletions.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -8,9 +8,6 @@ Vim CLI Basics ## Cheatsheet - https://vim.rtorr.com/ ## Config Custom config: `~/.vimrc` @@ -50,6 +47,9 @@ Jump to beginning of the file: `gg` Jump to end of the file: `G` Browser current working directory: `:e .` (allows browsing and searching with `/`) Search word: `/` (Use `n` and `N` to navigate) Insert as new line: `o` and `O` @@ -104,4 +104,41 @@ Jump down: `ctrl + j` Jump left: `ctrl + h` Jump right: `ctrl + l` ## Apps ### MacVim Open app: `mvim` ## Plugins ### Vundle Download: https://github.com/VundleVim/Vundle.vim Command: `:PluginInstall` ### Vinegar Browser current working directory: `-` Go up one folder: `-` Create directory: `d` Delete directory: `D` (asks for confirmation) Delete selected file: `D` (asks for confirmation) Create file: `%` ### NERDTree Toggle sidebar: `:NERDTreeToggle` -
hofmannsven revised this gist
Mar 13, 2018 . 1 changed file with 3 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -8,6 +8,9 @@ Vim CLI Basics ## Cheatsheet - https://vim.rtorr.com/ ## MacVim Open app: `mvim` ## Config Custom config: `~/.vimrc` -
hofmannsven revised this gist
Mar 8, 2018 . 1 changed file with 2 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -57,6 +57,8 @@ Replace char: `r` Delete: `d` Cut whole line: `dd` Cut text e.g. next word: `dw` Undo: `u` -
hofmannsven revised this gist
Feb 26, 2018 . 1 changed file with 2 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -85,6 +85,8 @@ Force quit (without saving): `ESC` + `:q!` Source current file: `:so %` Compare two files: `vim -d index1.php index2.php` ### Split view Horizontal split: `:sp` -
hofmannsven revised this gist
Dec 8, 2017 . 1 changed file with 15 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -83,4 +83,18 @@ Save and exit: `ESC` + `:x` Force quit (without saving): `ESC` + `:q!` Source current file: `:so %` ### Split view Horizontal split: `:sp` Vertical split: `:vsp` Jump up: `ctrl + k` Jump down: `ctrl + j` Jump left: `ctrl + h` Jump right: `ctrl + l` -
hofmannsven revised this gist
Dec 8, 2017 . 1 changed file with 3 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -5,6 +5,9 @@ Vim CLI Basics ## Related tutorial - https://laracasts.com/series/vim-mastery ## Cheatsheet - https://vim.rtorr.com/ ## Config Custom config: `~/.vimrc` -
hofmannsven revised this gist
Dec 8, 2017 . 1 changed file with 7 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -54,7 +54,7 @@ Replace char: `r` Delete: `d` Cut text e.g. next word: `dw` Undo: `u` @@ -64,6 +64,12 @@ Repeat last command: `.` Switch to visual mode: `v` and `V` (select entire line) Copy selected: `y` Copy entire line: `yy` Paste: `p` Save changes: `:w` Quit Vim: `:q` -
hofmannsven revised this gist
Dec 6, 2017 . 1 changed file with 3 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -2,14 +2,15 @@ Vim CLI Basics =============== ## Related tutorial - https://laracasts.com/series/vim-mastery ## Config Custom config: `~/.vimrc` ## Commands ### Navigation Insert mode: `i` -
hofmannsven revised this gist
Nov 19, 2017 . 1 changed file with 15 additions and 3 deletions.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -1,6 +1,14 @@ Vim CLI Basics =============== ## Related tutorials - https://laracasts.com/series/vim-mastery ## Config Custom config: `~/.vimrc` ## Commands Startup vim: `vim filename.txt` Insert mode: `i` @@ -39,10 +47,12 @@ Search word: `/` (Use `n` and `N` to navigate) Insert as new line: `o` and `O` Cut chars: `x` and `X` Replace char: `r` Delete: `d` Cut text e.g. next word: `dw` (use `p` to paste in again) Undo: `u` @@ -51,7 +61,7 @@ Redo: `ctrl + r` Repeat last command: `.` Switch to visual mode: `v` and `V` (select entire line) Save changes: `:w` @@ -61,4 +71,6 @@ Quit without saving: `:q!` Save and exit: `ESC` + `:x` Force quit (without saving): `ESC` + `:q!` Source current file: `:so %` -
hofmannsven revised this gist
Oct 30, 2017 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -159,7 +159,7 @@ Write to file (will overwrite existing content): `cat > sample-filename.txt` (qu Search for a filename (not content!) in the current directory: `find sample-filename.txt` Search for a string (not filename!) inside all files in the current directory: `ack "string" --php` ([documentation](https://beyondgrep.com/documentation/)) Search for a string inside all files in the current directory and subdrectories: `grep -r "string" *` -
hofmannsven revised this gist
Sep 29, 2017 . 1 changed file with 2 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -124,6 +124,8 @@ Create symlink: `ln -s source-dirname destination-dirname` Update symlink: `ln -sfn source-dirname destination-dirname` Remove symlink: `unlink sample-dirname` - `-s`: Create a symbolic link. - `-f`: If the target file already exists, then unlink it. - `-F`: If the target file already exists and is a directory, then remove/overwrite it. -
hofmannsven revised this gist
Sep 29, 2017 . 1 changed file with 2 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -122,6 +122,8 @@ Browsing directories: `pushd sample-dirname` / `popd` / `dirs` Create symlink: `ln -s source-dirname destination-dirname` Update symlink: `ln -sfn source-dirname destination-dirname` - `-s`: Create a symbolic link. - `-f`: If the target file already exists, then unlink it. - `-F`: If the target file already exists and is a directory, then remove/overwrite it. -
hofmannsven revised this gist
Sep 25, 2017 . 1 changed file with 5 additions and 5 deletions.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -122,11 +122,11 @@ Browsing directories: `pushd sample-dirname` / `popd` / `dirs` Create symlink: `ln -s source-dirname destination-dirname` - `-s`: Create a symbolic link. - `-f`: If the target file already exists, then unlink it. - `-F`: If the target file already exists and is a directory, then remove/overwrite it. - `-h`: If the target file or directory is a symbolic link, do not follow it. - `-n`: Same as `-h`, for compatibility with other `ln` implementations. -
hofmannsven revised this gist
Sep 25, 2017 . 1 changed file with 11 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -118,6 +118,17 @@ Checkout directory: `cd sample-dirname` Browsing directories: `pushd sample-dirname` / `popd` / `dirs` (see http://unix.stackexchange.com/a/77081) ### Symlinks Create symlink: `ln -s source-dirname destination-dirname` `-s`: Create a symbolic link. `-f`: If the target file already exists, then unlink it. `-F`: If the target file already exists and is a directory, then remove/overwrite it. `-h`: If the target file or directory is a symbolic link, do not follow it. `-n`: Same as `-h`, for compatibility with other `ln` implementations. Files ----------- -
hofmannsven revised this gist
Sep 16, 2016 . 1 changed file with 4 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -154,6 +154,10 @@ MD5 hash for files: `md5 sample-filename.txt` MD5 hash for folders: `tar c folder | md5sum` Encrypt file: `openssl enc -aes-256-cbc -e -in sample-filename.txt -out sample-encrypted.txt` Decrypt file: `openssl enc -aes-256-cbc -d -in sample-encrypted.txt -out sample-filename.txt` Server ----------- -
hofmannsven revised this gist
Jul 28, 2016 . 1 changed file with 3 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -150,7 +150,9 @@ Search for a string inside all files in the current directory and subdrectories: Search and replace within file: `sed -i '' 's/original-text/new-text/g' sample-filename.txt` MD5 hash for files: `md5 sample-filename.txt` MD5 hash for folders: `tar c folder | md5sum` Server -
hofmannsven revised this gist
Jul 11, 2016 . 1 changed file with 2 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -150,6 +150,8 @@ Search for a string inside all files in the current directory and subdrectories: Search and replace within file: `sed -i '' 's/original-text/new-text/g' sample-filename.txt` Validate MD5 hash: `md5 sample-filename.txt` Server ----------- -
hofmannsven revised this gist
Jul 5, 2016 . 1 changed file with 10 additions and 5 deletions.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -1,12 +1,17 @@ # Command Line Crash Course ## Related tutorials - http://cli.learncodethehardway.org/book/ - https://www.codecademy.com/courses/learn-the-command-line ## Cheatsheets - [Linux auf einem Blatt](http://helmbold.de/artikel/Linux-auf-einem-Blatt.pdf) - [Fasd](https://gist.github.com/hofmannsven/a502e525ba9f9e5fe348480183364ad8) ## Usage Note: Hold option (`alt`) and click a position in the current line to move your cursor to that position. Clear history: `ctrl + l` -
hofmannsven revised this gist
May 10, 2016 . 1 changed file with 2 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -206,6 +206,8 @@ Show site IP: `dig +short google.com` Show A Record: `dig a google.com` (Returns: `google.com. 43 IN A 123.123.123.123` aka `public-name ttl internet record-type server-address`) Webservice: https://www.whatsmydns.net/ Tools ----------- -
hofmannsven revised this gist
May 10, 2016 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -204,7 +204,7 @@ Check site feedback: `ping google.com` Show site IP: `dig +short google.com` Show A Record: `dig a google.com` (Returns: `google.com. 43 IN A 123.123.123.123` aka `public-name ttl internet record-type server-address`) Tools -
hofmannsven revised this gist
May 10, 2016 . 1 changed file with 2 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -204,6 +204,8 @@ Check site feedback: `ping google.com` Show site IP: `dig +short google.com` Show A Record: `dig a google.com` Tools ----------- -
hofmannsven revised this gist
Feb 23, 2016 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -97,7 +97,7 @@ List directory (wildcard matching): `ls *.txt` List all files of type: `find . -name "*.txt" -print` Go back to previous directory: `cd -` Make (empty) directory: `mkdir sample-dirname` -
hofmannsven revised this gist
Feb 22, 2016 . 1 changed file with 6 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -29,6 +29,12 @@ Finding Help: `apropos directory` / `apropos search` (...) Define custom startup screen: `sudo nano /etc/motd` Run a script as background process: `python script.py &` List all running process's: `ps aux` Kill a running process: `sudo kill 12345` System ----------- -
hofmannsven revised this gist
Jan 21, 2016 . 1 changed file with 4 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -35,6 +35,10 @@ System Get the current path: `pwd` Copy to clipboard: `pwd | pbcopy` Paste: `pbpaste` Get the current hostname: `hostname` Get the current users: `users` -
hofmannsven revised this gist
Jan 17, 2016 . 1 changed file with 7 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -198,4 +198,10 @@ Show site IP: `dig +short google.com` Tools ----------- [Tree](http://mama.indstate.edu/users/ice/tree/tree.1.html): `brew install tree` Security ----------- Fix OpenSSH Client Bug: https://www.digitalocean.com/community/questions/openssh-client-bug-cve-2016-0777-and-cve-2016-0778 -
hofmannsven revised this gist
Jan 14, 2016 . 1 changed file with 11 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -63,6 +63,17 @@ Change owner: `chown root index.php` (`root` is the username) Change group: `chgrp www-data index.php` (`www-data` is the groupname) WordPress Files/Folder Permissions ----------- Let apache be owner: `chown www-data:www-data -R *` Change directory permissions rwxr-xr-x: `find . -type d -exec chmod 755 {} \;` Change file permissions rw-r--r--: `find . -type f -exec chmod 644 {} \;` (see http://stackoverflow.com/a/18352747/1815847) Directories ----------- -
hofmannsven revised this gist
Jan 6, 2016 . 1 changed file with 2 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -108,6 +108,8 @@ Copy/Page folder with content: `cp -a folder/ new_folder` Move/Rename file: `mv current-filename.txt new-filename.txt` Move/Rename file and prompt before overwriting an existing file: `mv -i current-filename.txt new-filename.txt` Remove file: `rm sample-filename.txt` View file: `less sample-filename.txt` / `more sample-filename.txt` -
hofmannsven revised this gist
Oct 25, 2015 . 1 changed file with 7 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -175,6 +175,13 @@ Functions Calculate (returns only `int`): `echo $((123/2))` Web ----------- Check site feedback: `ping google.com` Show site IP: `dig +short google.com` Tools -----------
NewerOlder