Skip to content

Instantly share code, notes, and snippets.

@UniversalSuperBox
UniversalSuperBox / BLEDebug.swift
Created September 3, 2019 20:47
Find and print out lots of information about nearby BLE devices in Swift
//Copyright 2019 Dalton Durst
//
//Permission is hereby granted, free of charge, to any person obtaining a copy
//of this software and associated documentation files (the "Software"), to deal
//in the Software without restriction, including without limitation the rights
//to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
//copies of the Software, and to permit persons to whom the Software is
//furnished to do so.
//
//THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
@UniversalSuperBox
UniversalSuperBox / jamf.py
Created August 10, 2020 14:26
A small JPS API wrapper for getting mobile device details and setting mobile device extension attributes.
# Copyright (c) 2020 Dalton Durst
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in all
@UniversalSuperBox
UniversalSuperBox / debug.patch
Created April 30, 2021 00:39
Patch to print EGL/GL errors around eglSwapBuffers calls in QtUbuntu
diff --git a/src/ubuntumirclient/qmirclientglcontext.cpp b/src/ubuntumirclient/qmirclientglcontext.cpp
index 3c67461..5f78e59 100644
--- a/src/ubuntumirclient/qmirclientglcontext.cpp
+++ b/src/ubuntumirclient/qmirclientglcontext.cpp
@@ -47,6 +47,8 @@
#include <QtEglSupport/private/qeglpbuffer_p.h>
#include <QtGui/private/qopenglcontext_p.h>
+#include <QElapsedTimer>
+
@UniversalSuperBox
UniversalSuperBox / gist:07235b6845b7f4bfa796e607ca23a371
Created May 7, 2021 16:25
A quick QML app that renders an icon with the same shape that the Drawer does, then takes a screenshot of it.
//Copyright 2021 Dalton Durst
//
//Permission is hereby granted, free of charge, to any person obtaining a copy
//of this software and associated documentation files (the "Software"), to deal
//in the Software without restriction, including without limitation the rights
//to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
//copies of the Software, and to permit persons to whom the Software is
//furnished to do so.
//
//THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
@UniversalSuperBox
UniversalSuperBox / AWallpaperResolver.qml
Last active June 3, 2021 21:35
Pure-QML solution to select the first loadable image in a list.
/*
* Copyright 2021 UBports Foundation
*
* MIT License
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of this
* software and associated documentation files (the "Software"), to deal in the Software
* without restriction, including without limitation the rights to use, copy, modify, merge,
* publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
* to whom the Software is furnished to do so, subject to the following conditions:
@UniversalSuperBox
UniversalSuperBox / fetch-and-prepare-image-version.sh
Last active October 19, 2021 16:16
Grabs an image from a system-image-server channel for a given device with a given tag
#!/bin/bash
set -e
# Fetches and prepares a certain tag from system server
# First argument: Channel, like '16.04/arm64/android9/stable'
# Second argument: Device, like 'yggdrasil'
# Third argument: Destination directory
# Fourth argument: Image tag, like 'OTA-16'
# The files created in the destination directory can be pushed to /cache/recovery/ on an Ubuntu Touch device.
@UniversalSuperBox
UniversalSuperBox / Help.md
Last active October 27, 2021 20:12
Linux kernel: security/apparmor/lsm.c:1146:2: warning: initialization from incompatible pointer type

While performing a backport of apparmor 3 to kernel 3.4, I received the following error:

security/apparmor/lsm.c:1146:2: warning: initialization from incompatible pointer type
error, forbidden warning: lsm.c:1146

There was no more information. gcc didn't even print the erroneous line. The line in question was: