Skip to content

Instantly share code, notes, and snippets.

View gbrault's full-sized avatar
🏠
Working from home

Gilbert Brault gbrault

🏠
Working from home
  • Vence
View GitHub Profile
@rrosajp
rrosajp / SimpleHTTPServerWithUpload.py
Created July 14, 2020 16:52 — forked from joonahn/SimpleHTTPServerWithUpload.py
Simple Python Http Server can upload multiple files
#!/usr/bin/env python3
"""Simple HTTP Server With Upload.
This module builds on BaseHTTPServer by implementing the standard GET
and HEAD requests in a fairly straightforward manner.
see: https://gist.github.com/UniIsland/3346170
"""
@WetHat
WetHat / PY-2dConvexHull.ipynb
Last active April 15, 2024 14:22
2d Convex Hull from a Point Cloud with Python
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
---
version: '2'
services:
jupyter:
image: jupyter/scipy-notebook
container_name: jupyter
command: start.sh jupyter lab --LabApp.token='*******************' --LabApp.allow_remote_access='True' --LabApp.allow_origin='*'
restart: always
@mill1000
mill1000 / README.md
Last active April 22, 2024 07:24
Headless A2DP Audio Streaming on Raspbian Stretch

About

This gist will show how to setup Raspbian Stretch as a headless Bluetooth A2DP audio sink. This will allow your phone, laptop or other Bluetooth device to play audio wirelessly through a Rasperry Pi.

Motivation

A quick search will turn up a plethora of tutorials on setting up A2DP on the Raspberry Pi. However, I felt this gist was necessary because this solution is:

  • Automatic & Headless - Once setup, the system is entirely automatic. No user iteration is required to pair, connect or start playback. Therefore the Raspberry Pi can be run headless.
  • Simple - This solution has few dependencies, readily available packages and minimal configuration.
  • Up to date - As of December 2017. Written for Raspbian Stretch & Bluez 5.43

Prerequisites

@deargle
deargle / client.conf
Last active February 16, 2024 20:14
OpenVPN server.conf and client.conf
##############################################
# Sample client-side OpenVPN 2.0 config file #
# for connecting to multi-client server. #
# #
# This configuration can be used by multiple #
# clients, however each client should have #
# its own cert and key files. #
# #
# On Windows, you might want to rename this #
# file so it has a .ovpn extension #
@Davor111
Davor111 / sshuttle.sh
Created February 17, 2017 08:34
How to use sshuttle with .key, .csr or .pem files for authentication
#It's not directly mentioned in the documentation on how to do this, so here you go. This command will tunnel everything including DNS:
sshuttle --dns -vr user@yourserver.com 0/0 --ssh-cmd 'ssh -i /your/key/path.pem'
@joncardasis
joncardasis / WebServer.py
Created February 7, 2017 21:08
A simple and quick HTTP web server in Python
"""
Author: Jonathan Cardasis
"""
import socket
import signal # Allow socket destruction on Ctrl+C
import sys
import time
import threading
@naushadzaman
naushadzaman / flask_restart.py
Created November 8, 2016 14:06
Reload python flask server by function / API endpoint
#!/usr/bin/python
# -*- coding: utf-8 -*-
# Reload python flask server by function / API endpoint
# References:
# https://docs.python.org/3/library/multiprocessing.html
# http://stackoverflow.com/questions/27723287/reload-python-flask-server-by-function
import os
You can ssh into the VM by finding the IP (from kubectl config view) and using username "docker" password "tcuser":
ssh docker@192.168.XX.XX
@Girgitt
Girgitt / sftpserver_main.py
Created July 13, 2016 20:34
multithreaded sftp server in python based on https://github.com/rspivak/sftpserver
import time
import socket
import optparse
import sys
import textwrap
import paramiko
from sftpserver.stub_sftp import StubServer, StubSFTPServer