###Compare single file between versions and pipe the diff to a new file for better view:
git diff branch1..branch2 -- filename > difffile
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
| #!/bin/bash | |
| # Dependencies: dynamo-archive | |
| # In case there is some big tables, it is advisable to dedicate a process for each big table | |
| # and another process for the rest, since this can work in parallel | |
| # Can use https://github.com/bchew/dynamodump which is faster and easier | |
| key=<AWS access key> | |
| secret=<AWS secret> | |
| region=<AWS region> |
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
| # Querying using query() is only allowed for primary and indexed keys. This work around allows querying using any field. | |
| aws dynamodb scan --table-name <TABLE> --filter-expression "fieldname = :c" --expression-attribute-values file://expression-attribute-values.json > <OUTPUT>.json |
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
| # Remove the property from the item | |
| aws dynamodb update-item --table-name <TABLE_NAME> --key file://key.json --update-expression "REMOVE #X" --expression-attribute-names file://expression-attribute-names.json --return-values ALL_NEW |
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
| # List all process whose name contains some string | |
| ps aux | grep <string> | |
| # List all process listening to a particular port | |
| lsof -i :<port number> | |
| # List all running processes | |
| ps -A | |
| # Killall process that match a specific name |
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
| # Connect to remote redis server | |
| # Note: If server is hosted on EC2, it's isolated inside VPC and doesn't have ICMP available. | |
| # Therefore, either do the command from inside EC2 or setup SSH tunnel to run from local | |
| redis-cli -h <server IP address> -p <port> [command] | |
| # Install Redis properly on server (rmb to change daemon to 'yes' in redis.conf) | |
| # If failed, do it manually according to this guide http://redis.io/topics/quickstart | |
| sudo ./utils/install-server.sh | |
| # Start redis server as a daemon (need to install using the above method first) |
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
| # ssh tunneling through a remote server | |
| # local port forwarding | |
| # -f is for ssh to go to background | |
| # -N is to not execute a command on remote host | |
| ssh -L <local port>:<destination host>:<destination port> <remote username>@<remote host> -f -N | |
| # then either go to http://localhost:<local port> or in case using DBs like Redis | |
| # Example: ssh -L 3001:google.com:80 [email protected] will forward all http://localhost:3001 through server.com to google.com:80 | |
| # Example: ssh -L 3001:redishost.com:6379 [email protected] | |
| # then |
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
| General philosophy: | |
| - Unit test -> Prune (to reduce complexity) -> Test -> Redesign -> Test -> Redecorate -> Test -> New feature -> Test |
- Flux https://justgetflux.com/ (eyecare)
- Huge list: https://github.com/jaywcjlove/awesome-mac/blob/master/README-en.md
- Dozer https://github.com/Mortennn/Dozer
- Xbar https://xbarapp.com/
- Amphetamine https://apps.apple.com/us/app/amphetamine/id937984704?mt=12
- Command+click for definition https://gist.github.com/kendellfab/6135193
- Remember selection, bookmark, folding https://github.com/titoBouzout/BufferScroll
- FileDiffs
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 a ~/.profile to let any kind of shell inherit from it | |
| When executing a command, do note what kind of shell it's executing on top of. |
OlderNewer