Skip to content

Instantly share code, notes, and snippets.

View halfwit's full-sized avatar
🙄
What?! This is the face that launched a thousand ships?!

halfwit halfwit

🙄
What?! This is the face that launched a thousand ships?!
View GitHub Profile
@dasJ
dasJ / windows
Last active August 29, 2017 19:36
Qemu final
#!/bin/bash
xhost local:root > /dev/null
if ! [ -d /sys/fs/cgroup/cpuset/windows ]; then
sudo cgcreate -t $USER:users -a $USER:users -g cpuset:windows
fi
/bin/echo "2-7" > /sys/fs/cgroup/cpuset/windows/cpuset.cpus
/bin/echo "0" > /sys/fs/cgroup/cpuset/windows/cpuset.mems
@Earnestly
Earnestly / fonts.adoc
Last active March 17, 2022 08:04
Better Defaults for Freetype

Better Defaults for Freetype

Table of Contents

Introduction

@Earnestly
Earnestly / makepkg_overview.rst
Last active March 22, 2024 03:48
A brief overview of the process involved in creating a pacman package.

A Brief Tour of the Makepkg Process: What Makes a Pacman Package

Introduction

This is a terse document covering the anatomy of a package built for the pacman package manager.

The following example commands can mostly run verbatim to manually create a

@denji
denji / golang-tls.md
Last active April 29, 2024 03:39 — forked from spikebike/client.go
Simple Golang HTTPS/TLS Examples

Moved to git repository: https://github.com/denji/golang-tls

Generate private key (.key)
# Key considerations for algorithm "RSA" ≥ 2048-bit
openssl genrsa -out server.key 2048

# Key considerations for algorithm "ECDSA" ≥ secp384r1
# List ECDSA the supported curves (openssl ecparam -list_curves)

These are only examples, for a few very common actions. You are expected to write your own rules for the rest. The syntax is regular JavaScript, but see the polkit(8) manpage for the object structure and available API. These examples are for polkit versions 106 and later, with the JS interpreter. They won't work with Debian's polkit v105.

  • If you don't know the action name, run pkaction:

    pkaction | grep cups
    
  • The possible results are YES, AUTH_SELF(_KEEP), AUTH_ADMIN(_KEEP), NO. Returning a result is final. Returning null will continue checking other rules.

  • Put your rules in /etc/polkit-1/rules.d/*.rules. (You can check everything in one giant addRule, or you can have a separate file and separate addRule for each program; it doesn't matter.)