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 characters
| See Editor: | |
| - $ echo $EDITOR | |
| Flow: | |
| - $ CTRL + U (Cut everything to beginning of line) | |
| - $ insert something at the beginning, e.g. sudo | |
| - $ CTRL + Y (Paste what was cut) | |
| Go to beginning: | |
| - $ CTRL + A |
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 characters
| Create Executable: | |
| - $ go build <filename>.go | |
| Create Binaries and executables: | |
| - $ go install <filename>.go | |
| Run file: | |
| - $ go run <filename>.go | |
| Run multiple file: |
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 characters
| # Netstat | |
| Display process/service running on specified port | |
| - $ netstat -na | grep "8080" | |
| or | |
| - $ lsof -i :8080 //returns the PID (process id) that runs on port 8080 | |
| Kill process/service running on specified port | |
| PID | |
| - $ kill <pid> |
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 characters
| # Workflow - work on coworker's branch | |
| 1. `fetch` all remote branches | |
| - $ git fetch origin | |
| 2. Check branch available for checkout | |
| - $ git branch -a | |
| 3. Make local copy of branch | |
| - $ git checkout -b <name-your-branch> origin/<name-of-remote-branch> | |
| Remove file from GitHub - remove from index: |
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 characters
| To start: | |
| - $ psql | |
| Create DB: | |
| - $ CREATE DATABASE <name>; | |
| Connect to DB: | |
| - $ \c <dbname> | |
| List all dbs: |
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 characters
| As of Kafka 2.2, you can instead use --bootstrap-server localhost:9092 in your kafka topics command | |
| kafka-topics: | |
| - $ kafka-topics --bootstrap-server localhost:9092 --topic <name> --create --partitions 3 --replication-factor 1 | |
| - (127.0.0.1:9092) | |
| List topics: | |
| - $ kafka-topics --bootstrap-server localhost:9092 --list |
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 characters
| Key Commands: | |
| ------------------ | |
| Delete Line: | |
| Shift + Cmd + K | |
| Copy Line Down/Up: | |
| Shift + Opt + Down | |
| Shift + Opt + Up | |
| Insert cursor: |
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 characters
| Install JDK - also installs JRE | |
| 1. Verify if Java is installed | |
| 1.1 In Terminal type: $ java -version | |
| 2. Install Java JDK | |
| 2.1 Open .dmg folder | |
| 2.2 Open .pkg folder | |
| 3. Set Java Home env variable | |
| 3.1 Quit Terminal and re-open to refresh session | |
| 3.2 Query current java home path using Commands 1. | |
| 3.3 Open ~/.bash_profile |
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 characters
| Build image - go to the root directory where the image is located: | |
| $ docker build -t <imagename> . | |
| Run Container: | |
| $ docker run -d -p 5000:5000 <imagename> | |
| Query the container port to see if running: | |
| $ docker ps | |
| $ curl http://localhost:5000 |
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 characters
| # My Additions | |
| Add remotes: | |
| - $ git remote add <shortname> <url> | |
| Create branch: | |
| - $ git branch <newbranchname> | |
| Switch branch: | |
| - $ git checkout <branchname> | |
| Altogether: |