From 8612e137f472052d4e2503483f6d9dba4bbd9884 Mon Sep 17 00:00:00 2001 From: Tobias Kessels Date: Wed, 9 Aug 2017 20:45:51 +0200 Subject: [PATCH] added toggle_touchpad & checksqlite.py toggle_touchpad : script to toggle touchpad on notebook on and off checksqlite.py : copy/paste script to check sqlite-databases for consistency and more --- chechsqlite.py | 37 +++++++++++++++++++++++++++++++++++++ toggle_touchpad | 7 +++++++ 2 files changed, 44 insertions(+) create mode 100644 chechsqlite.py create mode 100755 toggle_touchpad diff --git a/chechsqlite.py b/chechsqlite.py new file mode 100644 index 0000000..26c150a --- /dev/null +++ b/chechsqlite.py @@ -0,0 +1,37 @@ +import sqlite3 +import sys +import re +dbfile=sys.argv[1] +# dbfile="/home/skyhawk/Documents/test.db" + +try: + db=sqlite3.connect(dbfile) + cur = db.cursor() + cur.execute("SELECT name FROM sqlite_master WHERE type='table' ORDER BY name;") + tables=cur.fetchall() + # for row in db.execute("pragma table_info('sqlite_master')").fetchall(): + # print(row) + nice_tables={} + for table in tables: + # print(table) + nice_rows=[] + for row in db.execute("pragma table_info(" + str(table[0]) +")").fetchall(): + # print(row[1]) + if re.match('hash|pass',row[1], re.IGNORECASE): + nice_rows.append(row[1]) + if len(nice_rows) > 0: + nice_tables[table[0]]=nice_rows + + + +except Exception as e: + # print("Error opening DB %s" % dbfile) + # sys.std.write(e) + exit(1) + +print("[+] %s is Valid DB " % dbfile) +if len(nice_tables)>0: + for tab in nice_tables: + print(nice_tables[tab]) + +db.close() diff --git a/toggle_touchpad b/toggle_touchpad new file mode 100755 index 0000000..5820958 --- /dev/null +++ b/toggle_touchpad @@ -0,0 +1,7 @@ +#!/bin/bash +touchpad_id=$(xinput list | grep -i touch | grep -Po '(?<=id=)\d+') +if (xinput list-props 14 | grep "Device Enabled" | grep -Po '\d$' | grep -q "1"); then + xinput disable "${touchpad_id}" +else + xinput enable "${touchpad_id}" +fi