Skip to content

Instantly share code, notes, and snippets.

View dawoodjee's full-sized avatar
🤔
Thinking of AI

Adam Dawoodjee dawoodjee

🤔
Thinking of AI
View GitHub Profile
@dawoodjee
dawoodjee / insert_invoice.py
Last active April 25, 2020 17:25
Using Frappe Client API (Python) to insert new Sales Invoices can be tricky. So here's how I did it:
def http_connection():
connection = []
try:
connection = FrappeClient("https://erp-site.com", "username or email", "password")
except SocketTimeout as st:
print("Connection to %s timed out. (timeout=%s)" % (st.host, st.timeout))
connection = False
except SocketError as e:
@dawoodjee
dawoodjee / mailcow-ReverseProxy
Created July 1, 2019 20:49 — forked from asifbacchus/headersSecurity.conf
My working NGINX config on the host machine acting as a reverse proxy for mailcow:dockerized. Redirects root URLs to SOGo for easy webmail access and allows users/administrators to access mailcow admin by going to URL/setup. Also handles invalid domains. Ex: NGINX serving mail.example.com but you don't want it answering example.com.
#######
### NGINX Reverse-Proxy to mailcow and SOGo
### Redirects root to SOGo and /setup to mailcow control panel
### Handles all SSL security
#######
## HTTP catch-all for invalid domain names (e.g. root domain "example.com")
server {