Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View zyga's full-sized avatar
🏠
Working from home

Zygmunt Bazyli Krynicki zyga

🏠
Working from home
View GitHub Profile
@zyga
zyga / gitlab-runner.yaml
Last active December 25, 2021 13:59
LXD profile for setting up GitLab runner for existing projects. Secrets redacted.
config:
security.nesting: "true"
security.syscalls.intercept.mknod: "true"
security.syscalls.intercept.setxattr: "true"
user.user-data: |
#cloud-config
---
apt:
sources:
# This gives us up-to-date docker-ce.
@zyga
zyga / raspi-tool.py
Last active September 25, 2019 09:46
raspi-tool for sending/receiving images from running Raspberry Pi devices
#!/usr/bin/env python3
import abc
import argparse
import contextlib
import io
import os
import platform
import socket
import subprocess
import sys
#version=DEVEL
# Firewall configuration
firewall --enabled --service=mdns
# X Window System configuration information
xconfig --startxonboot
repo --name="fedora" --mirrorlist=http://mirrors.fedoraproject.org/mirrorlist?repo=fedora-$releasever&arch=$basearch
repo --name="updates2" --mirrorlist=http://mirrors.fedoraproject.org/mirrorlist?repo=updates-released-f$releasever&arch=$basearch
# System authorization information
auth --useshadow --enablemd5
# System keyboard
@zyga
zyga / package.yml
Last active October 12, 2017 17:12
Indent package for Solus (unfinished)
name : indent
version : 2.2.11
release : 1
source :
- http://debian.lagis.at/debian/pool/main/i/indent/indent_2.2.11.orig.tar.gz : aaff60ce4d255efb985f0eb78cca4d1ad766c6e051666073050656b6753a0893
homepage : https://www.gnu.org/software/indent/
license :
- GPLv2
summary : C language source code formatting program
description : |
@zyga
zyga / poke-appimage.py
Created August 6, 2017 21:57
Quick script checking if a given file may be a valid appimage file
#!/usr/bin/env python3
import argparse
import struct
def main() -> None:
parser = argparse.ArgumentParser()
parser.add_argument(
'appimage', metavar='APPIMAGE', help="Appimage file to query",
type=argparse.FileType(mode="rb"))
@zyga
zyga / Makefile
Last active March 30, 2017 15:03
setns apparmor bug
.PHONY: all clean
CFLAGS += -Wall
all: oops
clean:
rm -f oops
@zyga
zyga / patch-core-snap.sh
Created June 9, 2016 13:31
Script to patch ubuntu-core.snap at revision 122 to support the new hostfs mount point
#!/bin/sh
if [ "$(id -u)" != 0 ]; then
echo "This script requires root access, run it with sudo please"
exit 1
fi
core_snap=/var/lib/snapd/snaps/ubuntu-core_122.snap
case $(md5sum $core_snap | cut -d ' ' -f 1) in
8170579dcd67c5eceb151695c21cdab1)
echo "Patching ubuntu-core snap to include hostfs mount point"
tmp="$(mktemp -d)"
@zyga
zyga / lantern-collect
Last active August 29, 2015 14:17
Basic backlight data collection script for Lantern
#!/bin/sh
# Basic backlight data collection script for Lantern
# Written by Zygmunt Krynicki <zygmunt.krynicki@canonical.com>
set -x
id=$(cat /proc/sys/kernel/random/uuid)
dest=$(mktemp -d --suffix=-lantern)
lspci > "$dest/lspci"
lsmod > "$dest/lsmod"
uname -a > "$dest/uname"
if [ -e /etc/os-release ]; then
@zyga
zyga / signal_naming.py
Created February 27, 2015 12:38
Example on naming singnals in checkbox
class JobCollection:
@signal
def job_added(self, job):
""" signal sent whenever a job is added """
class SomethingElse:
def __init__(self, collection):
col.job_added.connect(on_job_added)
@zyga
zyga / example.py
Created September 3, 2014 17:43
type() bug?
class NS:
PASSTHRU = frozenset(('__name__', '__qualname__', '__doc__', '__module__'))
def __init__(self, data=None):
if data is None:
data = {}
self.data = data
def __setitem__(self, name, value):