Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.
$ python -m SimpleHTTPServer 8000Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.
$ python -m SimpleHTTPServer 8000| #!/usr/bin/env zsh | |
| # This script prints a bell character when a command finishes | |
| # if it has been running for longer than $zbell_duration seconds. | |
| # If there are programs that you know run long that you don't | |
| # want to bell after, then add them to $zbell_ignore. | |
| # | |
| # This script uses only zsh builtins so its fast, there's no needless | |
| # forking, and its only dependency is zsh and its standard modules | |
| # |
| function l { | |
| if [[ ! -t 0 ]]; then | |
| # stdin is not connected to a tty | |
| pager - | |
| elif [[ $# -eq 1 && -f "$1" ]]; then | |
| # single argument names a file | |
| pager "$1" | |
| else | |
| ls -CFL $* | |
| fi |
| module MyApp | |
| class Application < Rails::Application | |
| # Allows us to read configuration from unconventional places | |
| # (e.g. /etc). | |
| # | |
| # To use: | |
| # config/config_paths.yml: | |
| # development: | |
| # config/blah: config/blah.yml | |
| # |
This configuration works with Upstart on Ubuntu 12.04 LTS
The reason why it needs to be done this way (i.e. with the pre-start and post-stop stanzas), is because Upstart
is unable to track whever Unicorn master process re-execs itself on hot deploys. One can use it without hot-deploys
and run Unicorn in foreground also, it then only needs one exec stanza.
This presumes you are not using RVM, so no voodoo dances.
| #! /usr/bin/env zsh | |
| user="$1" | |
| env="$2" | |
| function usage { | |
| cat <<EOF 2>&1 | |
| usage: ru rails_user rails_env command args... | |
| Run command as rails_user with RAILS_ENV=rails_env. |
| #!/bin/sh | |
| ### | |
| # SOME COMMANDS WILL NOT WORK ON macOS (Sierra or newer) | |
| # For Sierra or newer, see https://github.com/mathiasbynens/dotfiles/blob/master/.macos | |
| ### | |
| # Alot of these configs have been taken from the various places | |
| # on the web, most from here | |
| # https://github.com/mathiasbynens/dotfiles/blob/5b3c8418ed42d93af2e647dc9d122f25cc034871/.osx |
| #!/bin/bash -ex | |
| # Paste this into ssh | |
| # curl -sL https://gist.github.com/andsens/2913223/raw/bootstrap_homeshick.sh | tar -xzO | /bin/bash -ex | |
| # When forking, you can get the URL from the raw (<>) button. | |
| ### Set some command variables depending on whether we are root or not ### | |
| # This assumes you use a debian derivate, replace with yum, pacman etc. | |
| aptget='sudo apt-get' | |
| chsh='sudo chsh' |
| #! /bin/zsh | |
| usage () { | |
| echo "usage: ${0:t} [-f known_hosts] host..." | |
| } | |
| KNOWN_HOSTS="$HOME/.ssh/known_hosts" | |
| expanded_hosts() { | |
| case $(uname) in |
| def output name=((default=true); "caius") | |
| puts "name: #{name.inspect}" | |
| puts "default: #{default.inspect}" | |
| end | |
| output | |
| # >> name: "caius" | |
| # >> default: true | |
| output "avdi" |