This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/expect -f | |
set prompt "#" | |
set address [lindex $argv 0] | |
spawn sudo bluetoothctl -a | |
expect -re $prompt | |
send "remove $address\r" | |
sleep 1 | |
expect -re $prompt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
SOC_USB=/sys/devices/platform/soc/20980000.usb | |
if [ ! -d $SOC_USB ]; | |
then | |
SOC_USB=/sys/devices/platform/soc/3f980000.usb # Raspberry Pi 3 | |
fi | |
BUSPOWER=$SOC_USB/buspower |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/expect -f | |
set prompt "#" | |
set address [lindex $argv 0] | |
spawn sudo bluetoothctl -a | |
expect -re $prompt | |
send "default-agent\r" | |
expect "Default agent request successful" | |
send "remove $address\r" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
wget https://dl.google.com/android/repository/platform-tools-latest-linux.zip | |
unzip \platform-tools-latest-linux.zip | |
sudo cp platform-tools/adb /usr/bin/adb | |
sudo cp platform-tools/fastboot /usr/bin/fastboot |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# /etc/udev/rules.d/20-bt-auto-enable-a2dp.rules | |
# hxss | |
SUBSYSTEM=="bluetooth", ACTION=="add", RUN+="/home/replace-it/bt-auto-enable-a2dp.sh" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
SOURCE="${BASH_SOURCE[0]}" | |
# Resolve $SOURCE until the file is no longer a symlink. | |
while [ -h "$SOURCE" ]; do | |
DIR="$( cd -P "$( dirname "$SOURCE" )" >/dev/null 2>&1 && pwd )" | |
SOURCE="$(readlink "$SOURCE")" | |
[[ $SOURCE != /* ]] && SOURCE="$DIR/$SOURCE" | |
# If $SOURCE was a relative symlink, we need to resolve it | |
# relative to the path where the symlink file was located. | |
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
if [ -n "$SSH_CLIENT" ] || [ -n "$SSH_TTY" ]; then | |
SESSION_TYPE=remote/ssh | |
elif pstree -p | egrep --quiet --extended-regexp ".*sshd.*\($$\)"; then | |
SESSION_TYPE=remote/ssh | |
else | |
case $(ps -o comm= -p $PPID) in | |
sshd|*/sshd) SESSION_TYPE=remote/ssh;; | |
esac | |
fi |