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
def _run_as_pg(command): | |
return sudo('sudo -u postgres %s' % command) | |
def pg_user_exists(username): | |
with settings(hide('running', 'stdout', 'stderr', 'warnings'), warn_only=True): | |
res = _run_as_pg('''psql -t -A -c "SELECT COUNT(*) FROM pg_user WHERE usename = '%(username)s';"''' % locals()) | |
return (res == "1") | |
def pg_database_exists(database): | |
with settings(hide('running', 'stdout', 'stderr', 'warnings'), warn_only=True): |
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
style "vimfix" { | |
bg[NORMAL] = "#242424" # this matches my gvim theme 'Normal' bg color. | |
} | |
widget "vim-main-window.*GtkForm" style "vimfix" |
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
import gi | |
gi.require_version('Gtk', '3.0') | |
from gi.repository import Gtk | |
import gbulb | |
import rx | |
import json | |
from rx.subjects import Subject | |
from rx.concurrency import AsyncIOScheduler | |
from tornado.httpclient import AsyncHTTPClient | |
from tornado.httputil import url_concat |
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 python3 | |
# | |
# Prerequisites: | |
# * Install lpass command (ArchLinux: lastpass-cli package) | |
# and run `lpass login` once | |
# * or export passwords from Lastpass in CVS format. | |
# * Create a file `.lastpass2pass.blacklist` in your $HOME and optionally | |
# enter group names to be blacklisted, one per line. | |
# | |
# Usage: |
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 | |
if ! git status >/dev/null 2>&1 ; then | |
echo "not a git repository" | |
exit 1 | |
fi | |
PROJECT_NAME=$(git remote get-url origin | sed 's#.*:\(.*\)\.git#\1#') | |
BRANCH=$(git branch|grep '^\*'|cut -d\ -f2) | |
PIPELINE_SUCCESS=$(gitlab pipelines $PROJECT_NAME "{ per_page: 100 }" | grep $BRANCH | head -1 | cut -d\| -f 5) |
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
### Keybase proof | |
I hereby claim: | |
* I am fqxp on github. | |
* I am fqxp (https://keybase.io/fqxp) on keybase. | |
* I have a public key ASA5ljZZaKUycWUAWv7Tjt6d9kCvKrWW52utlqDNAmd9OAo | |
To claim this, I am signing this object: |
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 | |
base64 -d <<EOF | mplayer -cache 1024 - | |
AAAAIGZ0eXBpc29tAAACAGlzb21pc28yYXZjMW1wNDEAAAAIZnJlZQAFD+FtZGF0AAACrgYF//+q | |
3EXpvebZSLeWLNgg2SPu73gyNjQgLSBjb3JlIDE1NSByMjkxNyAwYTg0ZDk4IC0gSC4yNjQvTVBF | |
Ry00IEFWQyBjb2RlYyAtIENvcHlsZWZ0IDIwMDMtMjAxOCAtIGh0dHA6Ly93d3cudmlkZW9sYW4u | |
b3JnL3gyNjQuaHRtbCAtIG9wdGlvbnM6IGNhYmFjPTEgcmVmPTMgZGVibG9jaz0xOjA6MCBhbmFs | |
eXNlPTB4MzoweDExMyBtZT1oZXggc3VibWU9NyBwc3k9MSBwc3lfcmQ9MS4wMDowLjAwIG1peGVk | |
X3JlZj0xIG1lX3JhbmdlPTE2IGNocm9tYV9tZT0xIHRyZWxsaXM9MSA4eDhkY3Q9MSBjcW09MCBk | |
ZWFkem9uZT0yMSwxMSBmYXN0X3Bza2lwPTEgY2hyb21hX3FwX29mZnNldD0tMiB0aHJlYWRzPTYg | |
bG9va2FoZWFkX3RocmVhZHM9MSBzbGljZWRfdGhyZWFkcz0wIG5yPTAgZGVjaW1hdGU9MSBpbnRl |
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 python3 | |
# | |
# Prerequisites: | |
# * Install bitwarden-cli (ArchLinux: bitwarden-cli package) | |
# and run `bw login` and `bw unlock` and set the API TOKEN thats | |
# printed as a result. | |
# | |
# Usage: | |
# 1. Simply run `bitwarden2pass`. | |
# 2. Voilà! |
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
_complete_tmux_pane_words() { | |
local -a w | |
if [[ -z "$TMUX_PANE" ]]; then | |
_message "not running inside tmux!" | |
return 1 | |
fi | |
_tmux_capture_pane() { | |
tmux capture-pane -J -p $@ | |
OlderNewer