Skip to content

Instantly share code, notes, and snippets.

View ph20's full-sized avatar

Alexander Grynchuk ph20

  • Capgemini Engineering
  • Ukraine
View GitHub Profile
@ph20
ph20 / mnt-mymountpoint.mount
Created July 2, 2022 09:47 — forked from proprietary/mnt-mymountpoint.mount
systemd automount sshfs: how to automatically mount a remote sshfs filesystem with systemd
# Change the relevant {{ PARTS OF THIS FILE }} for your remote address etc.
# Make sure this unit file is named similarly to your mountpoint; e.g., for /mnt/mymountpoint name this file mnt-mymountpoint.mount
# On Ubuntu:
# $ sudo cp mnt-mymountpoint.mount /lib/systemd/system/
# $ sudo systemctl enable mnt-mymountpoint.mount
# $ sudo systemctl start mnt-mymountpoint.mount
# On Fedora:
# $ sudo cp mnt-mymountpoint.mount /etc/systemd/system
# $ sudo systemctl enable mnt-mymountpoint.mount
# $ sudo systemctl start mnt-mymountpoint.mount
@ph20
ph20 / background_flask.py
Created February 18, 2021 21:50 — forked from czardoz/background_flask.py
Simple Flask app with a background task using gevent
import gevent
import gevent.monkey
gevent.monkey.patch_all()
from gevent.pywsgi import WSGIServer
from flask import Flask
app = Flask(__name__)
app.debug = True
@ph20
ph20 / server.py
Created February 5, 2021 12:28 — forked from mdonkers/server.py
Simple Python 3 HTTP server for logging all GET and POST requests
#!/usr/bin/env python3
"""
Very simple HTTP server in python for logging requests
Usage::
./server.py [<port>]
"""
from http.server import BaseHTTPRequestHandler, HTTPServer
import logging
class S(BaseHTTPRequestHandler):
@ph20
ph20 / ABOUT.md
Created September 28, 2020 20:38 — forked from laobubu/ABOUT.md
A very simple HTTP server in C, for Unix, using fork()

Pico HTTP Server in C

This is a very simple HTTP server for Unix, using fork(). It's very easy to use

How to use

  1. include header httpd.h
  2. write your route method, handling requests.
  3. call serve_forever("12913") to start serving on port 12913