Skip to content

Instantly share code, notes, and snippets.

#!/bin/bash
# Authors:
# - Moritz Warning <moritzwarning@web.de> (2016)
# - Zhong Jianxin <azuwis@gmail.com> (2014)
# - maximilize
#
# See file LICENSE at the project root directory for license information.
#
# Fork from https://github.com/i3/i3status/blob/master/contrib/net-speed.sh
#!/bin/bash -e
if [ "$1" = "install" ]; then
echo "binds+=( '/var/lib/snapd' '/snap' )" >/etc/qubes-bind-dirs.d/50_snapd.conf
cat >/etc/systemd/system/qubes-snappy-fix.service <<EOF
[Unit]
Description=Rebuild the non-persistent snappy systemd mounts
After=qubes-mount-dirs.service
DefaultDependencies=no
Before=snapd.service
#!/bin/bash
# make snappy installations persistent in qubes app vm's
# 1. copy this script to /rw/config/snap.sh and make it executable.
# 2. add this line to your rc.local: /rw/config/snap.sh --qubes-init
if ! test -e /var/lib/snapd/.qubes; then
sudo systemctl -q stop snapd.service
sudo mkdir -p /rw/snap/{etc,lib,mount}
@maximilize
maximilize / idlemon.py
Created September 13, 2018 03:01
Script to detect and shutdown not needed qubes VM's
#!/usr/bin/env python
import subprocess
import re
from collections import namedtuple
import binascii
import time
import json
IGNORE = """
nm-applet
function r(y){
return Math.round(Math.random()*(y||255));
}
a=document;
a.write('<body style="width:100%;height:100%" id="foo"></body>');
b=a.getElementById('foo');
function c(){
b.style.backgroundColor = 'rgb('+r()+','+r()+','+r()+')';
setTimeout(c,50);
};
@maximilize
maximilize / circustool
Created September 15, 2014 13:49
Circus start/stop/restart for more than one watcher at once
#!/bin/bash
run_circusctl() {
for i in {1..50}
do
OUT=$(circusctl $@ 2>&1)
if [ "$OUT" = "ok" ]
then
echo >&2
return
elif [ $(echo "$OUT" | grep 'error: arbiter is already running ' | wc -l) = 1 ]
@maximilize
maximilize / screeny
Last active December 19, 2015 17:39
Screeny - a simple screenshot upload tool. It copies the image url to the clipboard.
#!/bin/bash -e
# Upload script with cool notify icons.
# Url of the image is copied to clipboard.
#
# INSTALL
# 1. Install dependencies:
# sudo apt-get install curl notify-send scrot xclip
#
# 2. Install the script
# sudo wget -O /usr/bin/screeny https://gist.github.com/max0d41/5992783