Skip to content

Instantly share code, notes, and snippets.

View djschleen's full-sized avatar
🐚

DJ Schleen djschleen

🐚
View GitHub Profile
@djschleen
djschleen / pipewire.md
Created May 1, 2024 00:47 — forked from the-spyke/pipewire.md
Enable PipeWire on Ubuntu 22.04

Enable PipeWire on Ubuntu 22.04

This guide is only for original Ubuntu out-of-the-box packages. If you have added a custom PPA like pipewire-debian, you might get into conflicts.

Ubuntu 22.04 has PipeWire partially installed and enabled as it's used by browsers (WebRTC) for recoding the screeen under Wayland. We can enable remaining parts and use PipeWire for audio and Bluetooth instead of PulseAudio.

Starting from WirePlumber version 0.4.8 automatic Bluetooth profile switching (e.g. switching from A2DP to HSP/HFP when an application needs microphone access) is supported. Jammy (22.04) repos provide exactly version 0.4.8. So, we're good.

Based on Debian Wiki, but simplified for Ubuntu 22.04.

@djschleen
djschleen / instructions.md
Created February 6, 2024 03:07 — forked from matthewjberger/instructions.md
Install a nerd font on ubuntu

1.) Download a Nerd Font

2.) Unzip and copy to ~/.fonts

3.) Run the command fc-cache -fv to manually rebuild the font cache

@djschleen
djschleen / macapp.go
Created January 9, 2023 21:15 — forked from mholt/macapp.go
Distribute your Go program (or any single binary) as a native macOS application
// Package main is a sample macOS-app-bundling program to demonstrate how to
// automate the process described in this tutorial:
//
// https://medium.com/@mattholt/packaging-a-go-application-for-macos-f7084b00f6b5
//
// Bundling the .app is the first thing it does, and creating the DMG is the
// second. Making the DMG is optional, and is only done if you provide
// the template DMG file, which you have to create beforehand.
//
// Example use:
@djschleen
djschleen / capturestdout.go
Created May 5, 2021 15:36
Given a function, returns a string containing what should have been written to the stdout
package main
func captureStdout(f func()) (captured string, err error) {
r, w, err := os.Pipe()
if err != nil {
log.Fatal(err)
}
origStdout := os.Stdout
os.Stdout = w
@djschleen
djschleen / remove_zsh_warning.sh
Created October 9, 2019 16:35
Removes the terminal zsh warning in OSX Catalina
#!/bin/bash
# Add the following to your .bashrc or .bash_profile on
# a Mac running OSX Catalina to disable the annoying "zsh" warning
export BASH_SILENCE_DEPRECATION_WARNING=1
@djschleen
djschleen / install-cockpit-debian-buster.sh
Created September 27, 2019 17:02
Installs Cockpit on a Debian Buster OS with valid GPG keys for APT
#!/bin/bash
if [ "$EUID" -ne 0 ]; then
echo "To install Cockpit you need to need to be root (sudo su)"
exit
else
echo "Installing Cockpit for Debian Buster"
fi
echo
@djschleen
djschleen / k8s-in-10.sh
Last active September 23, 2019 06:40
Create a Kubernetes instance locally with k3s in under 10 seconds
#!/bin/bash
# Kubernetes in 10 seconds (with k3s)
#
# WARNING!!!!
#
# This script uses root account access to install k3s and pipes a downloaded
# to sh. ALWAYS DOWNLOAD SCRIPTS AND REVIEW THE CODE BEFORE CALLING SH.
# Note that no security hardening has been done. Please run this in a contained
# environment without incoming access from the internet. For alternative methods
@djschleen
djschleen / install-cockpit-debian-stretch.sh
Last active September 27, 2019 17:01
Installs Cockpit on a Debian Stretch OS with valid GPG keys for APT
#!/bin/bash
if [ "$EUID" -ne 0 ]; then
echo "To install Cockpit you need to need to be root (sudo su)"
exit
else
echo "Installing Cockpit"
fi
echo
{"lastUpload":"2020-07-17T15:36:50.742Z","extensionVersion":"v3.4.3"}
@djschleen
djschleen / registry-ca-daemonset.yaml
Created November 26, 2017 22:40
Installs a CA Certificate for a Docker Registry on Every Node in Kubernetes
apiVersion: extensions/v1beta1
kind: DaemonSet
metadata:
name: registry-ca
namespace: kube-system
labels:
k8s-app: registry-ca
spec:
template:
metadata: