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| # !/bin/bash | |
| # Copyright (c) 2011 Float Mobile Learning | |
| # http://www.floatlearning.com/ | |
| # | |
| # Permission is hereby granted, free of charge, to any person obtaining | |
| # a copy of this software and associated documentation files (the "Software"), | |
| # to deal in the Software without restriction, including without limitation | |
| # the rights to use, copy, modify, merge, publish, distribute, sublicense, | |
| # and/or sell copies of the Software, and to permit persons to whom the |
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| # LVDB - LLOOGG Memory DB | |
| # Copyriht (C) 2009 Salvatore Sanfilippo <[email protected]> | |
| # All Rights Reserved | |
| # TODO | |
| # - cron with cleanup of timedout clients, automatic dump | |
| # - the dump should use array startsearch to write it line by line | |
| # and may just use gets to read element by element and load the whole state. | |
| # - 'help','stopserver','saveandstopserver','save','load','reset','keys' commands. | |
| # - ttl with milliseconds resolution 'ttl a 1000'. Check ttl in dump! |
Sometimes a programming language has a "strict mode" to restrict unsafe constructs. E.g., Perl has use strict, Javascript has "use strict", and Visual Basic has Option Strict. But what about bash? Well, bash doesn't have a strict mode as such, but it does have an unofficial strict mode:
set -euo pipefail
set -e
| const puppeteer = require('puppeteer'); | |
| const devices = require('puppeteer/DeviceDescriptors'); | |
| const Good3G = { | |
| 'offline': false, | |
| 'downloadThroughput': 1.5 * 1024 * 1024 / 8, | |
| 'uploadThroughput': 750 * 1024 / 8, | |
| 'latency': 40 | |
| }; | |
This tutorial is dated Oct 2021, if it's much further on than that this information might be out of date.
This is a guide on setting up a static HTTPS website on your raspberry pi using docker and nginx. The aim is to have this running on the raspberry pi and to be able to access it from a host computer on the same local network. You should already be able to ssh into your pi from your host computer and have raspberry pi OS set up.
| addEventListener("fetch", event => { | |
| event.respondWith(handleRequest(event.request)) | |
| }) | |
| function jsonResponse(o) { | |
| return new Response(JSON.stringify(o), { | |
| headers: { | |
| "content-type": "application/json;charset=UTF-8", | |
| 'Access-Control-Allow-Origin': '*', | |
| } |
| addEventListener("fetch", event => { | |
| event.respondWith(handleRequest(event.request)) | |
| }) | |
| let body = {}; | |
| async function handleRequest(request) { | |
| let content = "just drop if it fails...okay ?"; | |
| for( var i of request.headers.entries() ) { | |
| content += i[0] + ": " + i[1] + "\n"; | |
| } | |
| let respContent = ""; |