Skip to content

Instantly share code, notes, and snippets.

View aiguofer's full-sized avatar

Diego Fernández Giraldo aiguofer

  • dbt Labs
  • In a van, down by the river
View GitHub Profile
@aiguofer
aiguofer / 81-thinkpad-dock.rules
Last active June 16, 2020 15:41
Automatic setup external monitors when docking ThinkPad T530 to ThinkPad Mini Dock
# Save this file (after modifying ID_VENDOR and ID_MODEL if necessary) as /etc/udev/rules.d/81-thinkpad-dock.rules
# These values seem to work for "ThinkPad Mini Dock Plus Series 3"
SUBSYSTEM=="usb", ACTION=="add", ENV{ID_VENDOR}=="17ef", ENV{ID_MODEL}=="100a", SYMLINK+="tp_mini_dock", TAG+="systemd"
@aiguofer
aiguofer / README.md
Last active April 27, 2023 19:12
Get info about running jupyter notebooks including memory consumption, how long they've been running, etc.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@aiguofer
aiguofer / Not Working.ipynb
Created January 27, 2017 21:53
Bokeh 2 bar width
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@aiguofer
aiguofer / Width Change Doesnt Work.ipynb
Last active May 12, 2017 21:49
Width Change Doesnt Work
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@aiguofer
aiguofer / encrypeted_cert_session.py
Created February 13, 2017 15:14
Creating a Python requests session using a passphrase protected Client side Cert
import ssl
from requests.adapters import HTTPAdapter
CFG_FILE = '<path_to_cfg>'
secure_hosts = [
'https://<host>'
]
class SSLAdapter(HTTPAdapter):
def __init__(self, certfile, keyfile, password=None, *args, **kwargs):
@aiguofer
aiguofer / GPMDP Shortcuts.md
Last active November 6, 2017 18:02
Script to like a song in GPMDP (Google Play Music Desktop Player)

Custom Global GPMDP Shortcuts

GPMDP is an awesome application to use Google Play on the desktop. The only problem with it is that the built in keyshortcuts are very limited by design. They only allow shortcuts with the Control key, but if you use Emacs this is very limiting.

Most media control keys can be configured using the built in media keys for your DE. The 2 shortcuts that I was missing are to like a song, and to raise the player (I generally have it closed to tray). After some digging around dbus and sockets, I managed to write a copule of simple python scripts to accomplish this:

song_liker.py:

@aiguofer
aiguofer / README.md
Last active May 6, 2022 20:35
Polybar module for Google Play Music Desktop Player

I've been making an effort for a while to hit like on songs I like, mainly so I can always fail over to a playlist of liked songs. I generally use GPMDP as my main player and Polybar as my taskbar. I control my media player using playerctl and a while back I wrote songliker to set up a shortcut to like my songs. I decided to put it all together into a neat little polybar module and thought others might enjoy this.

I'm including the necessary files to do this yourself, although this might not work for you 'as-is' since I have a pretty customized systemd service management set up. Easiest way would be to just ignore the systemd stuff and just add an exec now_playing, but I'm including it here in case you want to use it and just modify that.

This will display the currently playing song in your bar in the following format {artist} - {song} | {liked?}. It uses Nerd Font symbols for a prefixing musical note and a thumbs up outline if not liked, or full if liked. It wi