create a new dir
$ mkdir /tmp/ruby
$ cd /tmp/ruby
create extconf.rb
| # | |
| # mmm m m mmm mmm mmm mmmmm mmm | |
| # " # "m m m" #" # # " #" "# # # # #" # | |
| # m"""# #m#m# #"""" """m # # # # # #"""" | |
| # "mm"# # # "#mm" "mmm" "#m#" # # # "#mm" | |
| # | |
| # nginx configuration For Ruby/Rack web applications | |
| # | |
| # Cooked up with style, care and a bit of *secret* | |
| # nerdy spice. :-) |
create a new dir
$ mkdir /tmp/ruby
$ cd /tmp/ruby
create extconf.rb
| #!/usr/bin/env bash | |
| # | |
| # Wraps curl with a custom-drawn progress bar. Use it just like curl: | |
| # | |
| # $ curl-progress -O http://example.com/file.tar.gz | |
| # $ curl-progress http://example.com/file.tar.gz > file.tar.gz | |
| # | |
| # All arguments to the program are passed directly to curl. Define your | |
| # custom progress bar in the `print_progress` function. | |
| # |
| #!/usr/bin/env bash | |
| function aliasestext() | |
| { | |
| cat<<EOF | |
| alias gplom="git pull origin master" | |
| alias gpsom="git push origin master" | |
| alias gcow='git checkout work' | |
| alias gcom='git checkout master' | |
| alias gmw='git merge work' |
| #!/usr/bin/env bash | |
| git config -l | grep -q -i nicholas | |
| if [ $? -ne 0 ] | |
| then | |
| echo "Setting Git Configs (username, email, color.ui)" | |
| git config --global user.name "Nicholas Fine" | |
| git config --global user.email [email protected] | |
| git config --global color.ui true |
| #!/usr/bin/env bash | |
| # This is my setup for Vim. This will install the janus set of plugins | |
| # as well as create my specific vim customizations | |
| # Ensure required packages are installed. | |
| REQUIRED_PACKAGES="bash vim git curl" | |
| for package in $REQUIRED_PACKAGES | |
| do | |
| command -v $package >/dev/null && continue || { echo "Package: $package is required, please install it"; exit 1; } |
| upstream puma { | |
| server unix:///var/www/app/shared/tmp/sockets/puma.sock fail_timeout=0; | |
| } | |
| server { | |
| listen 80 default deferred; | |
| server_name example.com; | |
| rewrite ^/(.+) https://example.com/$1 permanent; | |
| } |
Magic words:
psql -U postgresSome interesting flags (to see all, use -h or --help depending on your psql version):
-E: will describe the underlaying queries of the \ commands (cool for learning!)-l: psql will list all databases and then exit (useful if the user you connect with doesn't has a default database, like at AWS RDS)