Skip to content

Instantly share code, notes, and snippets.

@baverman
baverman / simple_notify.py
Last active March 10, 2020 17:26
Simple libnotify implementation using only plain dbus-send. Can close created notification.
import sys
from subprocess import Popen, PIPE
def notify(title, body=None, timeout=-1, appname='simple-notify'):
cmd = [
'dbus-send',
'--type=method_call',
'--print-reply=literal',
'--dest=org.freedesktop.Notifications',
'/org/freedesktop/Notifications',
@baverman
baverman / nya.py
Created October 29, 2012 11:24
Next episodes downloader from http://www.nyaa.eu/
#!/usr/bin/env python2
# -*- coding: utf-8 -*-
import re
import sys
import os.path
from urllib2 import build_opener
from urllib import urlencode
from lxml import html
@baverman
baverman / vk-cli.py
Created September 17, 2012 20:34
Prints a downloadable url for VK video search
#!/usr/bin/env python2
import sys
import re
from urllib2 import build_opener, HTTPCookieProcessor
from urllib import urlencode
from cookielib import CookieJar
from netrc import netrc