Skip to content

Instantly share code, notes, and snippets.

@pkillnine
pkillnine / gist:771d0e72004b40762a6a37fc2d05d8f5
Created December 10, 2016 23:54
When trying to upgrade maemoagent....
hildon-application-manager 2.2.71
connected to 88551c05-d0bc-43a9-a260-ccd9a3281e4a
-----
Upgrading maemoagent 1.0-0 to 1.0-0
apt-worker: free space (/) = 81043456
required disk space: 0
result code = 0
apt-worker: free space (/) = 81043456
Setting up maemoagent (1.0-0) ...
No such file or directory at /var/lib/dpkg/info/maemoagent.postinst line 41.
#!/bin/bash
if (( $# < 1 )); then
BASECMD="qutebrowser --backend webengine"
elif (( $# >= 1 )); then
BASECMD="$@"
fi
TMPBASEDIR=/tmp/qutebrowser_tmp_basedir_`cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 6 | head -n 1`
QBCONFIGDIR="$HOME/.config/qutebrowser"
def extract_tag_words(self, elem):
"""Extract tag words form the given element."""
attr_extractors = {
"alt": lambda elem: elem["alt"],
"name": lambda elem: elem["name"],
"title": lambda elem: elem["title"],
"placeholder": lambda elem: elem["placeholder"],
"src": lambda elem: elem["src"].split('/')[-1],
"href": lambda elem: elem["href"].split('/')[-1],
"text": str,
#!/bin/bash
if (( $# < 1 )); then
BASECMD="qutebrowser --backend webengine"
elif (( $# >= 1 )); then
BASECMD="$@"
fi
TMPBASEDIR=`mktemp -dt qutebrowser-tmp-session-XXX`
QBCONFIGDIR="$HOME/.config/qutebrowser"
#!/usr/bin/env python
#Ale Zuvic (AirieFenix)
#Thanks to macvendors.com for their incredibly simple API
import requests
import sys
BASE_URL = 'http://api.macvendors.com' # I removed the trailing '/' as I would add that when creating the url
#!/bin/bash
QBDATA_HISTORY_FILE="$HOME"/.local/share/qutebrowser/history
QBHISTORYLIST_TMP_FILE=/tmp/qbhistorylist
HISTORY_PAGE_HTML_FILE=/tmp/qbhistory.html
function produce_list_body() {
sort -r $QBDATA_HISTORY_FILE |#sort by most recent
cut -d " " -f 2- |#remove first column (times)
grep -v "^data:" |#remove urls with "data:"
#!/usr/bin/env python
import re
import urllib.parse
from os import environ
from sys import argv
url = environ['QUTE_URL']
fifo_path = environ['QUTE_FIFO']
#!/bin/bash
eval "$@"
if [ -f $QUTE_FIFO ]; then
if [[ $? == 0 ]] ; then
echo "message-info 'Command exited with status $?'" >> $QUTE_FIFO
else
echo "message-error 'Command exited with status $?'" >> $QUTE_FIFO
@pkillnine
pkillnine / config.py
Last active December 28, 2017 17:36
Qutebrowser config file
# ____ _ ___ _ _ ___
# | _ \| |/ (_) | | / _ \
# | |_) | ' /| | | | ____| (_) |
# | __/| . \| | | | |_____\__, |
# |_| |_|\_\_|_|_| /_/
#
# My Qutebrowser config file :D
#
import re
@pkillnine
pkillnine / gist:f1aa4e1d24cecf5f08666fa8b0879db1
Created October 4, 2017 21:23
insert mode readline bindings
config.bind('<ctrl-h>', 'fake-key <backspace>', mode='insert')
config.bind('<ctrl-f>', 'fake-key <right>', mode='insert')
config.bind('<ctrl-b>', 'fake-key <left>', mode='insert')
config.bind('<ctrl-w>', 'fake-key <ctrl-backspace>', mode='insert')