Skip to content

Instantly share code, notes, and snippets.

# How to install the superlight mirage-firewall for Qubes OS by using saltstack
# Tested on Qubes v4.2 and mirage v0.9.5
# No integrity checks are performed. Latest release version of mirage is downloaded and installed into dom0
# After the install, you have to switch your AppVMs to use the mirage firewall vm created by this script
# inspired by: https://github.com/one7two99/my-qubes/tree/master/mirage-firewall
# inspired by: https://github.com/one7two99/my-qubes/tree/master/mirage-firewall
# default template + dispvm template are used. Possible optimization is to use min-dvms
{% set DownloadVMTemplate = salt['cmd.shell']("qubes-prefs default_template") %}
@100111001
100111001 / qvm-filemanager.sh
Created June 16, 2019 09:31
Bash version of the qvm-filemanager.pl
#!/bin/sh
set -e
front=$(xprop -notype -root _NET_ACTIVE_WINDOW | awk '{if (match($0,"^_NET_ACTIVE_WINDOW: window id # (0x[0-9a-f]*), 0x0$",m)){print m[1];} exit 0;}' )
test -n "$front"
vm=$(xprop -id "$front" -notype _QUBES_VMNAME | awk '{if (match($0,"^_QUBES_VMNAME = \"([^\"]*)\"$",m)){print m[1];} exit 0;}')
if [ -n "$vm" ]; then
@100111001
100111001 / qvm-filemanager.pl
Created June 16, 2019 09:30 — forked from jpouellet/qvm-filemanager.pl
Qubes OS: Opens a file manager in the focused VM
#!/usr/bin/env perl
use strict;
use warnings;
sub open_file_manager {
my $vm = shift;
exec {'qvm-run'} ('qvm-run', '--', $vm, 'exec nautilus --new-window --no-desktop </dev/null >/dev/null') or die "qvm-run exec failed\n";
}
@100111001
100111001 / qvm-terminal.pl
Last active June 16, 2019 09:27 — forked from jpouellet/qvm-terminal.pl
Opens a terminal in the front-most Qubes VM.
#!/usr/bin/env perl
use strict;
use warnings;
sub dom0_term {
(exec 'xfce4-terminal') or (exec 'xterm') or die "dom0 terminal exec failed\n";
}
sub domU_term {