Skip to content

Instantly share code, notes, and snippets.

@bmsleight
bmsleight / gist:3a7822750e5a1d5376ce
Created November 1, 2014 15:31
Lowering the cost of entry for amateur stenographers, $4,000 -> $70 -> $32
HI,
I thought the costs of entry for amateur stenographers, "From $4000 to ~$50" is still too high :) How about $32 or £20 ?
** Bill of Materials **
- N-Key Rollover keyboard
- Bluetack
- Key covers (inspired by Laser-Cut Steno Keys Kit)
- N-Key Rollover keyboard
@bmsleight
bmsleight / gist:7cd3b0511d78a071df03
Last active August 29, 2015 14:10
Cloudie Thingie
/usr/local/sbin/cloud
pkg_add x11vnc
pkg_add xfce
x11vnc -storepasswd /home/bms/.vnc/passwd
x11vnc --ssl SAVE -http -rfbauth /home/bms/.vnc/passwd -forever -loop100 -display :0
(Sets certs)
kudos to http://www.tumfatig.net/20120614/the-remote-openbsd-5-1-desktop/
@bmsleight
bmsleight / #rc.local
Last active August 29, 2015 14:10
New Cloud Thingie
#/etc/rc.local
/usr/local/sbin/cloud
#!/usr/bin/env python
"""
Use byzanz to create a GIF screencast of a specific window.
Required tools:
sudo apt-get install byzanz x11-utils xdotool
A tip: use an extra-long duration (-d 100), record your shot, and use
gimp to shorten the duration of the last frame. You need to rename the layer
from "Frame 123 (100000 ms) (combine)" to "Frame 123 (1000 ms) (combine)".
openshift
Make django project
python3 -m venv myvenv
. myvenv/bin/activate
pip install django==1.8
git clone ssh://[email protected]/~/git/splendidsnap.git/
git remote add github [email protected]:bmsleight/openshift-splendidsnap.git
git push github master:master
from SimpleHTTPServer import SimpleHTTPRequestHandler
import BaseHTTPServer
from os import environ
def test(HandlerClass=SimpleHTTPRequestHandler,
ServerClass=BaseHTTPServer.HTTPServer):
protocol = "HTTP/1.0"
host = environ.get('OPENSHIFT_PYTHON_IP')
port = int(environ.get('OPENSHIFT_PYTHON_PORT'))
server_address = (host, port)
from bs4 import BeautifulSoup
soup = BeautifulSoup(open("index.html"))
soup.find_all("span", class_="time")[270].a.get('href') # Get link to main vine page (which then needs parsing)
soup.find_all("span", class_="time")[270].a.text # Time
<hostdev mode='subsystem' type='usb' managed='no'>
<source>
<vendor id='0x2040'/>
<product id='0x7070'/>
<address bus='1' device='47' />
</source>
</hostdev>
virsh vol-create-as default vic-bigger.img 120G
sudo virt-resize --expand /dev/sda1 /var/lib/libvirt/images/vic.img /var/lib/libvirt/images/vic-bigger.img
virsh edit vic