Skip to content

Instantly share code, notes, and snippets.

View marceloslacerda's full-sized avatar

Marcelo Lacerda marceloslacerda

View GitHub Profile
- hosts: 127.0.0.1
handlers:
- name: handler a
shell: echo this
tags:
- xtag
- name: handler b
shell: echo that
tags:
- xtag
import unittest
import docopt
class DocoptTestCase(unittest.TestCase):
def test_single_optional(self):
docopt.docopt("""
test command
Usage: test [--verbose]
# neither this or that gets executed
- hosts: 127.0.0.1
remote_user: root
tasks:
- name: do this
shell: echo this
when: not all_proj
- name: do that
shell: echo that
when: all_proj
#!/bin/sh
sudo -u {{ USER }} /home/msl09/custom-scripts/backup-server
@marceloslacerda
marceloslacerda / MAGA
Last active April 29, 2016 23:27
make everything better again on irc
def trumpfy(string='AMERICA'):
bold=''
colors = ['5,1', '16,1', '2,1']
words = ['MAKE', string, 'GREAT', 'AGAIN']
def freedomfy(word):
for i in range(len(word)):
yield colors[i%3] + word[i].upper()
result = bold + colors[0] + ' ' + ' '.join([''.join((list(freedomfy(word)))) for word in words]) + ' '
return result
@marceloslacerda
marceloslacerda / serranodsdd.log
Created April 16, 2016 00:53
serranodsdd build log
This file has been truncated, but you can view the full file.
including vendor/cm/vendorsetup.sh
Trying dependencies-only mode on a non-existing device tree?
============================================
PLATFORM_VERSION_CODENAME=REL
PLATFORM_VERSION=6.0.1
CM_VERSION=13.0-20160415-UNOFFICIAL-serranodsdd
TARGET_PRODUCT=cm_serranodsdd
TARGET_BUILD_VARIANT=userdebug
TARGET_BUILD_TYPE=release
[ 66341.667] (II) config/udev: Adding input device Wacom Intuos S 2 Pad (/dev/input/event17)
[ 66341.667] (**) Wacom Intuos S 2 Pad: Applying InputClass "Wacom USB device class"
[ 66341.667] (**) Wacom Intuos S 2 Pad: Applying InputClass "Wacom class"
[ 66341.667] (II) Using input driver 'wacom' for 'Wacom Intuos S 2 Pad'
[ 66341.667] (**) Wacom Intuos S 2 Pad: always reports core events
[ 66341.667] (**) Option "Device" "/dev/input/event17"
[ 66341.667] (EE) Wacom Intuos S 2 Pad: Invalid type 'stylus' for this device.
[ 66341.667] (EE) Wacom Intuos S 2 Pad: Invalid type 'eraser' for this device.
[ 66341.667] (EE) Wacom Intuos S 2 Pad: Invalid type 'cursor' for this device.
[ 66341.667] (EE) Wacom Intuos S 2 Pad: Invalid type 'touch' for this device.
[Unit]
Description=translate wacom tablet inputs
Requires=graphical.target
[Service]
Environment=DISPLAY=:0.0
Environment=XAUTHORITY=/home/msl09/.Xauthority
WorkingDirectory=/home/msl09/PycharmProjects/xwacom/
User=root
ExecStart=/usr/bin/python3 redirect_keys.py
from subprocess import Popen, PIPE
TOP_LEFT = '00,00,00,00,00,01,00,11,01,01,00,00,00'
BOT_LEFT = '00,00,00,00,00,01,00,10,01,01,00,00,00'
TOP_RIGT = '00,00,00,00,00,01,00,15,01,01,00,00,00'
BOT_RIGT = '00,00,00,00,00,01,00,16,01,01,00,00,00'
END = '00,00,00,00,00,00,00,00,00,00,00,00,00'
A = '''keydown Control_L
key z
$ xsetwacom -v --list dev
... Display is '(null)'.
... 'list' requested.
... Found device 'Virtual core XTEST pointer' (4).
... 'Virtual core XTEST pointer' (4) is not a wacom device.
... Found device 'Virtual core XTEST keyboard' (5).
... 'Virtual core XTEST keyboard' (5) is not a wacom device.
... Found device 'Power Button' (6).
... 'Power Button' (6) is not a wacom device.
... Found device 'Video Bus' (7).