Skip to content

Instantly share code, notes, and snippets.

Avatar
💭
Awake or Sleeping

Michael Bunsen mihow

💭
Awake or Sleeping
View GitHub Profile
@mihow
mihow / fix_database_to_utf8.py
Created Dec 7, 2018 — forked from miratcan/fix_database_to_utf8.py
Small python script that converts character sets to utf8 in all databases and tables. My solution for "Illegal mix of collations" errors. (http://stackoverflow.com/questions/3029321/how-to-solve-illegal-mix-of-collations-in-mysql)
View fix_database_to_utf8.py
from MySQLdb import connect
conn = connect(user="[USER]", passwd= "[PASSWORD]")
cur = conn.cursor()
cur.execute("show databases;")
dbs_to_update = filter(
lambda db: db not in ('information_schema', 'mysql', 'performance_schema'),
[dbname[0] for dbname in cur.fetchall()])
@mihow
mihow / reduce_faces.py
Created Sep 8, 2017 — forked from awesomebytes/reduce_faces.py
Executing meshlab from commandline reduce faces of a mesh iteratively
View reduce_faces.py
#!/usr/bin/env python
import sys
import os
import subprocess
# Script taken from doing the needed operation
# (Filters > Remeshing, Simplification and Reconstruction >
# Quadric Edge Collapse Decimation, with parameters:
# 0.9 percentage reduction (10%), 0.3 Quality threshold (70%)
@mihow
mihow / cubes_pyode_vapory.py
Created Feb 4, 2017 — forked from Zulko/cubes_pyode_vapory.py
3D cubes animation with PyODE and Vapory
View cubes_pyode_vapory.py
"""
Physics simulation with PyODE followed by a (basic) rendering with Vapory
See the result here: http://i.imgur.com/TdhxwGz.gifv
Zulko 2014
This script is placed in the Public Domain (Licence Creative Commons 0)
"""
@mihow
mihow / cubes_pyode_vapory.py
Created Feb 4, 2017 — forked from Zulko/cubes_pyode_vapory.py
3D cubes animation with PyODE and Vapory
View cubes_pyode_vapory.py
"""
Physics simulation with PyODE followed by a (basic) rendering with Vapory
See the result here: http://i.imgur.com/TdhxwGz.gifv
Zulko 2014
This script is placed in the Public Domain (Licence Creative Commons 0)
"""
@mihow
mihow / get-scipy-stack-for-aws-lambda.sh
Created Jan 29, 2016
Get the SciPy stack for deployment to AWS Lambda
View get-scipy-stack-for-aws-lambda.sh
#! /usr/bin/env bash
# Install the SciPy stack on Amazon Linux and prepare it for AWS Lambda
yum -y update
yum -y groupinstall "Development Tools"
yum -y install blas --enablerepo=epel
yum -y install lapack --enablerepo=epel
yum -y install atlas-sse3-devel --enablerepo=epel
yum -y install Cython --enablerepo=epel
@mihow
mihow / gist:d65c62d9b32613033ad5
Last active Sep 8, 2015 — forked from darkopetrovic/gist:11292725
Datalog and stream light sensor and voltage reading from ADC with Raspberry PI to Plot.ly
View gist:d65c62d9b32613033ad5
#!/usr/bin/python
import os, time, signal, sys
from Adafruit_ADS1x15 import ADS1x15
import RPi.GPIO as GPIO
from datetime import datetime
import subprocess
import argparse
import requests
import json
@mihow
mihow / bash_prompt.sh
Created Jun 4, 2012 — forked from insin/bash_prompt.sh
Set color bash prompt according to active virtualenv, git branch and return status of last command.
View bash_prompt.sh
#!/bin/bash
#
# DESCRIPTION:
#
# Set the bash prompt according to:
# * the active virtualenv
# * the branch/status of the current git repository
# * the return value of the previous command
# * the fact you just came from Windows and are used to having newlines in
# your prompts.
@mihow
mihow / _webfaction_setup.rst
Created Apr 26, 2011 — forked from ptone/_webfaction_setup.rst
setting up a stack on webfaction
View _webfaction_setup.rst

Setting up Webfaction for modern Django deployment

last updated: 4/5/2011

note that this stuff is always a moving target, much of this has been cribbed and combined from various blog posts. Much of the information was out of date from those, and if it is more than a couple months after the last updated date above, consider some of this likely to now be out of date.

@mihow
mihow / nginx-1.0.0-installer.py
Created Apr 23, 2011 — forked from robflaherty/nginx-0765-installer.txt
Nginx 1.0.0 installer for Webfaction
View nginx-1.0.0-installer.py
-----BEGIN WEBFACTION INSTALL SCRIPT-----
#!/bin/env python2.6
VERSION = "1.0.0"
"""
Nginx Installer
"autostart": not applicable
"extra info": Enter domain name for the nginx app