Downgrading Subversion from 1.9.3 to 1.8.13, Ubuntu 16.04

I needed to run tests and fix an issue with Subversion 1.8, and on my recently-updated machine running Ubuntu 16.04 (Xenial), Subversion was installed as 1.9.3, which was the only version in the xenial repository.

So, a quick post of what I did, since googling produced no clear answer.

Download the 1.8.13 .deb files for subversion and libsvn1.

Install the latest from xenial repository (probably no changes, if you have Svn 1.9.3 installed):

% sudo apt-get install libapr1 libaprutil1 libsvn1

Remove libsvn1, because it is 1.9.3:

% sudo apt-get remove libsvn1

Remove (uninstall) Svn 1.9.3

% sudo apt-get remove subversion

Install downloaded packages “manually”

% sudo dpkg -i ./subversion_1.8.13-1ubuntu3_amd64.deb ./libsvn1_1.8.13-1ubuntu3_amd64.deb

Check version (should be 1.8.13):

% svn --version

Check the package:

% dpkg -l | grep subversion

And that’s it.

Advertisements

Earlier anacron jobs

For whatever reason, anacron is set to run its daily jobs at 7:30 in the morning:

# /etc/cron.d/anacron: crontab entries for the anacron package

SHELL=/bin/sh
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin

30 7    * * *   root	start -q anacron || :

The first time I encountered that was when I was working at that time of day and noticed the sluggishness of my machine. It seemed that locate was the heavyweight process, so I changed anacron to run at 4:30 a.m, modifying the last line in the file:

30 4    * * *   root	start -q anacron || :

No dots in cron scripts?

I added a little script to /etc/cron.daily, sayhello.sh, while I sorted out how to integrate my backup script (tresync) into the list of cron jobs run daily.

The odd thing is, the script never ran. I could run it as “sudo /etc/cron.daily/sayhello.sh“, but it didn’t run with the rest of the cron jobs.

Lo and behold, I found the answer, which is actually on the man page for run-parts:

If neither the –lsbsysinit option nor the –regex option is given then the names must consist entirely of ASCII upper- and lower-case letters, ASCII digits, ASCII underscores, and ASCII minus-hyphens.

Which means: you cannot have a dot in the file name.

That seems quite counterintuitive, but perhaps there is a reason that I just don’t understand.

Printing the middle N lines of a file in Linux

While working on my “e” alias in my aforalias project, I want the show only the entries of zip files, that is, without the header and footer sections. The “e” alias also shows the entries sorted by name, unlike the behavior of “unzip -l“, which displays:

Archive:  gradle-1.12-all.zip
  Length      Date    Time    Name
---------  ---------- -----   ----
<entries>
---------                     -------
102761855                     9503 files

Thus I wanted to print lines[3 .. lines.length – 3].

Lo and behold, there’s a way to do that with “head” and “tail”, as follows:

unzip -l $1 | tail -n +4 | head --lines=-2

tail -n +X” means “start printing at line X”, where 1 is the first line of the file (not 0).

And “head --lines=-X” means “print all but the last X lines”.

Not the most intuitive pair of commands in this context, but they can be quite helpful.

RVM, Zsh and Konsole

Today I set up RVM with Zsh (Z shell) with Konsole (the KDE equivalent to gnome-terminal).

The RVM Konsole example shows it with bash, setting the “Command” field to “/bin/bash –login”. The line for Zsh is nearly the same: “/usr/bin/zsh –login”.

If you don’t have this, you’ll get the error:

% which ruby
/usr/bin/ruby
% rvm use 2.0

RVM is not a function, selecting rubies with 'rvm use ...' will not work.

You need to change your terminal emulator preferences to allow login shell.
Sometimes it is required to use `/bin/bash --login` as the command.
Please visit https://rvm.io/integration/gnome-terminal/ for an example.

Note that you’ll need to have RVM as the first component in the PATH (“echo $PATH”).

With the “Command” field set to “/usr/bin/zsh –login” (that’s “dash dash login”), when you start a new terminal you should get:

% which ruby
/home/jpace/.rvm/rubies/ruby-1.9.3-p551/bin/ruby
% rvm use 2.0
Using /home/jpace/.rvm/gems/ruby-2.0.0-p598
% which ruby
/home/jpace/.rvm/rubies/ruby-2.0.0-p598/bin/ruby

Silencing Konsole Notification

Applications in KDE can send notifications, which result in popups on the task bar:

popup

Highly annoying this is. The culprit is that control-shift-A is the shortcut to enabling this behavior, as is shown via “Konsole -> View -> Monitor for Activity”:

view_menu_cropped

It’s fortunate that this is easy to disable. Right click on “Monitor for Activity -> Configure Shortcut”, then click on “Ctrl+Shift+A”, which will then display “Input”. Click on the left arrow graphic:

shortcut

That should result in it showing “None”, which means that there will no longer be a shortcut. You might want to go back to “Konsole > View” and make sure that “Monitor for Activity” is not checked.

I seem to do this every time I set up KDE, so perhaps this will help others.

Review of LinuxMint 14 KDE

I finally upgraded my main personal machine to Linux Mint KDE 14. That machine was running Mint 11, for around two years, but when I began working with Scala, I discovered that Emacs 24 is much better for Scala support. Not finding Emacs 24 in the Mint 11 repositories, I finally took the time and effort to upgrade.

Now I wonder why I’d waited so long.

