Skip to content

Instantly share code, notes, and snippets.

@chirvo
chirvo / spoof-device.py
Last active February 22, 2023 01:34
Spoof Device Python 3 script, based on the one found in the Star Citizen LUG wiki
#!/usr/bin/env python3
# See the original script at https://github.com/beniwtv/evdev-spoof-device
# Read https://github.com/starcitizen-lug/knowledge-base/wiki/Sticks,-Throttles,-&-Pedals
#
import evdev
import sys
from evdev import ecodes
devices = [evdev.InputDevice(path) for path in evdev.list_devices()]
#!/bin/bash
# to hide the cursor on the touchscreen you need to run unclutter-xfixes ver 1.6 or greater
# use the option --hide-on-touch to achieve it.
XINPUT=/usr/bin/xinput
XRANDR=/usr/bin/xrandr
PORT=$($XRANDR | grep -w connected | grep "1920x1080" | cut -f1 -d' ')
ILITEK_TP_ID=$($XINPUT | grep ILITEK | grep -v Mouse | cut -f2 | cut -f2 -d=)
ILITEK_MOUSE_ID=$($XINPUT | grep ILITEK | grep Mouse | cut -f2 | cut -f2 -d=)
$XINPUT map-to-output $ILITEK_TP_ID $PORT
$XINPUT map-to-output $ILITEK_MOUSE_ID $PORT
#!/bin/bash
# https://askubuntu.com/questions/755059/how-do-i-get-the-latest-version-of-winetricks-on-ubuntu
URL="https://raw.githubusercontent.com/Winetricks/winetricks/master/src/winetricks"
if [ "$1" == "--user" ]
then
DESTINATION="$HOME/.local/bin"
SUDO=""
else
@chirvo
chirvo / vim-coloresque.patch
Created October 18, 2015 02:31
Fixes vim selection range by removing certain symbols from isk when using coloresque.vim.
diff --git a/after/syntax/css/vim-coloresque.vim b/after/syntax/css/vim-coloresque.vim
index c80a9a5..a0a6cdf 100644
--- a/after/syntax/css/vim-coloresque.vim
+++ b/after/syntax/css/vim-coloresque.vim
@@ -128,6 +128,9 @@ function! s:VimCssInit(update)
if len(keys(b:color_pattern))>0
call s:RestoreColors()
+ :set isk-=-
+ :set isk-=#
@chirvo
chirvo / random_pwd_aes192_cipher_decipher
Last active August 29, 2015 14:09
Quick and Dirty AES192 encryption with random 256-length password
crypto = require 'crypto'
__cipher = (data) ->
pwd = crypto.randomBytes(256).toString()
cipher = crypto.createCipher 'aes192', pwd
msg = []
msg.push cipher.update(data, 'binary', 'hex')
msg.push cipher.final('hex')
msg = msg.join('')
[msg, pwd]