Tuesday, November 1, 2016

Shortcut view of installing Arch

I haven't tried it, but this looks like a quick reminder of the options needed to install Arch without having to read a virtual book and delve into various links assuming you have done this a few times before:
https://hackaday.io/page/1755-my-parabola-gnulinux-laptop

Tuesday, October 25, 2016

Using extended regular expressions in sed

I've never quite figured out Posix regular expressions, and was trying to replace the first n characters for every line in a file the other day using sed. This is easy if all the lines have at least n characters in them.
sed s/^....//

But sed doesn't suppor the "optional" question mark modifier so lines with less than n characters would not be matched.

It turns out you can turn on extended regex support with "-r" or "--regexp-extended" allowing the following.
sed s/^.?.?.?.?//

Tuesday, September 13, 2016

Enumerate USB devices with udevadm

There's a lot of ways to find USB information, but they seem to give too much or too little information. This script from http://unix.stackexchange.com/questions/144029/command-to-determine-ports-of-a-device-like-dev-ttyusb0 is perfect for me:

for sysdevpath in $(find /sys/bus/usb/devices/usb*/ -name dev); do
    (
        syspath="${sysdevpath%/dev}"
        devname="$(udevadm info -q name -p $syspath)"
        [[ "$devname" == "bus/"* ]] && continue
        eval "$(udevadm info -q property --export -p $syspath)"
        [[ -z "$ID_SERIAL" ]] && continue
        echo "/dev/$devname - $ID_SERIAL"
    )
done

Running it on my system gives:
~ $ usbdiscover.sh 
/dev/input/event9 - Chicony_USB2.0_HD_UVC_WebCam
/dev/video0 - Chicony_USB2.0_HD_UVC_WebCam
/dev/ttyUSB0 - Parallax_Inc_DEF_CON_22_Badge_DAXU3JTE
/dev/input/event1 - Logitech_USB_Receiver
/dev/input/mouse0 - Logitech_USB_Receiver

Monday, August 29, 2016

Make plasma panel visible again after disconnecting external display

I've been having this weird issue which is apparently known, but the workaround I got from https://bugs.kde.org/show_bug.cgi?id=356225 is below:

In $HOME/.config/plasma-org.kde.plasma.desktop-appletsrc there's a section "[Containments][1]". There within the option "lastScreen" often refers to the wrong screen, i.e. "1" instead of "0". When I change that option to "lastScreen=0" before starting the KDE session the panel is visible again on my laptop screen if it is the one and only available screen.

This is an important workaround because this panel not showing up on my laptop prevented my wifi from connecting and caused other odd behaviors.

Thursday, August 18, 2016

Ralink RT3290 Bluetooth in Arch Linux

I've been having all sorts of weird issues getting bluetooth to work in Arch. My card is the Ralink RT3290 Wireless 802.11n 1T/1R PCIe which is both a WiFi and Bluetooth controller.

Found this on the Arch AUR site (https://aur.archlinux.org/packages/rtbth-dkms/?comments=all) and I knew I was on the right track because the author mentioned his machine would freeze when rmmod the bluetooth driver which is a symptom I also had.

By the way, you also need to have installed the rtbth-dkms package from the AUR (and linux-headers). And finally, afterwards I couldn't get high quality sound (A2DP) to work until I unpaired and re-paired my head phones....WHEW.
And oh yeah, everytime I shutdown I get a "watchdog didn't stop" and after a minute or so of waiting I have to hard power off. Still looking into that, but didn't happen before all this.

1. blacklist the module to Prevent it from load on boot:
#echo "blacklist rtbth" > /etc/modprobe.d/ralink-bt.conf

2. Local script, / usr / local / sbin / rtbth, to load and start rtbt tool:

#!/bin/bash
sleep 5
/sbin/modprobe --ignore-install rtbth; /usr/bin/mknod /dev/rtbth c 192 0; /usr/bin/rtbt &

3. systemctl service, the /etc/systemd/system/rtbth.service file:

[Unit]
Description = Fix rtbth bluetooth after gmd start
After = display-manager.service

[Service]
Type = oneshot
ExecStart =/usr/local/sbin/rtbth
TimeoutSec = 0
RemainAfterExit = true

[Install]
WantedBy = multi-user.target

4. enable it to start on boot:
#systemctl enable rtbth

Calculating date offsets with datemath

A quick utility for performing date calculations on the CLI.

Example:
datemath "8/22/16 - 1/11/16"
224

Monday, August 8, 2016

Use bleachbit to clear out unwanted file dregs

Free space on your file system from command line, more comprehensive than simply emptying your trash, good for privacy too.

sudo bleachbit --clean system.trash

From: https://bbs.archlinux.org/viewtopic.php?id=131374

Monday, June 27, 2016

Getting support for BLU phones

It's not obvious how to get help with BLU phone issues, but I received an email from BLU in response to a problem (I had already solved by the time I got the email) that has a link to a page for getting help from a technician. The link is http://bluproducts.force.com/, the email content is reproduced below.

Hello,

Thank you for contacting BLU Products

A technician would be more than happy to help you.

In order to expedite your request, please click below and provide us with all the information required:

**If there is any missing information or incorrect information we will not be able to further assist you**


**Please DO NOT respond to this email**

Should you have any additional questions please contact us at 1-877-602-8762 (Monday-Friday 9:30am-5:30pm EST).

Thank you for choosing BLU!

Best Regards,