Skip to content

Instantly share code, notes, and snippets.

@mgbckr
mgbckr / switch_bluetooth_profile.sh
Last active November 22, 2023 09:03
Method to make audio quality better for bluetooth headsets on linux (Fedora 34) using mSBC
#!/bin/bash
# source: https://bbs.archlinux.org/viewtopic.php?pid=1973004
# prepare via enabling mSBC codec for HSP/HFP:
# https://wiki.archlinux.org/title/PipeWire#Low_audio_quality_on_Bluetooth
# the `bluez-monitor.conf` is located at:
# `/usr/share/pipewire/media-session.d/bluez-monitor.conf`
# note that the settings gui needs to be restarted after editing the file and calling
# `systemctl --user restart pipewire.service`
#msbc=`pactl list | grep Active | grep msbc`
@briantissue
briantissue / gist:1c8b15c80d472c41ffa6
Created January 27, 2015 21:23
Migrate Linux UIDs and GIDS to new box excluded system IDs
#!/bin/bash
#This shell script is moving uids and gids to new server without grabbing the system accounts
#The one caveat with this script is confirming the UID start limit and upper limit for your distro
#This can be confirmed by checking the /etc/libuser.conf it is denoted there in RHEL distros
#This script is to be ran from the /tmp directory as denoted in BASE
#This script is valid for 6.5 RHEL and down as is. Change UGIDLIMIT to 1000 for v7.0
#Create directory for migration files
BASE=/tmp
if [ -d ${BASE}/move ]
apt-get install python2.7-dev python2.7
apt-get build-dep gdb
apt-get source gdb
sed -i -E "s|python3|/usr/bin/python2.7|" debian/rules
dpkg-buildpackage -uc -us -j8
dpkg-install ../*.deb
@kinverarity1
kinverarity1 / loaded_modules.py
Last active June 3, 2020 13:05
List loaded Python modules and packages, and show their version numbers and/or Git repository's HEAD commit SHA. Example: http://nbviewer.ipython.org/6038316/zz_example.ipynb
'''List loaded modules and packages, and show their version numbers
and/or Git repository's HEAD commit SHA.
'''
# Standard library modules
import types
# Third-party packages
import git # GitPython
@kristianhellquist
kristianhellquist / custom.el
Created July 10, 2012 09:50
Emacs, copy current file and line number to clipboard
(defun copy-current-line-position-to-clipboard ()
"Copy current line in file to clipboard as '</path/to/file>:<line-number>'"
(interactive)
(let ((path-with-line-number
(concat (buffer-file-name) ":" (number-to-string (line-number-at-pos)))))
(x-select-text path-with-line-number)
(message (concat path-with-line-number " copied to clipboard"))))
(define-key global-map (kbd "M-l") 'copy-current-line-position-to-clipboard)