Skip to content

Instantly share code, notes, and snippets.

View 1stvamp's full-sized avatar
:shipit:

Wes Mason 1stvamp

:shipit:
View GitHub Profile
@1stvamp
1stvamp / switch-noise-cancellation.sh
Created May 26, 2015 16:51
Automatically adjust noise cancellation for X220 clickpad if plugged into power
#!/bin/sh
# /usr/lib/pm-utils/power.d/switch-noise-cancellation.sh
case $1 in
true) DISPLAY=:0 xinput --set-prop "SynPS/2 Synaptics TouchPad" 303 60, 60 ;;
false) DISPLAY=:0 xinput --set-prop "SynPS/2 Synaptics TouchPad" 303 15, 15 ;;
esac
exit 0
@1stvamp
1stvamp / high_fives.py
Last active August 29, 2015 14:21
Example of returning multiple directed commands in a hippybot plugin
from hippybot.decorators import botcmd
class Plugin(object):
command_aliases = {'^5s': 'high_fives'}
@botcmd
def high_fives(self, msg, **kwargs):
users = [
unicode(msg.getFrom()).split("/")[1].replace(' ', ''),
'bob',
'alice']

The current situation

The current spec states that ports are a top level entry in the package.yaml as

    name: go-example-webserver
    vendor: Alexander Sack <[email protected]>
    architecture: amd64
    icon: meta/go.svg
 version: 1.0.1
@1stvamp
1stvamp / snappy-ppa-1500
Created December 15, 2014 23:22
apt pinning preferences for snappy ppa
Package: *
Pin: release o=LP-PPA-snappy-dev-beta
Pin-Priority: 15000
@1stvamp
1stvamp / proposemerge.sh
Last active December 17, 2015 21:44
Script to open a web browser for a launchpad merge proposal from a local bzr branch
#!/bin/bash
if [[ `uname -s` == "Linux" ]]; then
browse="xdg-open"
else
browse="open"
fi
if [ "$#" -gt "0" ]; then
cd $1
fi
BRANCH_URL=$(bzr info 2>/dev/null|grep --color=never -Po '(?<=push branch: bzr\+ssh://bazaar\.)(.*)')
@1stvamp
1stvamp / playboard.yaml
Created June 27, 2014 21:31
Graceful or hard restart of service in ansible based on changed binary
---
- hosts: localhost
tasks:
- name: check for new payload
tags: config-changed
shell: if [ "$(md5sum {{ executable_path }})" != "$(cat {{ executable_md5_path }})" ]; then echo "changed"; fi
register: md5diff
changed_when: md5diff.stdout == "changed"
- name: store new payload md5
@1stvamp
1stvamp / keybase.md
Created March 28, 2014 11:45
My keybase info

Keybase proof

I hereby claim:

  • I am 1stvamp on github.
  • I am 1stvamp (https://keybase.io/1stvamp) on keybase.
  • I have a public key whose fingerprint is 92B0 8721 F96D 152C 1C6B 3570 121D B795 2C93 970C

To claim this, I am signing this object:

@1stvamp
1stvamp / graph_walk.js
Created March 27, 2014 16:10
JavaScript Graph object traversal example
var Node = function(vertices) {
var myVertices = vertices || [];
this.addVertex = function(vertex) {
myVertices.push(vertex);
};
this.getVertices = function() {
return myVertices;
};
@1stvamp
1stvamp / lumi_header_fix.css
Last active August 29, 2015 13:57
Make the lumi.do header more useful (by making it get the hell out of my way)
#header
{
height: 69px !important;
position: absolute !important;
}
#header primary
{
height: 69px !important;
}
for NAME in ls $DIRPATH;
do
NAME2="${NAME#_}"
if [ "$NAME" != "$NAME" ]; then
mv $DIRPATH/$NAME $DIRPATH/$NAME2
fi
done