Skip to content

Instantly share code, notes, and snippets.

View diepes's full-sized avatar

Pieter diepes

  • 20:14 (UTC +13:00)
View GitHub Profile
@diepes
diepes / rename_files.py
Last active November 28, 2021 09:36 — forked from aljgom/rename_files.py
Renames files in current directory by passing it functions. First determines the changes that will be made and displays the differences using colors, and asks for confirmation to perform the changes. Works on pycharm, haven't tested it in different consoles
import time
import os
import select
import re
import difflib
from itertools import zip_longest
import __main__
# os.chdir("enter path here")
@diepes
diepes / SimpleHTTPServerWithUpload.py
Created July 23, 2019 02:24 — forked from touilleMan/SimpleHTTPServerWithUpload.py
Simple Python Http Server with Upload - Python3 version
#!/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
"""
@diepes
diepes / .gitignore
Created July 11, 2018 21:51 — forked from Justasic/openvpn_gen.py
This is a python script to generate client OpenVPN configuration files. This is based mostly on the easyrsa script and is much simpler to understand.
*.swp
#dont upload secret material to git
*.crt
*.key
*.ovpn
*.ovpn.conf
*.conf
@diepes
diepes / asyncio_producer_consumer.py
Created February 2, 2018 10:56 — forked from akrylysov/asyncio_producer_consumer.py
Python 3 asyncio basic producer / consumer example
import asyncio
import random
q = asyncio.Queue()
async def producer(num):
while True:
await q.put(num + random.random())
await asyncio.sleep(random.random())