mkdir temp; cd temp
curl -LO https://gist.githubusercontent.com/RichardBronosky/33e4ce3b4718cd73162481804a33fe94/raw/SimpleHTTPServerWithUpload.py
python2 SimpleHTTPServerWithUpload.py 8080
or
mkdir temp; cd temp
mkdir temp; cd temp
curl -LO https://gist.githubusercontent.com/RichardBronosky/33e4ce3b4718cd73162481804a33fe94/raw/SimpleHTTPServerWithUpload.py
python2 SimpleHTTPServerWithUpload.py 8080
or
mkdir temp; cd temp
#!/bin/bash | |
# Usage: AIO_KEY=key_hash FEED_KEY=name_of_feed VALUE=an_integer send_io.sh | |
# Specify any or none of the environment variables | |
aio_key="${AIO_KEY:-feedfacedeadbeef}" # default: replace everything after the - | |
feed_key="${FEED_KEY:-myfeedname}" # default: replace everything after the - | |
value="$(sed 's/"/\\"/g' <<<"${VALUE:-$(( ( RANDOM % 25 ) + 1 ))}")" # default: random int between 0 and 25 | |
curl -H "X-AIO-Key: $aio_key" \ |
#!/bin/bash -e | |
# Quick start-stop-daemon example, derived from Debian /etc/init.d/ssh | |
NAME=blink | |
DIR=/home/pi | |
PIDFILE=/home/pi/$NAME.pid | |
DAEMON=/home/pi/pi_gpio_hack.py | |
DAEMON_ARGS="[[31,0,37,1],[31,1,37,0]]" | |
STOP_SIGNAL=INT |
This is the minimum you should memorize to feel at home on any server your SSH into. There are many cheatsheets out there that try to be exhaustive, or suggest mapping shit to more convenient locations, but that is not the goal of this one. Everyone should use tmux for every connection, to every server, always. Memorizing this brings down the barrier to doing so.
Session is a set of windows, plus a notion of which window is current.
#!/bin/bash | |
# | |
# This version uses September 2017 august stretch image, please use this image | |
# | |
if [ "$EUID" -ne 0 ] | |
then echo "Must be root" | |
exit | |
fi |
Yes - you can create a Kubernetes cluster with Raspberry Pis with the default operating system called Raspbian. This means you can carry on using all the tools and packages you're used to with the officially-supported OS.
This is part of a blog post Serverless Kubernetes home-lab with your Raspberry Pis written by Alex Ellis.
Copyright disclaimer: Please provide a link to the post and give attribution to the author if you plan to use this content in your own materials.
#!/usr/bin/env python2.7 | |
""" Print all of the (git/ssh or http) urls for all repos (public or | |
private+public with personal_token) in a GitHub account (user or organization). | |
Usage example:: | |
[HTTP_URLS=1] python2.7 list-all-repos.py account_name [personal_token] | |
It requires the pygithub3 module, which you can install on macos (Mac OSX) like this:: | |
# get pip if you don't have it |
#!/bin/bash -eu | |
# | |
# List all VPCs in region and delete them | |
main(){ | |
if [ -z "$1" ]; then | |
echo "Usage: $0 <region> [<region> ...]" | |
exit 64 | |
fi |
It used to be possible to fork your own gists via the browser using a little JS magic. This is no longer the case. As an alternative, you can use Chris Wanstrath's https://github.com/defunkt/gist cli tool to do the next best thing.
gist-fork git@gist.github.com:fcc543f7f1cfba404caf5ce276cc0951.git
#!/bin/bash -eu | |
aws.setup-credentials(){ | |
local FILE="${1:--/dev/null}" | |
local file_paths_to_check=( | |
"$FILE" | |
"./accessKeys.csv" | |
"$HOME/accessKeys.csv" | |
"$HOME/Downloads/accessKeys.csv" | |
) |