nmap -sP 192.168.1.0/24 -oG – | awk ‘/Up$/{print $3}’ | tr -d “()” | grep “\S”
bluetooth hci0: firmware: failed to load brcm/BCM20702A1-0a5c-21e8.hcd (-2)
After inserting my Plugable USB Bluetooth 4.0 Low Energy Micro Adapter (Compatible with Windows 10, 8.1, 8, 7, Raspberry Pi, Linux Compatible, Classic Bluetooth, and Stereo Headset Compatible) device into my debian 9 box I got the following error.
Dec 21 13:02:38 box kernel: [68069.707975] usb 1-1.1: new full-speed USB device number 6 using ehci-pci
Dec 21 13:02:38 box kernel: [68069.819878] usb 1-1.1: New USB device found, idVendor=0a5c, idProduct=21e8, bcdDevice= 1.12
Dec 21 13:02:38 box kernel: [68069.819882] usb 1-1.1: New USB device strings: Mfr=1, Product=2, SerialNumber=3
Dec 21 13:02:38 box kernel: [68069.819885] usb 1-1.1: Product: BCM20702A0
Dec 21 13:02:38 box kernel: [68069.819887] usb 1-1.1: Manufacturer: Broadcom Corp
Dec 21 13:02:38 box kernel: [68069.819889] usb 1-1.1: SerialNumber: 5CF3707E6B94
Dec 21 13:02:38 box systemd[1]: Listening on Load/Save RF Kill Switch Status /dev/rfkill Watch.
Dec 21 13:02:38 box kernel: [68069.870056] alg: No test for fips(ansi_cprng) (fips_ansi_cprng)
Dec 21 13:02:39 box kernel: [68069.954326] Bluetooth: Core ver 2.22
Dec 21 13:02:39 box kernel: [68069.954355] NET: Registered protocol family 31
Dec 21 13:02:39 box kernel: [68069.954357] Bluetooth: HCI device and connection manager initialized
Dec 21 13:02:39 box kernel: [68069.954363] Bluetooth: HCI socket layer initialized
Dec 21 13:02:39 box kernel: [68069.954367] Bluetooth: L2CAP socket layer initialized
Dec 21 13:02:39 box kernel: [68069.954378] Bluetooth: SCO socket layer initialized
Dec 21 13:02:39 box systemd[1]: Starting Load/Save RF Kill Switch Status…
Dec 21 13:02:39 box kernel: [68069.972557] usbcore: registered new interface driver btusb
Dec 21 13:02:39 box systemd[1]: Reached target Bluetooth.
Dec 21 13:02:39 box systemd[1]: Started Load/Save RF Kill Switch Status.
Dec 21 13:02:39 box kernel: [68070.090051] Bluetooth: hci0: BCM: chip id 63
Dec 21 13:02:39 box kernel: [68070.091049] Bluetooth: hci0: BCM: features 0x07
Dec 21 13:02:39 box kernel: [68070.107057] Bluetooth: hci0: BCM20702A
Dec 21 13:02:39 box kernel: [68070.108081] Bluetooth: hci0: BCM20702A1 (001.002.014) build 0000
Dec 21 13:02:39 box kernel: [68070.108588] bluetooth hci0: firmware: failed to load brcm/BCM20702A1-0a5c-21e8.hcd (-2)
Dec 21 13:02:39 box kernel: [68070.110491] firmware_class: See https://wiki.debian.org/Firmware for information about missing firmware
Dec 21 13:02:39 box kernel: [68070.112427] bluetooth hci0: Direct firmware load for brcm/BCM20702A1-0a5c-21e8.hcd failed with error -2
Dec 21 13:02:39 box kernel: [68070.112437] Bluetooth: hci0: BCM: Patch brcm/BCM20702A1-0a5c-21e8.hcd not found
I fixed this by….
1, unplug bluetooth usb
cd /opt
wget https://s3.amazonaws.com/plugable/bin/fw-0a5c_21e8.hcd
mv fw-0a5c_21e8.hcd /lib/firmware/brcm/BCM20702A0-0a5c-21e8.hcd
cp /lib/firmware/brcm/BCM20702A0-0a5c-21e8.hcd /lib/firmware/brcm/BCM20702A1-0a5c-21e8.hcd
re-insert usb bluetooth device
Dec 21 13:05:35 box kernel: [68246.127075] usb 1-1.1: USB disconnect, device number 6
Dec 21 13:05:35 box systemd[1]: Starting Load/Save RF Kill Switch Status…
Dec 21 13:05:35 box systemd[1]: bluetooth.target: Unit not needed anymore. Stopping.
Dec 21 13:05:35 box systemd[1]: Stopped target Bluetooth.
Dec 21 13:05:35 box systemd[1]: Started Load/Save RF Kill Switch Status.
Dec 21 13:05:47 box kernel: [68258.379974] usb 1-1.1: new full-speed USB device number 7 using ehci-pci
Dec 21 13:05:47 box systemd[1]: Starting Load/Save RF Kill Switch Status…
Dec 21 13:05:47 box kernel: [68258.491959] usb 1-1.1: New USB device found, idVendor=0a5c, idProduct=21e8, bcdDevice= 1.12
Dec 21 13:05:47 box kernel: [68258.491963] usb 1-1.1: New USB device strings: Mfr=1, Product=2, SerialNumber=3
Dec 21 13:05:47 box kernel: [68258.491966] usb 1-1.1: Product: BCM20702A0
Dec 21 13:05:47 box kernel: [68258.491968] usb 1-1.1: Manufacturer: Broadcom Corp
Dec 21 13:05:47 box kernel: [68258.491970] usb 1-1.1: SerialNumber: 5CF3707E6B94
Dec 21 13:05:47 box systemd[1]: Reached target Bluetooth.
Dec 21 13:05:47 box systemd[1]: Started Load/Save RF Kill Switch Status.
Dec 21 13:05:47 box kernel: [68258.602129] Bluetooth: hci0: BCM: chip id 63
Dec 21 13:05:47 box kernel: [68258.603126] Bluetooth: hci0: BCM: features 0x07
Dec 21 13:05:47 box kernel: [68258.619133] Bluetooth: hci0: BCM20702A
Dec 21 13:05:47 box kernel: [68258.620132] Bluetooth: hci0: BCM20702A1 (001.002.014) build 0000
Dec 21 13:05:47 box kernel: [68258.620232] bluetooth hci0: firmware: direct-loading firmware brcm/BCM20702A1-0a5c-21e8.hcd
Dec 21 13:05:48 box kernel: [68259.474137] Bluetooth: hci0: BCM20702A1 (001.002.014) build 1338
Dec 21 13:05:48 box kernel: [68259.490136] Bluetooth: hci0: Broadcom Bluetooth Device
Find public ip address using linux command line
Putting these here for my reference as much as everyone else’s. Let me know if you have more ways.
wget -qO- http://ipecho.net/plain ; echo
curl ipinfo.io/ip
curl ifconfig.me
curl icanhazip.com
curl ident.me
curl ifconfig.me
Could not get lock /var/lib/dpkg/lock – open (11: Resource temporarily unavailable)
A package install I was doing got interrupted and when I tried to remove it I got the following error.
E: Could not get lock /var/lib/dpkg/lock - open (11: Resource temporarily unavailable) E: Unable to lock the administration directory (/var/lib/dpkg/), is another process using it?.
To fix I found out what process was using the lock
sudo lsof /var/lib/dpkg/lock
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME dpkg 9442 root 3uW REG 179,2 0 7067 /var/lib/dpkg/lock
And then killed it off
sudo kill -9 9442
Upgrade Debian 6 Squeeze To Wheezy 7
I had a debian box which I needed to upgrade speciffically to wheezy.
nano /etc/apt/sources.list
deb http://mirrors.kernel.org/debian/ wheezy main
deb-src http://mirrors.kernel.org/debian/ wheezy main
deb http://security.debian.org/ wheezy/updates main
deb-src http://security.debian.org/ wheezy/updates main
# wheezy-updates, previously known as 'volatile'
deb http://mirrors.kernel.org/debian/ wheezy-updates main
deb-src http://mirrors.kernel.org/debian/ wheezy-updates main
apt-get update
apt-get upgrade
apt-get dist-upgrade
reboot
Samba hide dot files
.bash_logout
.bashrc
.profile
hide dot files = yes
veto files = /.*/
to [homes] section results in the . (dot) files not being displayed. So my smb.conf [homes] looks like this [homes]
comment = Home
Directories browseable = no
writable = yes
create mask = 0700
directory mask = 0700
valid users = %S
veto files = /.*/
bash: /bin/rm: Argument list too long
for i in *; do
rm -f $i;
done
chmod +x bulkrm
../bulkrm
How To Set Up SSH Keys
Connecting to VPN server via Debian command line
Recently I had the need to connect to a remote VPN server from my Debian box but as I don’t run ‘X’ it had to be done via the command line, after some experimenting I found this simple solution.
Running a script after inserting USB flash drive
I needed the ability to run a bash script after inserting a USB flash drive into a debian box. This can quite easily be achieved using UDEV rules.