To run the API, following settings need to be exported as env variables
- VAPID email
- VAPID private key path
- VAPID public key path
# ---------------------------------------------------------------------- | |
# WARNING - do not edit this template unless you know what you are doing | |
# ---------------------------------------------------------------------- | |
# the parent cache | |
# disk and memory cache settings | |
cache_dir ufs /usr/local/squid/var/cache 500 16 256 #set your cache path with size |
node_modules/* | |
*.data |
import requests | |
#http://docs.python-requests.org/en/latest/user/quickstart/#post-a-multipart-encoded-file | |
url = "http://localhost:5000/" | |
fin = open('simple_table.pdf', 'rb') | |
files = {'file': fin} | |
try: | |
r = requests.post(url, files=files) | |
print r.text |
The standard way of understanding the HTTP protocol is via the request reply pattern. Each HTTP transaction consists of a finitely bounded HTTP request and a finitely bounded HTTP response.
However it's also possible for both parts of an HTTP 1.1 transaction to stream their possibly infinitely bounded data. The advantages is that the sender can send data that is beyond the sender's memory limit, and the receiver can act on
-- a quick LUA access script for nginx to check IP addresses against an | |
-- `ip_blacklist` set in Redis, and if a match is found send a HTTP 403. | |
-- | |
-- allows for a common blacklist to be shared between a bunch of nginx | |
-- web servers using a remote redis instance. lookups are cached for a | |
-- configurable period of time. | |
-- | |
-- block an ip: | |
-- redis-cli SADD ip_blacklist 10.1.1.1 | |
-- remove an ip: |
package main | |
import "fmt" | |
func elementExists(input_array []int, max_index int, min_index int, element int) bool { | |
middle_index := (min_index + max_index) / 2 | |
found := false | |
if min_index > max_index { | |
return false |
import os | |
import sys | |
from getpass import getpass | |
import gdata.docs.service | |
import gdata.spreadsheet.service | |
''' | |
get user information from the command line argument and |
package main | |
import ( | |
"fmt" | |
"os" | |
"path/filepath" | |
) | |
func main() ([]string, error) { | |
searchDir := "c:/path/to/dir" |
FROM python:2.7 | |
MAINTAINER Mushfiq | |
ENV PYTHONUNBUFFERED 1 | |
RUN git clone https://github.com/mushfiq/djmsc.git djmsc | |
WORKDIR djmsc |