Skip to content

Commit

Permalink
Update
Browse files Browse the repository at this point in the history
  • Loading branch information
abregman committed Jul 8, 2022
1 parent e0f7a88 commit 65b0e6f
Show file tree
Hide file tree
Showing 5 changed files with 59 additions and 1 deletion.
6 changes: 6 additions & 0 deletions resources/aws.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,3 +86,9 @@ aws ec2 authorize-security-group-ingress \
--port 80 \
--cidr 0.0.0.0/0
```

### RDS

* Encryption in PostgreSQL: `rds.force_ssl=1 (parameter groups)`
* Encryption in MySQL: `GRANT USAGE ON *.* TO 'mysqluser'@'%' REQUIRE SSL;`

5 changes: 5 additions & 0 deletions resources/git.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,3 +47,8 @@ Name | Comments
git revert --no-commit X..HEAD
git commit
```

#### References

* All references in current repository: `find .git/refs/`
* Update master reference: `git update-ref refs/heads/master <SOME_COMMIT>`
29 changes: 29 additions & 0 deletions resources/github.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# GitHub

## Common Issues

* 'can't sync because main is not tracking [PROJECT NAME]'

This happens the branch is no longer tracking main from upstream. Can be fixed with this command: `git push --set-upstream origin main`.

## Cheat Sheet

### Repository

* Clone repository: `gh clone <REPO NAME>`
* Sync your fork from source repo: `gh repo sync --source <USERNAME>/<REPONAME>`

### Pull Requests

* Create PR: `gh pr create --title "Some Pull Request ;)`
* List PRs: `gh pr list`
* Change to PR (aka checkout): `gh pr checkout <PR NUMBER>`
* Update PR: `git push`

### CI

* List builds/workflow runs: `gh run list`

### Rebase

* Rebase current branch commits on top of latest changes in main branch: `git rebase origin/main`
5 changes: 5 additions & 0 deletions resources/linux.md
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,11 @@ sudo ausearch -m avc -m user_avc -m selinux_err -m user_selinux_err -i -ts today
* Sort files by size: `ls -l | sort -nk5`
* Find broken links: `find /some/path -type l -exec test ! -e {} \; -print`

#### YAML

* Validate YAML file with Ruby: `ruby -ryaml -e "p YAML.load(STDIN.read)" < some_file.yaml`
* Validate YAML file with Python: `pip install pyyaml; python -c 'import yaml, sys; print(yaml.safe_load(sys.stdin))' < some_file.yaml`

#### Misc

* Generate 8 digit random number: `shuf -i 9999999-99999999 -n 1`
Expand Down
15 changes: 14 additions & 1 deletion resources/python.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,14 +43,15 @@ Megha Mohan | [Mutable vs Immutable Objects in Python](https://medium.com/@megha
Kenneth Reitz | [The Hitchhiker’s Guide to Python](http://docs.python-guide.org/en/latest) | | |
Kenneth Reitz | [Serialization](https://docs.python-guide.org/scenarios/serialization/) | | |

## Frameworks & Tools
## Libraries, Frameworks & Tools

Name | Description
:------:|:-------:
[Natural Language Toolkit](https://www.nltk.org) | Platform for language processing programming |
[Flask](http://flask.pocoo.org) | Web microframework based on Werkzeug, Jinja 2
[Django](https://www.djangoproject.com) | Web framework with batteries included
[Mypy](http://mypy-lang.org) | Static type checker
[Pandas](https://pandas.pydata.org) | "open source data analysis and manipulation tool"

### Cheat Sheet

Expand All @@ -73,6 +74,18 @@ with Connection(host) as conn:
...
```

#### Dictionaries

* Define dictionary: `some_dict = {'first_number': 2017, 'second_number': 2022}`
* Add item to dictionary: `some_dict['third_number'] = 1991`
* Remove last item: `some_dict.popitem()`
* Remove item by key: `some_dict.pop("third_number")`
* Get all keys without values: `some_dict.keys()`
* Get all values without keys: `some_dict.values()`
* Access item: `some_dict['first_number']` or `some_dict.get('second_number')`
* Number of items in the dictionary: `len(some_dict)`
* Update value of a certain key: `some_dict.update({"first_number": 02017})

## Python Checklist

<div align="center"><img src="images/python_map.png"></div><hr/>
Expand Down

0 comments on commit 65b0e6f

Please sign in to comment.