Skip to content

Instantly share code, notes, and snippets.

@the-spyke
the-spyke / pipewire.md
Last active March 29, 2024 14:25
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.

@OrionReed
OrionReed / DOM3D.js
Last active March 29, 2024 14:25
3D DOM viewer, copy-paste this into your console to visualise the DOM topographically.
// 3D Dom viewer, copy-paste this into your console to visualise the DOM as a stack of solid blocks.
// You can also minify and save it as a bookmarklet (https://www.freecodecamp.org/news/what-are-bookmarklets/)
(() => {
const SHOW_SIDES = false; // color sides of DOM nodes?
const COLOR_SURFACE = true; // color tops of DOM nodes?
const COLOR_RANDOM = false; // randomise color?
const COLOR_HUE = 190; // hue in HSL (https://hslpicker.com)
const MAX_ROTATION = 180; // set to 360 to rotate all the way round
const THICKNESS = 20; // thickness of layers
const DISTANCE = 10000; // ¯\\_(ツ)_/¯
@pedroarthur
pedroarthur / install_packages.sh
Created June 30, 2019 18:45
Minimal KDE Plasma on Debian Buster
#!/bin/bash
set -x;
apt-get update -yq
packages=(
# can I haz sandwich?
aspell-en
hunspell-en-us
@shoaloak
shoaloak / fix-entitlements.sh
Last active March 29, 2024 14:21
This script automates the process of granting specific entitlements to a set of iOS binaries, resolving issues related to 'Operation not permitted' errors, e.g., when accessing /private/var/mobile/Containers.
#!/bin/bash
# Author: Shoaloak (Axel Koolhaas) 2024
# Description: Fix iOS binary entitlements/access for "Operation not permitted"
ENTITLEMENT="com.apple.private.security.container-manager"
binaries=("sh" "bash" "zsh" "dash" # Shell
"ls" "cat" "find" "cp" "mv" # File management
"rm" "mkdir" "rmdir" "touch"
"file" "ln" "du" "scp"
"chmod" "chown" "chgrp" # Permissions
@jhaddix
jhaddix / content_discovery_all.txt
Created May 26, 2018 11:51
a masterlist of content discovery URLs and files (used most commonly with gobuster)
This file has been truncated, but you can view the full file.
`
~/
~
ים
___
__
_
@jhaddix
jhaddix / all.txt
Created January 19, 2019 04:35 — forked from orangetw/all.txt
all wordlists from every dns enumeration tool... ever. Please excuse the lewd entries =/
This file has been truncated, but you can view the full file.
.
..
........
@
*
*.*
*.*.*
🐎
@genedy2017
genedy2017 / k8s-helmfile-ubuntu.md
Created February 12, 2023 13:25
Install k8s + helm + helmfile on Ubuntu

Exactly how to install k8s + helm + helmfile on a fresh Ubuntu machine?

The web is full of outdated and confusing instructions, specially for installing and configuring docker, as well as getting helmfile to work! Moreover, those instructions are mostly defragmented among many sites and pages. I didn't find a single compiled list of steps in one place. So I decided to make one!

This is what worked for me on Ubuntu Jammy 22.04 64bit in Feb 2023 — YMMV!

  1. Update repos:
@jboner
jboner / latency.txt
Last active March 29, 2024 14:26
Latency Numbers Every Programmer Should Know
Latency Comparison Numbers (~2012)
----------------------------------
L1 cache reference 0.5 ns
Branch mispredict 5 ns
L2 cache reference 7 ns 14x L1 cache
Mutex lock/unlock 25 ns
Main memory reference 100 ns 20x L2 cache, 200x L1 cache
Compress 1K bytes with Zippy 3,000 ns 3 us
Send 1K bytes over 1 Gbps network 10,000 ns 10 us
Read 4K randomly from SSD* 150,000 ns 150 us ~1GB/sec SSD
@troykelly
troykelly / INTEGRATION.md
Last active March 29, 2024 14:17
Automatically mount rclone mounts

Automatic Rclone Mounting and Unmounting on macOS

Prerequisites

  • rclone configured with remotes.
  • The mounting script is properly set up.
  • brew package manager for installing sleepwatcher.

Steps

@haacked
haacked / ModelBuilderExtensions.cs
Last active March 29, 2024 14:16
Example of applying an EF Core global query filter on all entity types that implement an interface
/*
Copyright Phil Haack
Licensed under the MIT license - https://github.com/haacked/CodeHaacks/blob/main/LICENSE.
*/
using System;
using System.Linq;
using System.Linq.Expressions;
using System.Reflection;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata.Builders;