Skip to content

Instantly share code, notes, and snippets.

View tjanson's full-sized avatar

Tom Janson tjanson

  • Aachen, Germany
View GitHub Profile
activatevb() {
osascript -e "tell application \"VirtualBox VM\" to activate"
}
# for some reason it didn't work when decomposing it into these commands,
# but it worked fine in a single command
#alias click="cliclick -m verbose"
#cmdtab() {
# click kd:cmd kp:tab ku:cmd w:200
#}
@tjanson
tjanson / update_external_displays.sh
Last active August 7, 2018 17:23
Query MacBook internal display brightness and update external displays
# there are several brightness related keys, not sure what the difference is -- but they seem to be equivalent
MACBOOK_BRIGHTNESS=${${$(ioreg -c AppleBacklightDisplay | ag -o '"brightness"={[^}]*}')#*=*=*=*=}%\}}
MACBOOK_BRIGHTNESS_PERCENTAGE="$((100*${MACBOOK_BRIGHTNESS}/1024))"
# https://github.com/kfix/ddcctl
ddcctl -d 1 -b ${MACBOOK_BRIGHTNESS_PERCENTAGE}
ddcctl -d 2 -b ${MACBOOK_BRIGHTNESS_PERCENTAGE}
@tjanson
tjanson / cmds.sh
Created July 8, 2018 16:18
Virtualbox custom resolution (Mac host, Windows 8.1 guest)
# Problem 1: get full 1440p resolution on my 2518 (as the VM's primary display)
# initially I tried
VBoxManage setextradata Windows\ 8.1 "CustomVideoMode1" "2560x1440x32"
VBoxManage setextradata Windows\ 8.1 GUI/LastGuestSizeHint 2560,1440
# as well as some other stuff I don't remember, and it worked. I think that second line did the trick.
# Problem 2: get portrait orientation 1080x1920 on my 2414 (as the secondary display)
# this time I followed this: https://winaero.com/blog/set-exact-display-resolution-in-virtualbox-virtual-machine/
VBoxManage setextradata global GUI/MaxGuestResolution any
VBoxManage setextradata Windows\ 8.1 "CustomVideoMode1" "2560x1440x32"
@tjanson
tjanson / lastfm_to_gmusic.py
Last active December 24, 2017 05:10 — forked from Timmmm/lastfm_to_gmusic.py
Convert Last.fm loved tracks to your Google Play Store Music Play All Access Subscription Service by Google™. It creates a new playlist rather than adding the tracks to your library willy-nilly. See code for more details.
#!/usr/bin/env python
# 2017-12-24: adapted for Python 3, gmusicapi==11.0.0
# Google password may (must?) be https://myaccount.google.com/apppasswords
import requests
import gmusicapi
import xml.etree.ElementTree as ET
def main():
@tjanson
tjanson / config.py
Created December 18, 2017 16:17
qutebrowser Neo layer 3 fix
# layer three symbols are interpreted as Alt+key
# this can be seen with keytester.py
# simply removing the following (currently default) bindings "fixes"* this
# *of course the underlying problem remains, e.g., in this Gist text editor …
config.unbind('<Alt-D>', mode='command')
config.unbind('<Alt-B>', mode='command')
config.unbind('<Alt-F>', mode='command')
@tjanson
tjanson / Data Buses.md
Last active February 20, 2017 21:16
embedded-systems.md

Bus Implementations

I2C: Inter-Integrated Circuit Bus

General
  • aka “Two Wire Interface”
  • short distance (generally < 1m)
  • developed by Philips
  • data rate 0.1 – 5 Mbit/s

Automotive Software Engineering

Motivation

  • electronic features are very important selling points
    • customer demand is increasing (mostly comfort features, e.g., infotainment, driver assistance, connectivity)
    • this is the main area of automotive innovation
<?xml version="1.0"?>
<root>
<list>
<item>
<name>Neo 2</name>
<appendix>Umsetzung der 4. und 6. Ebene. Um problembehaftete Kombinationen mit Control zu vermeiden,</appendix>
<appendix>werden Teile von Ebene 4 und 6 per Tottaste umgesetzt.</appendix>
<appendix>Ebene 6 ist jetzt über Mod3+Mod4 erreichbar.</appendix>
<appendix></appendix>
@tjanson
tjanson / Effiziente Algorithmen 2015 notes.md
Last active March 13, 2016 23:45
Notizen zu Effiziente Algorithmen (SoSe 2015)
@tjanson
tjanson / Term Rewriting Systems 2015 notes.md
Last active March 13, 2016 23:49
Term Rewriting Systems notes (WS 2015)