Rsync watcher - https://github.com/axkibe/lsyncd
Reuse SSH connections - http://www.revsys.com/writings/quicktips/ssh-faster-connections.html
Good way to Git - https://sandofsky.com/blog/git-workflow.html
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
| # Linux/Mac - No windows | |
| # Quickly share your code/script with others that have ssh access to the same server. | |
| # Include one or both functions inside your ~/.bash_aliases. | |
| # `gitinitrepo` needs `gitserverepo`, otherwise it just inits a git repo | |
| # To use, change the SERVER1, SERVER2, SHORTNAME1, SHORTNAME2 variables to whatever you want | |
| # adding or removing if you want as well. | |
| # Then inside the folder without a git repo attached |
- A lot of these are built-in and some are my personal shortcuts. In the future I will mark defaults vs. changed
- On my Mac, the CMD key and CTRL key are swapped, so whererever you see CMD, it will be the default CTRL and vice versa
- For MY sanity, I kept it that way so I am not second guessing myself.
| Key | Command |
|---|
TODO: Turn into a .js file or npm module
TODO: Improve the single object version and demonstrate good usage with function parameters
TODO: Seperate arrays from objects
Supports: string, number, object, function, boolean
- This would/will be the npm module
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
| # Because I'm not entirely sure if all the previous steps were needed or only the final one, I included other problems | |
| # that may cause the node-gyp rebuild to fail during java installation (or bcrypt throwing install errors) | |
| # This assumes you are using 7.8 "wheezy" | |
| # More information regarding other distros: https://nodejs.org/en/download/package-manager/#debian-and-ubuntu-based-linux-distributions | |
| # Use the correct node version for the Raspberry ARM architecture: | |
| # https://stackoverflow.com/questions/32563173/installing-node-js-on-raspberry-pi-2 | |
| wget http://yourARMarchitecurelink | |
| cd /usr/local |
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
| # Try your best to remove root login and if possible, password authentication (after ssh keys work) | |
| cat ~/.ssh/id_rsa.pub | ssh username@yourip "cat >> ~/.ssh/authorized_keys" |
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
| # Source/Reference https://serverfault.com/questions/275669/ssh-sshd-how-do-i-set-max-login-attempts#275672 | |
| # Before enabling, be sure you | |
| # a) Know you're public ip address | |
| # b) Know that your public ip address won't change (fixed ip) | |
| # c) Have a backup method to get in just in case (Digital Ocean's "console" for example) | |
| # sudp apt-get install ufw | |
| # sudo ufw allow to any port 22 from your.ip.address.here proto tcp | |
| # sudo ufw enable |
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
| # Have a printer hooked up to linux os | |
| # Have CUPS installed on it and make sure the printer prints from linux | |
| # Have abiword (This is used to convert file to pdf via command line) | |
| # sudo apt-get install abiword | |
| cat dev.json | ssh user@ip 'cat - > tmp.doc; abiword --to=pdf tmp.doc; lp tmp.pdf; rm tmp.doc' | |
| # Havent tested with removing the pdf right after issuing lp, might work. | |
| # Also havnt tested converting other files besides .doc to .pdf |
- Change post-update.sample to post-update
- Have the below command inside post-update
GIT_WORK_TREE=/home/path/to/working/dir/mytest git checkout -f
git rev-parse --short <branchname>