Skip to content

Instantly share code, notes, and snippets.

View seamusdemora's full-sized avatar
💭
Not again!

Seamus seamusdemora

💭
Not again!
View GitHub Profile
@the-spyke
the-spyke / pipewire.md
Last active April 23, 2024 20:48
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.

#!/usr/bin/env python
import os
import sys
import subprocess
if len(sys.argv) > 1:
files = []
for arg in sys.argv[1:]:
if os.path.exists(arg):
p = os.path.abspath(arg).replace('\\', '\\\\').replace('"', '\\"')
@gdamjan
gdamjan / 0-README.md
Last active November 17, 2023 22:07
hacking the kindle paperwhite

TODO - hack the kindle paperwhite

focus on the gen 2 / DP75SDI

compile kernel + initramfs with openwrt:

  • because it cross-compiles easily
  • has a reasonably simple user-space
  • device-tree?

CONFIG_PACKAGE_kmod-usb-gadget-serial

@tcely
tcely / shebang.awk
Last active January 12, 2023 19:42
A good portable awk shebang is not easy to find.
#!/usr/bin/awk -f
#!/usr/bin/awk -E
#
# If you have an awk version that doesn't support the -f flag,
# then you are just out of luck.
#
# If you just have no clue where awk will be, or you prefer to use -E,
# then you can try this bash snippet to launch awk for you.
#
# You might think the -E tests below are overly complex. You'd be wrong.
# Custom history configuration
# Run script using:
# chmod u+x better_history.sh
# sudo su
# ./better_history.sh
echo ">>> Starting"
echo ">>> Loading configuration into /etc/bash.bashrc"
echo "HISTTIMEFORMAT='%F %T '" >> /etc/bash.bashrc
echo 'HISTFILESIZE=-1' >> /etc/bash.bashrc
@NonaSuomy
NonaSuomy / gist:a62a9a125d61fc5df748066961702ac6
Created June 30, 2017 01:01 — forked from anonymous/gist:8b4a0101f5101f756bb9
Get OAUTH2.0 access token for Google Voice with a shell-script
#!/bin/bash
##
## Authenticate with Google Voice
##
USAGE="`basename $0` {auth|refresh|token} ctx"
CTX_DIR=$HOME/.gvauth
CLIENT_ID="YOUR_CLIENTID_FROM_GOOGLE_DEVELOPER_CONSOLE"
CLIENT_SECRET="YOUR_CLIENTSECRET_FROM_GOOGLE_DEVELOPER_CONSOLE"
SCOPE="https://www.googleapis.com/auth/googletalk%20https://www.googleapis.com/auth/userinfo.email%20https://www.googleapis.com/auth/userinfo.profile"
@andreibosco
andreibosco / raspberry-disable-ipv6.md
Created March 24, 2017 21:06
Raspberry Pi: disable IPv6
@roadrunner2
roadrunner2 / 0 Linux-On-MBP-Late-2016.md
Last active February 29, 2024 16:29
Linux on MacBook Pro Late 2016 and Mid 2017 (with Touchbar)

Introduction

This is about documenting getting Linux running on the late 2016 and mid 2017 MPB's; the focus is mostly on the MacBookPro13,3 and MacBookPro14,3 (15inch models), but I try to make it relevant and provide information for MacBookPro13,1, MacBookPro13,2, MacBookPro14,1, and MacBookPro14,2 (13inch models) too. I'm currently using Fedora 27, but most the things should be valid for other recent distros even if the details differ. The kernel version is 4.14.x (after latest update).

The state of linux on the MBP (with particular focus on MacBookPro13,2) is also being tracked on https://github.com/Dunedan/mbp-2016-linux . And for Ubuntu users there are a couple tutorials (here and here) focused on that distro and the MacBook.

Note: For those who have followed these instructions ealier, and in particular for those who have had problems with the custom DSDT, modifying the DSDT is not necessary anymore - se

@salcode
salcode / bash-script-git.sh
Created September 5, 2015 19:54
Notes for bash scripting git commands
# Current branch - Determine current git branch, store in $currentbranch, and exit if not on a branch
if ! currentbranch=$(git symbolic-ref --short -q HEAD)
then
echo We are not currently on a branch.
exit 1
fi
# Uncommited Changes - Exit script if there uncommited changes
if ! git diff-index --quiet HEAD --; then
echo "There are uncommited changes on this repository."