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 8000| From nobody Mon Apr 20 12:02:54 2015 | |
| Content-Type: multipart/mixed; boundary="===============0102662315==" | |
| MIME-Version: 1.0 | |
| --===============0102662315== | |
| MIME-Version: 1.0 | |
| Content-Type: text/cloud-config; charset="us-ascii" | |
| Content-Transfer-Encoding: 7bit | |
| Content-Disposition: attachment; filename="log_debug.yaml" | |
| #cloud-config | |
| # Enable full debug logging... |
| pkgs: attrs: | |
| with pkgs; | |
| let defaultAttrs = { | |
| builder = "${bash}/bin/bash"; | |
| args = [ ./builder.sh ]; | |
| setup = ./setup.sh; | |
| baseInputs = [ gnutar gzip gnumake gcc binutils coreutils gawk gnused gnugrep patchelf findutils ]; | |
| buildInputs = []; | |
| system = builtins.currentSystem; | |
| }; |
| #!/bin/bash | |
| # Descriprion: | |
| # This simple script creates a local sd image backup of a remote raspberry pi in a local folder | |
| # using ssh, dd, and the unix pipe | |
| # Author: Fabio Nisci | |
| # Date: 23/Apr/2014 | |
| # Requirements: | |
| # - ssh | |
| # - sshpass (auto installation) |
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 8000| // Dependency resolution, adapted from https://gist.github.com/1232505/f16308bc14966c8d003c2686b1c258ec41303c1f | |
| function resolve(graph) { | |
| var sorted = [], // sorted list of IDs ( returned value ) | |
| visited = {}; // hash: id of already visited node => true | |
| // 2. topological sort | |
| Object.keys(graph).forEach(function visit(name, ancestors) { | |
| if (!Array.isArray(ancestors)) ancestors = []; | |
| ancestors.push(name); | |
| visited[name] = true; |
| #!/usr/bin/env bash | |
| ############################################################################## | |
| #### MIME interface | |
| ############################################################################## | |
| # Parse message in MIME format and create a temporary cache directory | |
| mime_parse() | |
| { | |
| MIME_CACHE=${MIME_CACHE:-`mktemp -d ${BIN}.XXXXXXXXXX`} |
| #!/bin/bash | |
| # Fallback base64 en-/decoder for systems that lack a native implementation | |
| # | |
| # @param ... - flags | |
| which base64 &>/dev/null || { | |
| # if even od is missing | |
| which od &>/dev/null || od() | |
| { | |
| local C O=0 W=16 |
| Copyright 2012 Shin Suzuki<shinout310@gmail.com> | |
| Licensed under the Apache License, Version 2.0 (the "License"); | |
| you may not use this file except in compliance with the License. | |
| You may obtain a copy of the License at | |
| http://www.apache.org/licenses/LICENSE-2.0 | |
| Unless required by applicable law or agreed to in writing, software | |
| distributed under the License is distributed on an "AS IS" BASIS, |
| I turned this gist into a "real" repository. It is here: http://github.com/pete/cats . | |
| Here, placed side-by-side for comparison, are GNU's implementation of | |
| cat, Plan 9's implementation, Busybox's implementation, and NetBSD's | |
| implementation, Seventh Edition Unix (1979), and 4.3BSD. | |
| For good measure (and because I suppose I am now committed to collecting | |
| cats) also included are Second Edition Unix (in assembly) and Inferno's | |
| implementation (in Limbo) for good measure. |
| # 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" |