Skip to content

Instantly share code, notes, and snippets.

View davebarkerxyz's full-sized avatar

Dave Barker davebarkerxyz

  • Glasgow, Scotland
View GitHub Profile
@davebarkerxyz
davebarkerxyz / pyalias.sh
Created August 12, 2016 18:31
Handy python aliases
# Python
alias py3='python3'
alias py2='python2.7'
alias python2='python2.7'
alias pip3='pip-3.5'
alias python="python3"
alias pip="pip-3.5"
alias pipdown='pip download -d $HOME/.pypi/packages'
alias pipoff='pip install --no-index --find-links file://$HOME/.pypi/packages/'
alias pipdown2='pip download -d $HOME/.pypi/packages2'
@davebarkerxyz
davebarkerxyz / vbox-new-desk.sh
Created March 3, 2015 16:53
Create new desktop (not headless) VirtualBox VM from template
#!/bin/bash
set -e
MASTER="deb7-dev-master"
NEWNAME=$1
IDENTITY="$HOME/.ssh/keys/dbark_1"
VMUSER="sysadmin"
SSHGO="ssh -i $IDENTITY -o StrictHostKeyChecking=no "
echo "Cloning $MASTER to $NEWNAME..."
@davebarkerxyz
davebarkerxyz / rebuild_search_indices.py
Last active May 19, 2020 07:43
Rebuild Flask-WhooshAlchemy search indices
#!/usr/bin/env python
import datetime
from app import app, models
import whoosh
import flask_whooshalchemy
"""
Rebuild all Whoosh search indices
@davebarkerxyz
davebarkerxyz / README.md
Created February 15, 2014 18:20
PlayStation 4 DualShock 4 controller config for x360ce

PlayStation 4 DualShock 4 controller config for x360ce

The attached x360ce.ini file allows you to use the DualShock 4 controller with DInput games on Wine (which doesn't fully support XInput), using the x360ce emulation layer

@davebarkerxyz
davebarkerxyz / tmux_myapp
Last active August 27, 2018 10:12
Scripting tmux to set up my development environment The script opens 3 windows: 1 - a vim session for backend work; 2 - a vim session for frontend work; 3 - split into 2x2, with two bash shells, one postgresql shell and my Python/Flask application running in the fourth pane;
#!/bin/bash
DEV_PATH="~/dev/myapp"
SESSION="myapp"
tmux -2 new-session -d -s $SESSION
# First window (backend dev)
tmux rename-window "Backend"
tmux send-keys "cd $DEV_PATH; vim" C-m
# Frontend window for vim