Skip to content

Instantly share code, notes, and snippets.

@wilsonfisk
wilsonfisk / http-serve.sh
Last active April 13, 2018 21:29
bash script to serve a directory using the given language & port. Can also be put in '.bashrc' or '.bash_aliases'.
#!/bin/sh
LANG=${$1:-python}
PORT=${$2:-8000}
serve(){
if [ $# -lt 2 ]; then
printf "Usage: ./http-serve.sh <language> <port>\\nAvailable Servers: bash node-http-server node-static php\\npython python3 python-twisted ruby"
else
# FIX: Check if 'index.html' exists.
# FIX: Also check permissions
printf "Serving %s/Public/index.html with %s @ %s.hashbang.sh:%s" "$HOME" "$LANG" "$HOSTNAME" "$PORT"
/*
* SEP firmware split tool
*
* Copyright (c) 2017 xerub
*/
#include <fcntl.h>
#include <stddef.h>
#include <stdio.h>
#include <stdlib.h>

Keybase proof

I hereby claim:

  • I am wilsonfisk on github.
  • I am wilsonfisk (https://keybase.io/wilsonfisk) on keybase.
  • I have a public key whose fingerprint is 50FB 7DFF 04AA 77B1 4303 7EC2 D5EC 9B53 4D10 F1FD

To claim this, I am signing this object: