Skip to content

Instantly share code, notes, and snippets.

View marmarek's full-sized avatar

Marek Marczykowski-Górecki marmarek

View GitHub Profile
@marmarek
marmarek / icon-receiver.py
Created September 20, 2015 02:15
Window icon updater
#!/usr/bin/python
# -*- coding: utf-8 -*-
#
# The Qubes OS Project, http://www.qubes-os.org
#
# Copyright (C) 2013-2015 Marek Marczykowski-Górecki
# <marmarek@invisiblethingslab.com>
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
@marmarek
marmarek / gist:b227dcff130862fa5b48
Created October 10, 2015 17:28
openssh-server installed in debian-8 chroot
[user@testvm ~]$ sudo debootstrap jessie $PWD/debian-8 http://ftp.pl.debian.org/debian
(...)
[user@testvm ~]$ sudo chroot debian-8 apt-get install openssh-server
Reading package lists... Done
Building dependency tree... Done
The following extra packages will be installed:
krb5-locales libbsd0 libedit2 libgssapi-krb5-2 libk5crypto3 libkeyutils1 libkrb5-3 libkrb5support0 libwrap0 libx11-6 libx11-data libxau6
libxcb1 libxdmcp6 libxext6 libxmuu1 ncurses-term openssh-client openssh-sftp-server tcpd xauth
Suggested packages:
krb5-doc krb5-user ssh-askpass libpam-ssh keychain monkeysphere rssh molly-guard ufw
--> Preparing the image
mke2fs 1.42.12 (29-Aug-2014)
Discarding device blocks: 4096/5242880 done
Creating filesystem with 5242880 4k blocks and 1310720 inodes
Filesystem UUID: ccc8fac2-e420-4812-8dd4-19c5bda2bb2f
Superblock backups stored on blocks:
32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208,
4096000
Allocating group tables: 0/160 done
This file has been truncated, but you can view the full file.
--> Preparing the image
mke2fs 1.42.12 (29-Aug-2014)
Discarding device blocks: 4096/5242880 done
Creating filesystem with 5242880 4k blocks and 1310720 inodes
Filesystem UUID: ef29ae53-bb0f-40cf-9264-de24518e1c5e
Superblock backups stored on blocks:
32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208,
4096000
Allocating group tables: 0/160 done
This file has been truncated, but you can view the full file.
--> Preparing the image
mke2fs 1.42.12 (29-Aug-2014)
Discarding device blocks: 4096/5242880 done
Creating filesystem with 5242880 4k blocks and 1310720 inodes
Filesystem UUID: 898d3aff-b78a-49b6-8247-f2ac8ba6a55d
Superblock backups stored on blocks:
32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208,
4096000
Allocating group tables: 0/160 done
This file has been truncated, but you can view the full file.
--> Preparing the image
mke2fs 1.42.12 (29-Aug-2014)
Discarding device blocks: 4096/5242880 done
Creating filesystem with 5242880 4k blocks and 1310720 inodes
Filesystem UUID: 71bec9fe-f661-49d4-8308-df2ae83dac45
Superblock backups stored on blocks:
32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208,
4096000
Allocating group tables: 0/160 done
This file has been truncated, but you can view the full file.
--> Preparing the image
mke2fs 1.42.12 (29-Aug-2014)
Discarding device blocks: 4096/5242880 done
Creating filesystem with 5242880 4k blocks and 1310720 inodes
Filesystem UUID: e98c045a-5f20-4352-93ab-25262a2ffb21
Superblock backups stored on blocks:
32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208,
4096000
Allocating group tables: 0/160 done
@marmarek
marmarek / ssh
Last active February 5, 2016 21:43
salt-ssh qrexec transport hack
#!/bin/sh
id=`date +%s`-$$
echo "Cmd: $0 $@" >>/tmp/log-$id
# redirect stderr to file, but still have ability to send something to the
# "real" stderr
exec 3>&2
exec 2>/tmp/log-$id-stderr
{
"local": {
"fun_args": [],
"jid": "20160205212832478474",
"return": {
"output_file_append": false,
"ioflo_realtime": true,
"acceptance_wait_time": 10,
"recon_default": 1000,
"whitelist_modules": [],
{
"local": {
"fun_args": [],
"return": {
"grains": {
"kernel": "Linux",
"osrelease": "8.3",
"kernelrelease": "4.1.13-8.2.pvops.qubes.x86_64",
"osfinger": "Debian-8",
"virtual_subtype": "Xen PV DomU",