The first immediate improvement, albeit superficial, was that KDE uses blue as its primary color. It makes sense that that Mint would of course choose, well, a minty green as its color, but that is one of my least favorite colors, reminding me of a 1970s refrigerator. I didn’t care for the brown of Ubuntu, and missed the blue of Fedora, so now I’m back, in a way.

I switched to the Oxygen theme, which is nicely dark, mostly dark greys. The other themes I looked at seemed to be excessively noisy, and I like a minimal desktop experience, with no peripheral distractions.

As I complained before, when I temporarily switched from Gnome to KDE (and back again) in KDE the fonts look, in a word, horrible. Absolutely horrible, if you will permit me two words.

This time I googled around a bit, and found this thread.

The summary of that is to go to the Fonts settings and set them all to Ubuntu 10 Regular, except for Fixed Width (Ubuntu Mono 12), Small (Ubuntu 9), and Windows title (Ubuntu 10 bold).

Set the following:

  • Anti-aliasing: enabled
  • Exclude range: unchecked
  • Sub-pixel rendering: RGB
  • Hinting style: slight

Install Windows fonts via: “sudo apt-get install ttf-mscorefonts-installer”. The command line app is necessary because you’ll need to accept the license agreement, which has no equivalent for the GUI-based package managers.

That has made a huge difference in the appearance. I do not understand why these would not be the default settings in KDE, so mark that as one advantage in the favor of Gnome. One advantage. I haven’t found a second one.

I also installed the Inconsolata font (the package “ttf-inconsolata”), which I tried out with Emacs after reading about it as being highly recommended. After a while I went with (back to, actually) DejaVu Sans Mono, font size 9, since I found Inconsolata characters to be too wide.

The KDE UI takes a little while to get used to, especially seeing all apps in the panel, not just the ones for the current workspace. I also set the shortcut for the start menu to alt-F1, after trying to re-map the Windows key, with a modicum of success.

This upgrade makes me feel like I’m back in my early Red Hat / Fedora days, with the UI clean and responsive. I haven’t yet tried out activities under KDE, but I am planning to.

On that note, being a KDE neophyte, I’m looking for a KDE book, and would appreciate any recommendations.

How to Enable Toggling a KVM with Linux Mint

I just got this KVM from Monoprice (for only $27!), and had difficulty setting it up with Linux Mint 11. Specifically, when running under X, hitting the Scroll Lock key twice resulted in no response. However, when running in a VT (that is, switching from X via ctrl-alt-F1), it worked, so my guess is that there is some issue with Gnome misdirecting or misinterpreting the key event.

I eliminated the KVM itself as the problem by running a very long command (“find /”), and hitting Scroll Lock did not stop the output from scrolling, when running in a Gnome terminal. As with the KVM, Scroll Lock did stop the command output when I was running in a VT.

Online there were examples of using xmodmap to enable the Scroll Lock key, but these didn’t work for me. I tried to:

xmodmap -pm
xmodmap -e 'add mod3 = Scroll_Lock'

But neither the KVM nor the command-output tests worked. Then I found this snippet:

xset led 3 && sleep 0.2 && xset -led 3 

I ran it, and lo and behold, it worked. So I wrote it to a script:

echo "xset led 3 && sleep 0.2 && xset -led 3" > ~/bin/toggle_kvm
chmod +x ~/bin/toggle_kvm

Then went to Keyboard Preferences, added that command, and gave it a shortcut of “Scroll Lock”.

So the only difference now is that in Windows, the Scroll Lock key has to be hit twice, but only once in Linux.

… and Back to Gnome from KDE

I recently switched from Gnome to KDE, after a couple of Gnome quirks proved to be quite irritating. However, KDE became even more bothersome. Specifically the performance was dreadful. This is a new(ish) machine, just a few months old, with a six-core processor, 8 GB of memory, and an SSD, so I expect good if not extraordinary performance. However, under KDE the response within windows was very sluggish, on the order of a second or two to scroll down in applications.

Fonts were also a problem, where the fonts under KDE, for both KDE and Gnome applications, lacking smoothness. Despite much fiddling of font preferences, I could not get them to look as good as they do under Gnome.

Switching back to Gnome hasn’t resolved its irritations, although it’s put them in context. The main problem is that to get the title and task bars working properly (showing the currently focused application) I have to restart the window manager after login, and after launching Gnome Terminal I have to switch in and out of each tab so that the focus of the cursor is correct.

Migrating from Gnome to KDE

Since installing Linux Mint 11 on my new(est) machine, I’ve been frustrated with the UI. Even with (or because of?) the latest updates to Gnome, title bars and status tabs in the task panel would not update, such as when changing directories in a shell, or switching files in Emacs. Even switching from Compiz to Metacity did not help.

Mint 11 ships with Gnome as the window manager, and from feedback from another long-time Linux devotee, I decided to try KDE. I’d only used Gnome before, although I have set up KDE systems (namely Kubuntu) and liked what I saw.

Since Mint does not include KDE, via Synaptic I added kde-full, logged out and logged into KDE (selecting it on login), and … well, it’s great. Much cleaner interface, title bars and the task bar work as they should, and the effects are good, yet not excessive.

The only nit was the font for Gtk apps, such as Firefox and Synaptic, which were some ugly font, making me feel like I was running Netscape circa 1998. Online I found some references to gtkqt-engine, but that package is not in the Mint/Ubuntu/Debian repositories. More poking around revealed it now as kde-config-gtk, which, when installed, make Gtk applications use the KDE fonts, and all is well now.