So recently I installed Ubuntu 14.04 LTS on a laptop. This laptop is new enough to use UEFI boot, however I was able to disable that in the BIOS. I read many people had issues getting Linux in general to work with UEFI, so I was fine with using the legacy system.
One issue that I did have was that on shutdown, Ubuntu was hanging. I’d have to manually power it off, and that was not something I was comfortable doing. First thing I did, edit /etc/default/grub and change
On the line “GRUB_CMDLINE_LINUX_DEFAULT”. This way I could see what was happening and wouldn’t get a blank screen while the system was shutting down all of it’s services. I ended up seeing the following message:
* Will now restart
So that tells me that the process responsible for sending the power cycle message to the hardware (ACPI) was not functioning, although the operating system was ready for the poweroff/reboot to occur.
The easy fix: editing the above file again, and now it looks like this:
Now I can safely boot, reboot, and shutdown the system without the operation hanging. I lose some ability to control the system power, but since that mainly includes system hibernation or suspend, I’m fine with it. I never use those functions anyway, and disable them shortly after the initial operating system load.
I’ve been taking quite a bit of my free time to learn more about Emacs, recently to customize the color theme the way I like, and I’ve been learning quite a bit. One post I found on Stack Overflow showed one of the users who made a function to cycle between a particular set of themes that he liked, depending on whether he wanted a light or dark theme. (Follow the above link for the answer by Simon Shine.)
One thing I noticed though was that he used
C-t (Control T) as the key-binding, and I was pretty sure that it was used elsewhere. I used that keystroke in the scratch buffer, but didn’t see anything really happen. I knew it was bound because I didn’t get the “is undefined” message.
M-x describe-key“. With that little gem, you can enter a keystroke, and it will pop up a buffer explaining the function, where it’s source is, and how to use it. Very useful in learning Emacs!
Another thing to note, the describe-key has a little brother, “
M-x describe-key-briefly“, which does the exact same thing, only displays a very brief answer in the minibuffer without opening a new buffer. Useful if you don’t want your existing window changed.
This issue plagued me for some time… I was attempting to create a gpg key, add it to my keychain, and then gpg encrypt a netrc file to use in Emacs. It kept failing just before it would create the actual key, and was giving strange X-related errors. I should note that the “over SSH” part of this title means that I was connected via ssh on the server I was attempting to create the gpg key on.
One of the many error messages was that I did not have the “pinentry” package installed, but I verified multiple times that it was there, and even reinstalled it several times.It finally dawned on me that the reason it was looking for pinentry-gtk or pinentry-qt (both X-windows libraries) was that it thought I was locally logged into that server, and could see the desktop. This made me realize that it was trying to display the graphical interface for the passphrase, which could not be displayed because I was connecting via ssh. A quick
echo $DISPLAY showed me that my ssh was attempting to forward the X connection to my local host, however the DISPLAY was not working because my local system did not have those packages installed. Once I issued
unset DISPLAY my key was able to generate just fine, because it used the non-X version of the routine that asked me for my passphrase.
Another seemingly difficult problem solved by thinking things through!