Skip to content

Instantly share code, notes, and snippets.

@Waltibaba
Waltibaba / gist:28741f08b12696bc291cbdcb3a2c748f
Created November 8, 2022 07:12
pipewire configs: default device & echo cancel
~/.config/pipewire/pipewire.conf.d/10-bt-headphones-default.conf
===========
context.properties = [
default.configured.audio.sink = { "name": "bluez_output.AC_12_2F_24_80_86.1" }
]
===========
~/.config/pipewire/pipewire.conf.d/20-echo-cancel.conf
===========
context.modules = [
{ name = libpipewire-module-echo-cancel
# to install with full disk encryption and more than 1 partition, you need to either
* enter your password for each encrypted partition (also your disk layout is transparent)
* install a helper to enter a single password multiple times
* put all the partitions into LVM and decrypt once (at the cost of more abstraction layers)
with EFI + GRUB + LVM on a big LUKS on /dev/sda, these are the steps:
1. partition with a small (~300MB ESP partition for EFI) as /dev/sda1, and a large LUKS partition as /dev/sda2
2. encrypt /dev/sda2
`cryptsetup -v --type luks --iter-time 5000 --verify-passphrase luksFormat /dev/sda2`
--iter-time increases iterations of pbkdf2, to increase security at the cost of time
#!/bin/bash
echo "testing for sudo"
sudo date
if [ $? -ne 0 ]
then
echo "failed sudo"
return -1
fi
@Waltibaba
Waltibaba / 10-tpm.sh
Created November 13, 2019 21:27
suspend hook for tpm issues on kernel 5.1+
#!/bin/bash
# put this in /usr/lib/systemd/system-sleep/
# don't forget to chmod +x it
case $1/$2 in
pre/*)
# echo "Going to $2..."
/usr/bin/rmmod tpm
/usr/bin/rmmod tpm_tis
/usr/bin/rmmod tpm_tis_core
@Waltibaba
Waltibaba / pacman-upgrade-hooks
Last active April 15, 2019 10:19
/etc/pacman.d/hooks/. - pacman hooks for not killing the system when there's a kernel update.
/etc/pacman.d/hooks/backup-modules.hook
[Trigger]
Operation = Upgrade
Operation = Remove
Type = Package
Target = linux
[Action]
Depends = coreutils
Depends = bash
enable it:
/etc/pulse/default.pa
=========
### Enable Echo/Noise-Cancelation
load-module module-echo-cancel source_name=echoCancel_source sink_name=echoCancel_sink aec_method=webrtc aec_args="analog_gain_control=0 digital_gain_control=1"
set-default-source echoCancel_source
set-default-sink echoCancel_sink
stop the echoey crackling (https://bbs.archlinux.org/viewtopic.php?id=116172) uncomment/edit these lines:
@Waltibaba
Waltibaba / coreboot_config_t420_2017_02
Created May 23, 2017 11:15
coreboot build configuration for t420, applicable to master branch around february 2017. Requires VGA and nvramcui binaries
#
# Automatically generated file; DO NOT EDIT.
# coreboot configuration
#
#
# General setup
#
CONFIG_LOCALVERSION=""
CONFIG_CBFS_PREFIX="fallback"
@Waltibaba
Waltibaba / systemd graphical program
Created February 14, 2017 16:04
systemd graphical script/prog
[Unit]
Description="graphical application"
JobTimeoutSec=60
AssertPathExists=/home/USERNAME
[Service]
WorkingDirectory=/home/USERNAME
Environment=XAUTHORITY=/home/USERNAME/.Xauthority
Environment=DISPLAY=:0
Type=forking
http://stackoverflow.com/questions/15291500/i-have-2-versions-of-python-installed-but-cmake-is-using-older-version-how-do
EITHER:
find_package( PythonLibs 2.7 REQUIRED ) # if it already has a find_package(PythonLibs)
OR:
needed to use python2.7 to compile an older library, but cmake keeps picking up my python3.2 libraries (and executable).
First, I ran cmake with default options, then edited the CMakeCache.txt file which it generated. I did it this way primarily because I didn't know the proper -D... incantations to cause cmake to get the python library and include paths, etc right in the first place.
In my CmakeCache.txt, I found lines like this
[Unit]
Description="Script actions description"
JobTimeoutSec=60
AssertPathExists=/path/to
[Service]
Type=simple #forking
ExecStart=/bin/bash /path/to/script.sh
Nice=0