Skip to content

Instantly share code, notes, and snippets.

@koenrh
koenrh / gcp-gpu-vm-hashcat.md
Last active February 4, 2024 18:37
Running Hashcat on Google Cloud's new GPU-based VMs

Running Hashcat on Google Cloud's GPU-based VMs

In February 2017, Google announced the availability GPU-based VMs. I spun up a few of these instances, and ran some benchmarks. Along the way, I wrote down the steps taken to provision these VM instances, and install relevant drivers.

Update April 2019: Updated instructions to use instances with the Tesla T4 GPUs.

@yous
yous / server.py
Created December 5, 2016 10:46
Simple multithreaded Flask file server with basic auth
import os.path
from functools import wraps
from flask import Flask, request, Response, redirect
from flask_autoindex import AutoIndex
fileroot = os.path.join(os.path.realpath(os.path.curdir), 'files')
app = Flask(__name__)
idx = AutoIndex(app,
browse_root=fileroot,
add_url_rules=False)
@greydanus
greydanus / dynamic_plotting.py
Created October 14, 2016 18:20
Dynamic plotting for matplotlib
"Dynamic plotting in matplotlib. Copy and paste into a Jupyter notebook."
# written October 2016 by Sam Greydanus
%matplotlib notebook
import matplotlib.pyplot as plt
import numpy as np
import time
def plt_dynamic(x, y, ax, colors=['b']):
for color in colors:
ax.plot(x, y, color)
@TySkby
TySkby / timeout.py
Last active March 9, 2023 04:24
Timeout decorator/context manager using signals (for Python 3)
#!/usr/bin/env python3
"""Easily put time restrictions on things
Note: Requires Python 3.x
Usage as a context manager:
```
with timeout(10):
something_that_should_not_exceed_ten_seconds()
```
@pylover
pylover / a2dp.py
Last active March 11, 2024 03:06
Fixing bluetooth stereo headphone/headset problem in ubuntu 16.04, 16.10 and also debian jessie, with bluez5.
#! /usr/bin/env python3
"""Fixing bluetooth stereo headphone/headset problem in debian distros.
Workaround for bug: https://bugs.launchpad.net/ubuntu/+source/indicator-sound/+bug/1577197
Run it with python3.5 or higher after pairing/connecting the bluetooth stereo headphone.
This will be only fixes the bluez5 problem mentioned above .
Licence: Freeware
@jsfenfen
jsfenfen / output.png
Created February 17, 2016 07:01 — forked from endolith/output.png
Detecting rotation and line spacing of image of page of text using Radon transform
output.png
@jojonas
jojonas / st2vim_themes.py
Last active March 28, 2024 16:22
Converter for Sublime Text themes to VIM themes
from __future__ import print_function
import sys
import argparse
import os.path
import textwrap
import re
from pprint import pprint
import xml.etree.ElementTree as ET
@PurpleBooth
PurpleBooth / README-Template.md
Last active May 3, 2024 18:53
A template to make good README.md

Project Title

One Paragraph of project description goes here

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

Prerequisites

@hellpanderrr
hellpanderrr / Python read Excel XML Table.md
Last active March 24, 2021 04:03
Read Excel XML table in a python list
from bs4 import BeautifulSoup
 
def read_excel_xml(path):
    file = open(path).read()
    soup = BeautifulSoup(file,'xml')
    workbook = []
    for sheet in soup.findAll('Worksheet'): 
        sheet_as_list = []
 for row in sheet.findAll('Row'):
@datagrok
datagrok / README.md
Last active June 6, 2021 14:23
Circular imports in Python 2 and Python 3: when are they fatal? When do they work?