A "Best of the Best Practices" (BOBP) guide to developing in Python.
- "Build tools for others that you want to be built for you." - Kenneth Reitz
- "Simplicity is alway better than functionality." - Pieter Hintjens
| #!/bin/bash | |
| PASS=`pwgen -s 40 1` | |
| mysql -uroot <<MYSQL_SCRIPT | |
| CREATE DATABASE $1; | |
| CREATE USER '$1'@'localhost' IDENTIFIED BY '$PASS'; | |
| GRANT ALL PRIVILEGES ON $1.* TO '$1'@'localhost'; | |
| FLUSH PRIVILEGES; | |
| MYSQL_SCRIPT |
| # place this file in ~/.config/terminator/config | |
| [global_config] | |
| title_transmit_bg_color = "#d30102" | |
| focus = system | |
| [keybindings] | |
| reset_clear = <Ctrl>R | |
| new_tab = <Ctrl>T | |
| split_horiz = <Ctrl><Shift>E | |
| split_vert = <Ctrl>E | |
| close_term = <Ctrl><Shift>W |
| #!/bin/bash | |
| # bash generate random alphanumeric string | |
| # | |
| # bash generate random 32 character alphanumeric string (upper and lowercase) and | |
| NEW_UUID=$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 32 | head -n 1) | |
| # bash generate random 32 character alphanumeric string (lowercase only) | |
| cat /dev/urandom | tr -dc 'a-z0-9' | fold -w 32 | head -n 1 |
| # If you work with git, you've probably had that nagging sensation of not knowing what branch you are on. Worry no longer! | |
| export PS1="\\w:\$(git branch 2>/dev/null | grep '^*' | colrm 1 2)\$ " | |
| # This will change your prompt to display not only your working directory but also your current git branch, if you have one. Pretty nifty! | |
| # ~/code/web:beta_directory$ git checkout master | |
| # Switched to branch "master" | |
| # ~/code/web:master$ git checkout beta_directory | |
| # Switched to branch "beta_directory" |