start new:
tmux
start new with session name:
tmux new -s myname
| #!/usr/bin/env python | |
| """ | |
| Very simple HTTP server in python (Updated for Python 3.7) | |
| Usage: | |
| ./dummy-web-server.py -h | |
| ./dummy-web-server.py -l localhost -p 8000 | |
| Send a GET request: |
| #!/bin/bash | |
| FILES=`git ls-tree --name-only HEAD .` | |
| MAXLEN=0 | |
| IFS=$(echo -en "\n\b") | |
| for f in $FILES; do | |
| if [ ${#f} -gt $MAXLEN ]; then | |
| MAXLEN=${#f} | |
| fi | |
| done |
| from BaseHTTPServer import BaseHTTPRequestHandler | |
| import urlparse, json | |
| class GetHandler(BaseHTTPRequestHandler): | |
| def do_GET(self): | |
| parsed_path = urlparse.urlparse(self.path) | |
| message = '\n'.join([ | |
| 'CLIENT VALUES:', | |
| 'client_address=%s (%s)' % (self.client_address, |
| import argparse | |
| import logging | |
| parser = argparse.ArgumentParser() | |
| parser.add_argument('--verbose', '-v', action='count', default=1) | |
| args = parser.parse_args() | |
| args.verbose = 70 - (10*args.verbose) if args.verbose > 0 else 0 | |
| logging.basicConfig(level=args.verbose, format='%(asctime)s %(levelname)s: %(message)s', |
| import java.util.HashMap; | |
| import spark.Filter; | |
| import spark.Request; | |
| import spark.Response; | |
| import spark.Spark; | |
| /** | |
| * Really simple helper for enabling CORS in a spark application; | |
| */ | |
| public final class CorsFilter { |
| #!/usr/bin/env bash | |
| # Enable or disable git hooks | |
| #find .git/hooks/ -type f ! -name "*.*" | |
| gitHooks=.git/hooks/ | |
| echo "git Hooks $gitHooks" | |
| option="${1}" |
| ############################################################################ | |
| # # | |
| # ------- Useful Docker Aliases -------- # | |
| # # | |
| # # Installation : # | |
| # copy/paste these lines into your .bashrc or .zshrc file or just # | |
| # type the following in your current shell to try it out: # | |
| # wget -O - https://gist.githubusercontent.com/jgrodziski/9ed4a17709baad10dbcd4530b60dfcbb/raw/d84ef1741c59e7ab07fb055a70df1830584c6c18/docker-aliases.sh | bash | |
| # # | |
| # # Usage: # |
| #!/bin/bash | |
| name=$RANDOM | |
| url='http://localhost:9093/api/v1/alerts' | |
| echo "firing up alert $name" | |
| # change url o | |
| curl -XPOST $url -d "[{ | |
| \"status\": \"firing\", |
Clone project
Checkout all branches that contain the files that should be moved
Delete the remote
Run the filter-branch command:
git filter-branch --tree-filter 'mkdir -p /path/to/tmp; mv * /path/to/tmp; mkdir subdir; mv /path/to/tmp/* subdir/' --tag-name-filter cat --prune-empty -- --all