Skip to content

Instantly share code, notes, and snippets.

Avatar
💭
 

Stuart Axon stuaxo

💭
 
View GitHub Profile
@stuaxo
stuaxo / csv_to_xlsx.py
Created Oct 12, 2020
CSV to XLSX converter with XLSXWriter
View csv_to_xlsx.py
# csv_to_xlsx [filename... [filename]]
import csv
import os
import sys
import xlsxwriter
from pathlib import Path
def main(csv_filenames):
if non_files:
@stuaxo
stuaxo / build-pycairo.sh
Created Aug 13, 2020
Script to attempt to build pycairo
View build-pycairo.sh
set -ex
cd pycairo
PATH=$PATH:/c/ProgramData/chocolatey/bin:/c/ProgramData/chocolatey/tools
export CAIRO_VERSION=1.17.2
mkdir -p builds
function do_builds() {
bash -c .travis/runPyCairox64.sh
@stuaxo
stuaxo / class_repr.py
Created Jul 22, 2020
Python class repr that outputs class members.
View class_repr.py
def class_repr(self):
"""
Default class repr that outputs the content of a class.
Usage:
>>> class A:
... __repr__ = class_repr
...
@stuaxo
stuaxo / clone-cloudfoundry-s3-to-django-media-dir.sh
Created May 20, 2020
Clone s3 bucket to local django media directory
View clone-cloudfoundry-s3-to-django-media-dir.sh
#!/bin/bash
PROJECT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )/../" && pwd )"
DEFAULT_MEDIA_DIR=../config/media
# You *really* want to use this via clone-site.sh so that the database matches,
# but it's up to you.
set -e
usage() {
>&2 echo 'Usage: $ clone-bucket.sh cf-app [media directory]'
@stuaxo
stuaxo / dump-cloudfoundry-db.dh
Created May 20, 2020
Dump cloudfoundry database of current site
View dump-cloudfoundry-db.dh
#!/bin/bash
set -e
# software requirements:
# awk, jq, pg_dump, psql
# cloudfoundry cli (cf)
# post
# prerequisite:
# empty postgres database named invest-dev
@stuaxo
stuaxo / Recording Surface to SVG Surface.ipynb
Created Feb 26, 2020
Attempting to repro a bug in shoebot
View Recording Surface to SVG Surface.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View boot.log
FDPP kernel 0.1beta8 [GIT: beta-8-14-ga92a219] (compiled Oct 17 2019)
fdpp: plugin loaded
CONF: config variable parser_version_3 set
CONF: config variable c_system set
CONF: Parsing built-in dosemu.conf file.
CONF: config variable version_3_style_used set
CONF: Parsing built-in global.conf file.
CONF: config variable version_3_style_used unset
CONF: config variable version_3_style_used set
CONF: opened include file /usr/local/etc/dosemu/dosemu.conf
@stuaxo
stuaxo / cairo-manylinux.sh
Last active Dec 4, 2019 — forked from anntzer/cairo-manylinux.sh
manylinux build script for pycairo
View cairo-manylinux.sh
#!/bin/bash
# Written by Antony Lee (@anntzer).
set -e
PYTHON_VERSION=37
PIP="/opt/python/cp$PYTHON_VERSION-cp${PYTHON_VERSION}m/bin/pip"
if ! [[ -e "$PIP" ]]; then
# Not in the manylinux image yet: call self from within docker.
docker run -it \
@stuaxo
stuaxo / Screenshot-Notepad.ipynb
Created Dec 7, 2018
Screenshot a single window
View Screenshot-Notepad.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@stuaxo
stuaxo / dmesg-without-amdgpu.txt
Created Nov 23, 2018
dmesg on 4.20rc on HP Envy 15 Inch. modprobe.blacklist=amdgpu
View dmesg-without-amdgpu.txt
[ 0.000000] Linux version 4.20.0-rc3 (root@Main-PC) (gcc version 7.3.0 (Ubuntu 7.3.0-27ubuntu1~18.04)) #1 SMP Mon Nov 19 15:18:07 CET 2018
[ 0.000000] Command line: BOOT_IMAGE=/boot/vmlinuz-4.20.0-rc3 root=UUID=5fbe26ec-88dd-4b0f-8e57-c577efacffc7 ro quiet splash idle=nomwait amdgpu.audio=0 amdgpu.dc=1 modprobe.blacklist=amdgpu
[ 0.000000] x86/fpu: Supporting XSAVE feature 0x001: 'x87 floating point registers'
[ 0.000000] x86/fpu: Supporting XSAVE feature 0x002: 'SSE registers'
[ 0.000000] x86/fpu: Supporting XSAVE feature 0x004: 'AVX registers'
[ 0.000000] x86/fpu: xstate_offset[2]: 576, xstate_sizes[2]: 256
[ 0.000000] x86/fpu: Enabled xstate features 0x7, context size is 832 bytes, using 'compacted' format.
[ 0.000000] BIOS-provided physical RAM map:
[ 0.000000] BIOS-e820: [mem 0x0000000000000000-0x000000000009ffff] usable
[ 0.000000] BIOS-e820: [mem 0x00000000000a0000-0x00000000000fffff] reserved
You can’t perform that action at this time.