Skip to content

Instantly share code, notes, and snippets.

@notjuliee
notjuliee / config.toml
Last active September 24, 2019 06:15
Key forwarder
# The device you wish to capture
BASE_KBD = "/dev/input/by-id/usb-IBM_Model_M-if03-event-kbd"
# Keys that will be sent to the host device
HOST_KEYS = [
"KEY_A",
]
# Keys that will be sent to both host and guest device
SHARED_KEYS = [

Keybase proof

I hereby claim:

  • I am joonatoona on github.
  • I am joonatoona (https://keybase.io/joonatoona) on keybase.
  • I have a public key ASCuhYAKs4s4MEGKjRW01jyn_lp130efXEwo8ebX83Quhwo

To claim this, I am signing this object:

#!/bin/sh
# Parse arguments into variables
while test $# -ge 2; do
eval _$1='$2'
shift
shift
done
# Check that file actually exists
@notjuliee
notjuliee / backup.sh
Last active November 9, 2017 04:48
Dump all SMS/MMS messages from Android to a JSON file (Requires root)
#!/bin/bash
set -e
echo "Starting SMS Backup"
echo "Downloading MMS/SMS DB"
adb shell su -c "cp /data/user_de/0/com.android.providers.telephony/databases/mmssms.db /sdcard/SMS_BAK.db"
adb pull /sdcard/SMS_BAK.db in.db &> /dev/null
adb shell rm /sdcard/SMS_BAK.db
echo "Parsing DB"
printf 'from sqlite3 import connect\nfrom json import dumps\nc = connect("in.db").cursor()\nc.execute("SELECT address FROM addr WHERE _id=1;")\nnum = c.fetchall()[0][0]\ndef getsms(i):\n\treturn {"date":i[1],"body":i[2],"to":i[0] if i[3]==2 else num,"from":num if i[3]==2 else i[0]}\nc.execute("SELECT address,date,body,type FROM sms;")\nout={"num":num,"msgs":[getsms(i) for i in c.fetchall()]}\nopen("sms.json","w+").write(dumps(out))' | python
rm in.db
@notjuliee
notjuliee / scanner.py
Created November 5, 2017 02:41
Rainbow Scanner FX For Razer Keyboards
import openrazer.client as rc
from time import sleep
devMan = rc.DeviceManager()
kb = devMan.devices[0]
print("Done opening keyboard")
colorPhase = 0
color = [255, 0, 0]
#include <stdio.h>
#include <X11/Xlib.h>
#include <X11/extensions/Xrandr.h>
int main() {
Display *dpy = XOpenDisplay(NULL);
Window root = RootWindow(dpy, 0);
XRRScreenConfiguration *conf = XRRGetScreenInfo(dpy, root);
printf("%d", XRRConfigCurrentRate(conf));
return 0;
@notjuliee
notjuliee / nosteponcss.js
Created May 8, 2017 03:41
No step on CSS
// ==UserScript==
// @name RedaddCSS
// @namespace com.digitalfishfun.nosteponcss
// @version 1
// @grant none
// @include https://reddit.com/r/*
// ==/UserScript==
const nosteponcss_instructions = `
USAGE:
#!/usr/bin/python
# AHK For Linux
from sys import argv as args;
from subprocess import call;
import re;
regexes = {
"IfWinName\((.+)\)": "if [ $(xdotool getactivewindow getwindowname) = \"%s\" ]; then",
"EndIf": "fi",
@notjuliee
notjuliee / ChangeWallpaper.py
Last active March 19, 2017 19:05
Automagically change wallpaper
sub = "widescreenwallpaper";
fileName = "kwp";
changeCommands = {"gnome":"gsettings set org.gnome.desktop.background picture-uri \"file://$URI\"","darwin":"osascript -e 'tell application \"Finder\" to set desktop picture to POSIX file \"$URI\"'"}
import urllib2;
import json;
import os;
import re;
import platform;
@notjuliee
notjuliee / ToggleBorderless.sh
Created March 12, 2017 21:24
Bordeless Windows on Linux
#!/bin/bash
if [ "$(xprop -id $(xdotool getactivewindow) _MOTIF_WM_HINTS)" == "_MOTIF_WM_HINTS(CARDINAL) = 2, 0, 0, 0, 0" ]; then
xprop -id $(xdotool getactivewindow) -f _MOTIF_WM_HINTS 32c -set _MOTIF_WM_HINTS 0x2,0x0,0x1,0x0,0x0;
else
xprop -id $(xdotool getactivewindow) -f _MOTIF_WM_HINTS 32c -set _MOTIF_WM_HINTS 0x2,0x0,0x0,0x0,0x0;
fi