This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[[source]] | |
name = "pypi" | |
url = "https://pypi.org/simple" | |
verify_ssl = true | |
[dev-packages] | |
[packages] | |
pydbus = "*" | |
pulsectl = "*" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Changes desktop background to a pseudo-random background | |
# Set defaults | |
BG_DIR="$HOME/.backgrounds" | |
BG_LIST=(`cd $BG_DIR && ls *.{jp{e,}g,png,gif} 2> /dev/null`) | |
CURRENT_BG="`gsettings get org.gnome.desktop.background picture-uri | tail -c +8`" | |
NEW_BG=$CURRENT | |
BG_SET=0 | |
SAME_BG=0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python2 | |
from itertools import izip, count | |
from math import fsum, ceil, floor | |
import fileinput | |
GRADES = ("FL", "PC", "PS", "CR", "DN", "HD") | |
MARKS = dict(izip(GRADES, count())) | |
def average(seq): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# Requires dnspython | |
from __future__ import print_function | |
from dns.exception import DNSException | |
from dns.resolver import query | |
from smtplib import SMTP, SMTPException | |
def get_mx_records(domain): | |
try: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python2 | |
# Example usage: find ~/.local/share/gnome-shell/extensions/ -name 'metadata.json' -print0 | xargs -0 gnome-shell-extension-upgrade 3.4 | |
import json | |
import sys | |
new_version = unicode(sys.argv[1]) | |
for filename in sys.argv[2:]: | |
metadata = json.load(open(filename, "rb")) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from deluge._libtorrent import lt | |
from deluge.core.torrentmanager import TorrentManagerState | |
from shutil import copy, _samefile | |
import cPickle | |
import os | |
class Transplant(object): | |
def __init__(self, config_dir="", torrent_ids=None, torrents=None): | |
self.state_dir = "" | |
self.torrents = {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python2 | |
# Creates a new inhibitor | |
# While this is running the specified events will be inhibited | |
from optparse import OptionParser | |
import signal | |
import dbus | |
import sys | |
import os |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
parse_time() { | |
IFS=' ' read -ra PART <<< "$1" | |
seconds=0 | |
for i in "${PART[@]}"; do | |
number=$(expr match $i '\([0-9]\+\)') | |
unit=$(expr match $i '[0-9]*\([a-z]\+\)') | |
case $unit in | |
h) |