Skip to content

Instantly share code, notes, and snippets.

@sigmaris
sigmaris / added_debugging.log
Last active November 16, 2019 09:13
Rockpro64 panic after reboot with mainline kernel
[ 0.000000][ T0] Booting Linux on physical CPU 0x0000000000 [0x410fd034]
[ 0.000000][ T0] Linux version 5.4.0-rc1-gc5bd8fa4431f-sigmaris (root@a29a4080688d) (gcc version 8.3.0 (Debian 8.3.0-2)) #sigmaris SMP PREEMPT Sun Oct 6 15:58:04 UTC 2019
[ 0.000000][ T0] Machine model: Pine64 RockPro64
[ 0.000000][ T0] earlycon: uart8250 at MMIO32 0x00000000ff1a0000 (options '')
[ 0.000000][ T0] printk: bootconsole [uart8250] enabled
[ 0.000000][ T0] cma: Reserved 16 MiB at 0x00000000f7000000
[ 0.000000][ T0] NUMA: No NUMA configuration found
[ 0.000000][ T0] NUMA: Faking a node at [mem 0x0000000000200000-0x00000000f7ffffff]
[ 0.000000][ T0] NUMA: NODE_DATA [mem 0xf67ec800-0xf67edfff]
[ 0.000000][ T0] Zone ranges:
[ 0.000000] Booting Linux on physical CPU 0x0000000000 [0x410fd034]
[ 0.000000] Linux version 5.3.0-rc6-next-20190830-g4fe25a02c4f1-sigmaris (root@rp64builder) (gcc version 8.3.0 (Debian 8.3.0-2)) #sigmaris SMP PREEMPT Sun Sep 1 16:50:21 BST 2019
[ 0.000000] Machine model: Pine64 RockPro64
[ 0.000000] earlycon: uart8250 at MMIO32 0x00000000ff1a0000 (options '')
[ 0.000000] printk: bootconsole [uart8250] enabled
[ 0.000000] cma: Reserved 16 MiB at 0x00000000f7000000
[ 0.000000] NUMA: No NUMA configuration found
[ 0.000000] NUMA: Faking a node at [mem 0x0000000000200000-0x00000000f7ffffff]
[ 0.000000] NUMA: NODE_DATA [mem 0xf67ed800-0xf67eefff]
[ 0.000000] Zone ranges:
@sigmaris
sigmaris / drm_info.txt
Created June 4, 2019 22:42
drm_info from Rockpro64 on mainline Linux kernel
./drm_info /dev/dri/card0
Node: /dev/dri/card0
├───Driver: rockchip (RockChip Soc DRM) version 1.0.0 (20140818)
│ ├───DRM_CLIENT_CAP_STEREO_3D supported
│ ├───DRM_CLIENT_CAP_UNIVERSAL_PLANES supported
│ ├───DRM_CLIENT_CAP_ATOMIC supported
│ ├───DRM_CLIENT_CAP_ASPECT_RATIO supported
│ ├───DRM_CLIENT_CAP_WRITEBACK_CONNECTORS supported
│ ├───DRM_CAP_DUMB_BUFFER = 1
│ ├───DRM_CAP_VBLANK_HIGH_CRTC = 1
debian/rules override_dh_install
make[1]: Entering directory '/opt/build/mesa'
# purge .la files
find debian/tmp/ -name '*.la' -exec rm '{}' ';'
# Get rid of some files which aren't installed. Do not
# use -f to ensure we notice disappearing files:
rm debian/tmp/usr/lib/*/libglapi.so
rm debian/tmp/usr/lib/*/libEGL_mesa.so
rm debian/tmp/usr/lib/*/libGLX_mesa.so
# Copy the hardlinked *_dri.so correctly.
@sigmaris
sigmaris / build_qemu_debian_image.sh
Last active March 21, 2024 06:13
Automate the installation of Debian Buster on a x86_64 QEMU 4.0.0 VM hosted on macOS
#!/bin/bash -e
if [ "$(uname -s)" != "Darwin" ]
then
echo "This script is for building a Debian x86_64 image to use on MacOS"
exit 1
fi
TEMP="$(mktemp -d build.XXXXX)"
cp preseed.cfg $TEMP

Keybase proof

I hereby claim:

  • I am sigmaris on github.
  • I am sigmaris (https://keybase.io/sigmaris) on keybase.
  • I have a public key ASDcS515Q1oxK2QCBjqXL0-p_hD724sLpOERp4bikw5Ylwo

To claim this, I am signing this object:

@sigmaris
sigmaris / kms_mode_test.c
Created June 20, 2018 22:19
Linux KMS mode tester, compile with: gcc -g -Wall -Wextra -o kms_mode_test kms_mode_test.c `pkg-config --cflags --libs ncurses form libdrm egl gl gbm`
/*
* Copyright © 2011 Kristian Høgsberg
* Copyright © 2011 Benjamin Franzke
* Copyright © 2018 Hugh Cole-Baker
*
* Permission to use, copy, modify, distribute, and sell this software and its
* documentation for any purpose is hereby granted without fee, provided that
* the above copyright notice appear in all copies and that both that copyright
* notice and this permission notice appear in supporting documentation, and
* that the name of the copyright holders not be used in advertising or
@sigmaris
sigmaris / Enabling-LDAP-logins.md
Last active March 3, 2018 19:17
Enabling LDAP logins for Mastodon

Enabling LDAP logins

Follow this guide to use LDAP for external authentication of users. When a user logs in to the Mastodon instance, their username and password will be verified by authenticating (binding) to an LDAP server. If a user exists in the LDAP directory and logs in to the Mastodon instance for the first time, a user account will be auto-created on the Mastodon instance for them.

Installing LDAP support

First, install the gem(s) required for LDAP support, by running bundle install with the LDAP_ENABLED environment variable set to true:

LDAP_ENABLED=true bundle install
@sigmaris
sigmaris / textlint.py
Last active August 18, 2017 12:03
Linter for any plain text files
#!/usr/bin/env python
import argparse
import fnmatch
import os
import re
import sys
MIXED_TABS_SPACES = re.compile(r"^\t* +(\t+)")
TRAILING_WHITESPACE = re.compile(r"(.*)([ \t\r\f\v]+)$")
@sigmaris
sigmaris / Makefile
Created June 20, 2017 10:16
Hack for setting gamma curves using linux KMS API
LIBDRM_CFLAGS := $(shell pkg-config --cflags libdrm)
LIBDRM_LIBS := $(shell pkg-config --libs libdrm)
.PHONY = all clean
all: setgamma
clean:
rm setgamma *.o