You are not logged in.
I found create_ap and it's so cool that I thought I'd tell all my Devuan friends about it
It works similarly to the "Hotspot" function on Android phones and is free software (FreeBSD license).
0. Before proceeding, make sure your wireless card supports AP (access point) mode. You want to see "AP" listed when you run "iw list" in a terminal:
bruno@thinkpad:~$ iw list
Wiphy phy0
---snip---
Supported interface modes:
* IBSS
* managed
* AP1. To get all create_ap's dependencies:
sudo apt-get util-linux procps hostapd iproute2 iw iwconfig haveged2. Last step is to get create_ap itself from their github page. To "install" it, just download the zip from github, extract it, then run sudo make install from the root of the extracted folder. Nothing is actually compiled--the make command simply copies some things over to /usr/bin. To uninstall, running sudo make uninstall from the root of the extracted folder removes everything.
---
Now enjoy all the options this opens up:
If you have a laptop connected to wifi and want to use the laptop as a wifi repeater (yes, this actually works with a single wireless adapter):
create_ap wlan0 wlan0 MyAccessPoint MyPassPhraseIf you have a laptop connected to ethernet that you want to use as a router:
create_ap wlan0 eth0 MyAccessPoint MyPassPhraseIf you have a laptop connected to ethernet and running openvpn that you want to use as a vpn router:
create_ap wlan0 tun0 MyAccessPoint MyPassPhraseAmazing, right?
Hello, oui. I used ibus for years, but was annoyed by some buggy behavior and now I only use a python/bash script I wrote. The script allows you to use custom two-character combinations to trigger unicode characters (e.g., a` triggers à and c; triggers ç). One could expand the script to also have 3+ character triggers if this were necessary.
You just install the handful of dependencies, customize the script with your unicode characters and triggers, run the script, and start typing. Script changes nothing on your machine and leaves no trace when you stop it from its taskbar icon.
I realize that for a language like Chinese something like my script isn't going to work given that you'd need to define triggers for thousands of unicode characters, but depending on the language (e.g., for French) it might be a nice option.
Thanks, ralph.ronnquist. I'll explore that option.
In the meantime, I found yet another gem. Here is a python script that sends a signal to somescript whenever there is any mouse or keyboard activity:
from pynput import keyboard
from pynput import mouse
import os
def send_signal()
os.system('pkill -USR1 somescript')
def on_press(key):
send_signal()
def on_move(x, y):
send_signal()
def on_click(x, y, button, pressed):
send_signal()
def on_scroll(x, y, dx, dy):
send_signal()
with mouse.Listener(on_move=on_move, on_click=on_click, on_scroll=on_scroll) as listener:
with keyboard.Listener(on_press=on_press) as listener:
listener.join()It would be easy to adapt the above to only send the signal in a subset of cases (e.g., only on left clicks).
I couldn't find anything suitable, so I rolled my own alternative to ibus. It's a simple bash script that allows typing diacritic either before or after the letter, user's choice. The script does not use "preedit text", so no characters ever disappear.
Getting the dependencies:
sudo apt-get install xvkbd python3 && sudo pip3 install pynputYou also need to install yad, which is not in the Devuan Jessie repositories but is easy to find (e.g., by clicking on your architecture at the bottom of this page).
pynput didn't work for me at first because one of its dependencies, the "six" module, was outdated. So, to be safe:
sudo pip3 install --upgrade sixWell, here's the script. It should "just work" once you have all the dependencies. You only need to alter it if you want to add or change the special characters section.
#!/bin/bash
# International keyboard (alternative to ibus for x11)
# Author: Bruno "GNUser" Dantas
# License: GPLv3
# Dependencies:
# sudo apt-get install xvkbd python3 yad
# sudo pip3 install pynput
# Usage:
# - Change the triggers and unicode sequences in "watch_for_triggers" function to suit your needs
# - Run this script as regular user to turn on the international keyboard
# - Stop the script--via taskbar icon or, if running in terminal, Control+c--to clean up without a trace
main()
{
create_pipe
create_keylogger # writes to pipe
create_taskbar_icon
watch_for_triggers # reads from pipe, replaces user-defined character combinations with unicode characters
}
create_pipe()
{
pipe=/tmp/international
rm -f $pipe
mkfifo $pipe
exec 3<>$pipe
}
create_keylogger()
{
# to troubleshoot the keylogger:
# 1. copy the python code below into a file foo
# 2. comment out the three fifo lines, uncomment the print line in log_it function
# 3. in a terminal: python3 /path/to/foo
# 4. type stuff outside the terminal and watch terminal
echo "
from pynput import keyboard
from pynput import mouse
import os
fifo_write = open('$pipe', 'w')
def log_it(output):
fifo_write.write(output + '\n')
fifo_write.flush()
#print(output)
# get initial capslock state
exit_code = os.system('''xset q 2>/dev/null | grep -q -E 'Caps Lock: +on' ''')
if exit_code == 0:
capslock_in_effect = True
else:
capslock_in_effect = False
# this function runs each time a key is pressed:
def on_press(key):
global capslock_in_effect
output = str(key)
if output == 'Key.caps_lock': # if capslock pressed, toggle capslock state
capslock_in_effect = not capslock_in_effect
if not output.startswith('Key'): # special keys start with 'Key' and can be logged as-is
output = output[1:-1] # remove quotes around character
if capslock_in_effect:
output = output.swapcase()
if not output.startswith('Key.shift'): # don't log shift keys (e.g., while loop expects a~ not aKey.shift~)
log_it(output)
# this function runs each time a mouse button is pressed:
def on_click(x, y, button, pressed):
button = str(button)
if pressed and button == 'Button.left':
log_it('Key.mousebutton_left')
# start listening
with mouse.Listener(on_click=on_click) as listener:
with keyboard.Listener(on_press=on_press) as listener:
listener.join()
" >/tmp/tiny-keylogger
python3 /tmp/tiny-keylogger &
}
echo "$(basename $0)" >/tmp/scriptname # so cleanup function can find this script's name when called from yad
cleanup()
{
echo "Cleaning up..."
pkill -f International # kill taskbar icon
pkill -f tiny-keylogger # kill keylogger
pkill -KILL "$(cat /tmp/scriptname)" # kill this script
}
trap cleanup EXIT HUP TERM INT
create_taskbar_icon()
{
export -f cleanup
yad --notification --image='accessories-character-map' --text='International Keyboard' \
--no-middle --menu="Stop!bash -c cleanup" --command='' &
}
replace()
{
xvkbd -xsendevent -text "\b\b\[U$1]" # send two backspaces then desired unicode character
}
watch_for_triggers()
{
# endless loop (it reads from a fifo pipe, so never encounters EOF)
while read current_char; do
echo "${previous_char}${current_char}" # for debugging while running in terminal
case "${previous_char}${current_char}" in
# Portuguese
'A`') replace 00C0;;
'a`') replace 00E0;;
"A'") replace 00C1;;
"a'") replace 00E1;;
'A^') replace 00C2;;
'a^') replace 00E2;;
'A~') replace 00C3;;
'a~') replace 00E3;;
"E'") replace 00C9;;
"e'") replace 00E9;;
'E^') replace 00CA;;
'e^') replace 00EA;;
"I'") replace 00CD;;
"i'") replace 00ED;;
'O`') replace 00D2;;
'o`') replace 00F2;;
"O'") replace 00D3;;
"o'") replace 00F3;;
'O^') replace 00D4;;
'o^') replace 00F4;;
'O~') replace 00D5;;
'o~') replace 00F5;;
"U'") replace 00DA;;
"u'") replace 00FA;;
'U;') replace 00DC;;
'u;') replace 00FC;;
'C;') replace 00C7;;
'c;') replace 00E7;;
# Esperanto
'Cx') replace 0108;;
'CX') replace 0108;;
'cx') replace 0109;;
'Gx') replace 011C;;
'GX') replace 011C;;
'gx') replace 011D;;
'Hx') replace 0124;;
'HX') replace 0124;;
'hx') replace 0125;;
'Jx') replace 0134;;
'JX') replace 0134;;
'jx') replace 0135;;
'Sx') replace 015C;;
'SX') replace 015C;;
'sx') replace 015D;;
'Ux') replace 016C;;
'UX') replace 016C;;
'ux') replace 016D;;
esac
previous_char=$current_char
done <&3
}
main@fsmithred - If you just need your system to do something for you (e.g., stop a script) when coming out of idle (i.e., when there is any keyboard or mouse activity), you may like this: https://unix.stackexchange.com/a/122816
I tried it and it worked like a charm. I just needed to install libxss-dev (provides scrnsaver.h) before compiling.
Thanks, fsmithred. I took a look at xscreensaver's code. I'm too lazy to parse through all that ![]()
I found a solution. It requires that python3 and the pyuserinput module (which contains pymouse) be installed.
#!/usr/bin/python3
from pymouse import PyMouseEvent
import os
class ClickDetector(PyMouseEvent):
def __init__(self):
PyMouseEvent.__init__(self)
def click(self, x, y, button, press):
'''Send signal when left click is pressed.'''
if button == 1:
if press:
os.system('pkill -USR1 somescript')
ClickDetector().run()If the above is running in the background, my mouse works normally and any time I left-click on anything a SIGUSR1 is sent to somescript.
Perhaps you can adapt the above and use it instead of xscreensaver for your purposes, although as-is it does not respond to keyboard input.
I'd like to rig my mouse so that any time I left-click, not only do I get a normal left click but also send a signal to a script.
I tried both of these in my xbindkeys, but with them I lose the ability to use the mouse click altogether (i.e., I can move the mouse but nothing happens when I click on things):
"xdotool click 1; pkill -USR1 somescript"
b:1 + release"xvkbd -text "\m1"; pkill -USR1 somescript"
b:1 + releaseI tried adding a short delay to the command. Also tried just b:1 without "+ release". No luck with either.
Any ideas? I've been going around in circles with this. A CLI solution would be preferable.
I often use ibus to type in other languages. Especially when writing emails, I tend to edit a lot as I go along. The trouble is that in many applications when I click on the screen to move the cursor somewhere, if I'm using ibus then the last character I typed simply disappears.
For example, in mate-terminal, thunderbird, and pluma, if I type this (for example):
ho ho hoThen click somewhere on the screen, the text turns into this:
ho ho hHave any of you found a way to type in other languages--with or without ibus--without being affected by this?
I have considered using a keyboard layout with dead keys as a workaround, but I don't like having to type the diacritic before the letter.
--------------
My setup:
- Devuan Jessie with MATE
- ibus 1.5.9-1
- ibus packages installed: ibus, ibus-gtk, ibus-gtk3, ibus-m17n, ibus-qt4
I didn't know I had /var/lib/sytemd/deb-systemd-helper-enabled, but I do. Pardon my ignorance, but why would a Devuan installation have/need that?
Yuck, I feel like I just stepped on a pile of dog poop.
I updated post #20 with a massively overhauled version of my script, which features:
1. Organization (go functions!)
2. Extensive, optional sanity checks--mostly to help "future me" get things working on my (helper) end
3. @fungus - Default/initial variable values less prone to optical illusions
BTW, I tried the script with firewall active on my machine and only port 22 open. Script worked. Script also worked with router forwarding nothing but port 22. I think this proves that the remote desktop session is traveling within the SSH tunnel.
I created this script for my own use, but thought I'd share.
If required packages (listed near top of the script) are installed, just run the script on both helper and helpee's machine, and it sets up a reverse SSH tunnel containing a reverse VNC connection (reversing the connections causes port forwarding to only be needed on helper's end, a big plus since helpees will probably not know how to setup port forwarding on their router).
#!/bin/bash
# No-config* Encrypted Remote Desktop (NERD), version 2.3
# * for helpee
# Author: Bruno "GNUser" Dantas
# License: GPLv3
# Last update: 18Sep2017
# Usage:
# To use this script, just run it in a terminal on both machines (as regular user, not root/sudo) and follow the prompts :)
# Rationale:
# This script sets up a remote desktop session using VNC, through SSH for encryption/privacy. All configuration is done on helper's end.
# Requirements/setup:
# Packages installed on helpee's machine: openssh-client, openssh-server, sshpass, x11vnc
# Configuration on helpee's router: none
# Configuration on helpee's computer: none
#
# Packages installed on helper's machine: openssh-client, openssh-server, sshpass, vinagre, nmap
# Configuration on helper's router: sshd listening port (default in /etc/ssh/sshd_config is port 22) forwarded to helper's local ip.
# Configuration on helper's computer: Firewall off (or firewall on with port 22 open)
# Note:
# If you don't want the sanity checks, feel free to comment out the "check-..." lines in the main function.
# Without the sanity checks, nmap is not required to be installed on the helper's machine.
main()
{
savefile=$HOME/.nerd
sshd_port=22
clear
show-greeting
ask-purpose
load-variables
if [ "$mode" = "helpee" ]; then
check-internet
check-dependencies ssh sshpass x11vnc
check-sshd-running
initial-instructions
confirm helper_username
confirm helper_password
confirm helper_public_ip
elif [ "$mode" = "helper" ]; then
check-internet
check-dependencies ssh sshpass vinagre nmap
helper_public_ip=$(wget http://ipinfo.io/ip -q -O -)
check-sshd-running
check-sshd-port
check-port-forwarding
initial-instructions
confirm helpee_username
confirm helpee_password
fi
save-variables
final-instructions
connect
}
red='\033[0;31m'
green='\033[0;32m'
nc='\033[0m' # no color
terminal_width=$(tput cols)
pretty()
{
fold -s -w $terminal_width
}
show-greeting()
{
printf "Welcome to the No-config* Encrypted Remote Desktop\n* for helpee\n\n" | pretty
}
ask-purpose()
{
while true; do
read -n 1 -p "Will you get (g) or offer (o) help? [g/o] " -e ans
case $ans in
g) mode="helpee"; break;;
o) mode="helper"; break;;
q) exit 0;;
*) echo "Please enter a valid choice or q to quit";;
esac
done
echo ""
}
check-internet()
{
printf '%-50s' "Checking for internet connection..."
if ping -c 1 8.8.8.8 &>/dev/null; then
printf "${green}PASS${nc}\n"
else
printf "${red}FAIL${nc}\n"
printf "No internet connection. This script requires an internet connection.\n"
exit 1
fi
}
check-port-forwarding()
{
printf '%-50s' "Checking for port $sshd_port forwarding..."
local_response=$(timeout 1 ncat -v localhost $sshd_port 2>/dev/null | grep -i ssh)
remote_response=$(timeout 1 ncat -v $helper_public_ip $sshd_port 2>/dev/null | grep -i ssh)
if [ "$local_response" = "$remote_response" ] && grep -iq ssh <<<"$remote_response"; then
printf "${green}PASS${nc}\n"
else
printf "${red}FAIL${nc}\n"
echo "Port $sshd_port not forwarded correctly.
Things to check:
- Router is forwarding port $sshd_port to your machine's local ip?
- Your local ip matches the ip address in router's port forward rule?
- Firewall off (or on with port $sshd_port open) on your machine?
- VPN off?" | pretty
exit 1
fi
}
check-sshd-running()
{
printf '%-50s' "Checking for running sshd..."
if ps -ef | grep -q [s]shd; then
printf "${green}PASS${nc}\n"
else
printf "${red}FAIL${nc}\n"
echo "sshd is not running. Please install openssh-server and/or start it (on Devuan/SysVinit, it can be started with this command: sudo service ssh start)." | pretty
exit 1
fi
}
check-sshd-port()
{
printf '%-50s' "Checking that script uses system's sshd port..."
system_port=$(nmap localhost | grep ssh | grep -Eo "^[0-9]+")
if [ $sshd_port -eq $system_port ]; then
printf "${green}PASS${nc}\n"
else
printf "${red}FAIL${nc}\n"
echo "Your sshd is listening on port $system_port, but this script is configured to use $sshd_port. Please change one or the other so that they match."
exit 1
fi
}
check-dependencies()
{
for dep in "$@"; do
printf '%-50s' "Checking for $dep..."
if which $dep >/dev/null; then
printf "${green}PASS${nc}\n"
else
printf "${red}FAIL${nc}\n"
echo "Please install $dep then try again."
exit 1
fi
done
}
initial-instructions()
{
if [ "$mode" = "helpee" ]; then
printf "\nTo initiate an encrypted remote desktop session, simply answer these three questions:\n\n" | pretty
elif [ "$mode" = "helper" ]; then
printf "\nYour public ip address is $helper_public_ip\n\n"
fi
}
load-variables()
{
if [ ! -f $savefile ]; then # initial/default values go here
echo "helper_username='gnuser'
helper_password='linuxrocks'
helper_public_ip='123.45.123.45'
helpee_username='motherinlaw'
helpee_password='windowsnomore'" >$savefile
fi
. $savefile
}
confirm()
{
var_name=$1
current_value="$(eval echo \$$1)"
read -n 1 -p "Is $var_name '$current_value'? [y/n] " -e ans
if [ "$ans" = "n" ]; then
read -p "Enter $var_name: " -e new_value
eval $var_name=\"$new_value\"
fi
}
save-variables()
{
echo "helper_username='$helper_username'
helper_password='$helper_password'
helper_public_ip='$helper_public_ip'
helpee_username='$helpee_username'
helpee_password='$helpee_password'" >$savefile
}
final-instructions()
{
if [ "$mode" = "helpee" ]; then
printf "\nPress Enter to connect, then tell helper when things stop scrolling by in this terminal..." | pretty
read
elif [ "$mode" = "helper" ]; then
printf "\nHelpee initiates the connection. Once they are connected, they'll say things have stopped scrolling by in their terminal. At that point, go ahead and press Enter to complete the connection and view/control their destkop..." | pretty
read
fi
}
connect()
{
if [ "$mode" = "helpee" ]; then
x11vnc & sshpass -p "$helper_password" ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -R 7000:localhost:$sshd_port "$helper_username"@"$helper_public_ip"
elif [ "$mode" = "helper" ]; then
{ sleep 3; vinagre localhost:5901; } & sshpass -p "$helpee_password" ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -L 5901:localhost:5900 "$helpee_username"@localhost -p 7000
fi
}
mainRalph, please forgive me for asking a newbie question (I don't have much experience with SSH).
Can you confirm that using this setup the VNC connection would be encrypted?
@ralph.ronnquist - I briefly played with this this morning. It is MUCH nicer than what I had proposed, but I needed to make two tweaks for it to work:
a. The 5901 <-> 5900 forwarding only seems to work if done from helper's computer
b. The ssh command on helpee's computer doesn't seem to like running in the background, so I reversed the order of the commands
In summary, a cleaned-up version of #16 would involve:
1. Setting up key-based authentication for helpee, to ssh to helper without password (see http://www.rebol.com/docs/ssh-auto-login.html). ~/.ssh/config on helpee's computer would look something like this:
Host help
hostname <helper's public ip address>
user gnuser
identityfile ~/.ssh/myserver.rsa
remoteforward 7000 localhost:222. Helpee runs this command in a single terminal and leaves the terminal open:
helpee$ x11vnc & ssh help3. Helper runs this command in a single terminal and leaves the terminal open:
helper$ ssh -L 5901:localhost:5900 helpee@localhost -p 70004. Helper opens up vinagre and connects to localhost:5901 using VNC protocol
@ralph.ronnquist - Haha, I think I found enough magic to go around! Read on...
There was one reason to keep pursuing the old-fashioned way: With gitso the connection is unencrypted. So I kept pushing and finally figured it out. It's a bit complicated--involves leaving two terminals open on each end--but it works, requires no configuration on helpee's end, is through an encrypted tunnel, and uses only free software. Totally worth my splitting headache ![]()
Setup:
- Packages on gnuser/helper's computer: ssh and vinagre
- Configuration on gnuser/helper's router: Forward ports 22 and 5500 to gnuser/helper's machine
- Necessary packages on motherinlaw/helpee's computer: ssh and x11vnc
- Configuration steps on motherinlaw/helpee's computer/router: none ![]()
Steps:
1. Helpee opens up a terminal:
motherinlaw$ x11vnc2. Helpee opens up a second terminal:
motherinlaw$ ssh -R 7000:localhost:22 gnuser@<gnuser's public ip address>
[motherinlaw types gnuser's password]Helpee leaves her two terminals open and waits.
3. Helper opens up a terminal:
gnuser$ ssh motherinlaw@localhost -p 7000
[gnuser enters motherinlaw's password]4. Helper opens up a second terminal:
gnuser$ ssh -L 5901:localhost:5900 motherinlaw@localhost -p 7000
[gnuser enters motherinlaw's password again]Helper leaves his two terminals open.
5. Now helper goes to application menu, internet submenu, and selects "Remote Desktop Viewer" (that's how vinagre shows up in the menus).
Click "Connect"
Choose "VNC" protocol
in Host window, type: localhost:5901
click Connect
Bingo!
Thank you for the thoughtful recommendation, nixer. It turned out to be exactly what I was looking for ![]()
A quick follow-up: I discovered that the ufw package (firewall application) was installed on my laptop. Disabling the firewall with "sudo ufw disable" did the trick. I've updated the summary steps in post #12 accordingly.
I'm not sure how ufw ended up on my system. My guess is that ufw came with the Star live desktop iso that I used many months ago when I installed Devuan on this laptop.
I played around for many hours today. I was able to establish a reverse SSH connection, but couldn't get VNC to work over it.
However, I managed to get gitso to work and it is perfect for what I need: Nothing for my MIL to do other than type in my public IP address (which I'd tell her over the phone) ![]()
The problem was that despite forwarding of port 5500 being setup in my router and, on my laptop, "nmap <mylocalip>" showing 5500 open while gitso is running, a remote desktop connection could not be established. Also, canyouseeme.org kept saying that port 5500 was closed. I was on the verge of calling my ISP to see if they were blocking traffic on this port for some reason.
After hours going round and round, typing this into a terminal on my laptop fixed everything:
sudo iptables -I INPUT -p tcp -m tcp --dport 5500 -j ACCEPTIt's odd that nmap lies about the port being open. It's also odd that the kernel was blocking traffic on that port even though I'm not running a firewall on the laptop. (EDIT: It turned out that there was a firewall running on my laptop after all. "sudo ufw disable" turned it off, and now I no longer need the above iptables command.)
To summarize, gitso turned out to be exactly what I was looking for, and this is how to make it work:
1. Get a static local ip for your machine (many ways to do this--either through router or, probably easier, through your network manager)
2. Configure your router to forward port 5500 to your machine's static local ip (how to do this varies depending on your router firmware)
3. Make sure you don't have a firewall running on your machine (e.g., if "sudo ufw status" says firewall is active, do this: "sudo ufw disable")
4. Install gitso from Devuan's official repository, start it (in MATE, it shows up in the Internet submenu), chose "Give support"
5. Ask your friend who needs help to install gitso, start it, choose "Get help", and enter your public ip address (output of "wget http://ipinfo.io/ip -q -O -" on your machine)
@fsmithred, is there a how-to on getting this to work? If not, would you kindly share what would need to be running on my machine and what command mom-in-law would need to run?
I cannot do any configuration on her router, but could walk her through installing packages and doing minimal configuration on her laptop.
@ralph.ronnquist @fsmithred - I'd love to learn that approach, catch is that I need to figure out how to set it up with reverse tunneling, the way gitso does it. I can't expect MIL to be of any help on her end. I'm going to have to chew on this.
I really appreciate all your input. Until this thread, I didn't even know that doing a reverse connection with all the configuration on the "helper" end was possible. That's exactly what I'm looking for!
Many thanks!
Configuring port forwarding on my end is no problem. I will give gitso a try. Thank you.
Thanks, nixer, but I'm looking for free as in free speech (libre), not free as in free beer (gratis). The combination of libre + easy to use is what's making the search challenging.
If all I needed were gratis + easy to use, I'd go with Teamviewer. The problem is that Teamviewer is not libre (i.e., it's proprietary/closed source) so I don't trust it enough to install it on someone else's computer.
Money is not the issue. The issue is trust.
I managed to convince my mother-in-law to run Devuan Jessie with MATE on her laptop, which until now was running Windows Vista. It's installed and she's happy so far (phew!). The trouble is she knows nothing about GNU/Linux and lives almost 4 hours away, so I need a way to connect remotely to help her if needed.
I'm looking for a remote desktop application that would be dead-simple for her to use. Teamviewer would fit the bill perfectly except that it's proprietary and therefore I don't feel comfortable installing it on a family member's computer. (I have no specific reason to suspect Teamviewer of anything nefarious but, since it's proprietary, only the developers know for sure. Since it's my mother-in-law we're talking about here, my risk tolerance is extremely low.)
Is anyone aware of a free software remote desktop application that is similar to Teamviewer (i.e., works on GNU/Linux and is a no-brainer for a non-technical user to use)? I've already scoured the internet and didn't find anything obvious.
EDIT: The non-encrypted solution uses gitso. See post #12. Thanks for the recommendation, nixer!
EDIT 2: The encrypted solution uses my NERD script. See post #20. Thanks for the help, ralph.ronnquist!
Okay, so the xhci_hcd kernel module (previously known as simply xhci) has long been known to cause GNU/Linux to have insomnia. Create /etc/pm/config.d/00sleep_well_baby_gnu with only this in it...
SUSPEND_MODULES="xhci_hcd"...and problem vanishes! The above unloads the troublesome kernel module just before system tries to suspend. The module is automatically reloaded when the system resumes, so I had no problem using my ExpressCard after resuming.
@ralph.ronnquist - Thanks for pointing me in the right direction!
Thanks, ralph. I tried the xhci quirk setting but no luck. This quote from your thread did give me a hint:
I believe the [xhci_pci] module handles USB transport (esp. 3.0), and it is brought in when I plug in a USB stick.
I have an ExpressCard in my laptop that provides two USB 3.0 ports, which I added to my laptop not that long ago. I tried removing the card and, lo and behold, without it suspend works just fine. However, leaving the card out until I want to use it kind of defeats the purpose of a nice flush card such as this, which aims to blend in and become part of the laptop.
It would be good to figure out a way for suspend to work with the ExpressCard in the slot. If anyone knows how to accomplish this, please let me know. If I find a solution, I'll post it here.
Update: I booted into my Debian Jessie partition on this same machine and tried suspending several times. No problems on either AC or battery power.
I'm on a Thinkpad T400 with Libreboot and Devuan Jessie 64-bit. I have a keyboard shortcut for "sudo pm-suspend". I don't suspend the system very often, but I'm pretty sure it used to work reliably when I first installed Devuan.
Lately, when system is on AC power and I try suspending, it only works sometimes. If I'm on battery power and try suspending, it doesn't work at all--the suspend LED, which looks like a little crescent moon on the T400's LED panel, briefly lights up but the system just keeps going and does not actually suspend.
Last time I upgraded Libreboot was a long time ago, well before installing Devuan. I do apply all of Devuan's security upgrades--is it possible that one of them broke my ability to suspend? I'm using the default kernel (3.16.43-2+deb8u3).