Skip to content

Instantly share code, notes, and snippets.

@the-spyke
the-spyke / pipewire.md
Last active July 14, 2024 13:08
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.

@BrianGilbert
BrianGilbert / userChrome.css
Last active June 25, 2024 04:08
Firefox userChrome to autohide Sideberry panel and hide titlebar tabs, and autohide Page Actions.
@namespace url("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul");
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
/*
* This style will hide the tab bar. For MacOS Big Sur
*
* Contributor(s): Isaac-Newt, Ivan0xFF, millerdev, AMomchilov
*/
@crnisamuraj
crnisamuraj / picom-extended.conf
Last active December 22, 2023 16:48
Picom config file for KDE Plasma + Kwin + Picom
### Fading
fading = true;
fade-in-step = 0.06;
fade-out-ste = 0.06;
fade-delta = 3;
fade-exclude = [
"class_g = 'yakuake'"
]
### Opacity
@ikhsanalatsary
ikhsanalatsary / setup_cmder_wsl.md
Last active May 20, 2024 16:30
Setup cmder with WSL 2

Using WSL 2

  1. Open cmder
  2. On the menu, open Settings option and then select Startup > Tasks from the menu tree (or just hit Win + Alt + T)
  3. Click the “+” button to add a new task and fill in the fields as follow:
  4. Name: {zsh::home}
  5. Task Parameters:
    /icon "%CMDER_ROOT%\icons\cmder.ico"
    
#!/bin/bash
export __NV_PRIME_RENDER_OFFLOAD=1
export __GLX_VENDOR_LIBRARY_NAME=nvidia
export __VK_LAYER_NV_optimus=NVIDIA_only
export VK_ICD_FILENAMES=/usr/share/vulkan/icd.d/nvidia_icd.json
exec "$@"
@manuelbl
manuelbl / README.md
Created August 3, 2019 09:12
ESP32 as Bluetooth Keyboard

ESP32 as Bluetooth Keyboard

With its built-in Bluetooth capabilities, the ESP32 can act as a Bluetooth keyboard. The below code is a minimal example of how to achieve it. It will generate the key strokes for a message whenever a button attached to the ESP32 is pressed.

For the example setup, a momentary button should be connected to pin 2 and to ground. Pin 2 will be configured as an input with pull-up.

In order to receive the message, add the ESP32 as a Bluetooth keyboard of your computer or mobile phone:

  1. Go to your computers/phones settings
  2. Ensure Bluetooth is turned on
@nick133
nick133 / gm_aliexpress_fix.js
Last active July 6, 2022 08:33
Fix Aliexpress Country/Currency settings
///
/// !!! Outdated - Not working with current aliexpress version !!!
///
// ==UserScript==
// @name Aliexpress fix locale
// @description Fix Aliexpress country and currency settings
// @icon https://www.aliexpress.com/favicon.ico
// @version 1
// @grant none
// @match https://*.aliexpress.com/*
@mtrimarchi
mtrimarchi / cloudflared
Last active January 4, 2023 11:41
Cloudflared with systemd
# /etc/default/cloudflared
CLOUDFLARED_OPTS=--port 5053 --upstream https://1.1.1.1/dns-query --upstream https://dns.google.com/resolve --upstream https://1.0.0.1/dns-query --upstream https://2606:4700:4700::1111/dns-query --upstream https://2606:4700:4700::1001/dns-query
@bzamecnik
bzamecnik / power_saving_mode_for_nvidia_gtx_980_ti.md
Created March 9, 2019 21:56
Power saving mode for NVIDIA GTX 980 Ti.

My NVIDIA GTX 980 Ti being idle eats 53 W (out of 250 W max). Here's how to put to to a power saving mode at 30 W consumption and keep it prepared to run at higher performance automatically when there's a computation running.

TL;DR

sudo nvidia-smi -pm ENABLED -i 0
sudo nvidia-smi -ac 405,135 -i 0