The annoying alternate screen in vte-based terminal applications

Current Linux terminal emulators have a feature that many people consider a bug.

Read the manual of some command. Find what you wanted to check. Quit the viewer to return to the command line. Poof, your screen is restored to what it was before you started man, and the information you were looking for is gone.

Same if you start your editor; quit the editor and the screen restores to the previous content.

Continue reading

Using Logitech G keys in Linux (Ubuntu, 14.04)

Finding a useful resource for this took me quite a while. The solution comes with the standard repository:

apt-get install g15daemon

On my 18-key G15, keys G1..G18 map to key 175..192, and M1..MR map to 193..196.

xmodmap can be used to reassign keys; unfortunately, you can’t assign a sequence of keys to one key press. Still looking for a solution to this.

Setting up an SSL server to use a key exchange that wireshark can decrypt

Sometimes, you need to decrypt SSL. Wireshark says you can do that if you have the server key.

This works .. almost.

It doesn’t work if the key exchange uses a DH (Diffie-Helmann) cipher. You need to use a RSA cipher for the key exchange. Several people on the internet tell you this, but i was never able to find any information which keys to use and which not to use.

Seems this works, however:

I made it work. As SYN-bit said, the reason because my server and client use DH cipher to exchange key, I should config my server to use RSA cipher to exchange key. with Apache :

SSLCipherSuite RSA+AESGCM:RSA+AES:RSA+3DES:!aNULL:!eNULL:!LOW:!3DES:!MD5:!EXP:!PSK:!SRP:!DSS

Now I can decrypt https traffic.

How to get a free codesigner certificate, and sign Java jars with it

Oracle is (rightfully!) tightening the security requirements around the .jnlp web starter more and more. Formerly, they were just started; later, you got warning messages if they weren’t signed with a proper certificate, and in the newest versions, you need to explicitly manage a list of servers you permit execution from.

So, even if you’re a developer of open source, or freeware, you need to sign your code, which requires a certificate, which normally costs money. Unless you use the services of the nice company Unizeto, who, with their Certum certificates, give code signing certificates to open source developers for free.
Continue reading

Using Java to read Oracle Wallet files

A while ago, i was given the task to write a program to check for the expiration of client certificates. Since the program was supposed to be workable on Windows, Linux, Solaris, and AIX, i decided to not use the openssl libraries, instead, i wrote a java program. Now, when i started to make it productive, the guy actually in charge told me “great thing, and we actually have a few PEM certificates, but most of them are Oracle Wallets”.

Continue reading

Make wordpress require login for all pages

If you’re building a site, you don’t want the public to be able to access it, especially if there’s legal requirements it doesn’t meet yet.

Easiest way to do this: put

<?php
if (!is_user_logged_in()) {
        auth_redirect();
}
?>

at the start of your wp-content/themes/<your theme>/header.php.

Warning: If you update or change your theme, you’ll re-enable login. This might as well be a good thing – if you can’t remember how you made your site require login, and want to remove the feature, just reinstall your theme.

Getting ubuntu to boot with correct resolution even if the monitor is disconnected

Problem: I’m administrating several ubuntu linux boxes in a rack at a friend’s company, where there is one monitor and no KVM switch for them. Whenever someone wants to do something with one of them, they connect the monitor to the one they want to work with.

When i remotely reboot Linux after some upgrades, the computer typically doesn’t find a monitor and enters 640×480 mode. When the monitor is connected later, the display is unusable; the same happens when i vnc into the machine.

Solution: use xrandr to set the display mode upon boot.

Continue reading

Playing FreeOrion on Ubuntu

I tried FreeOrion on Windows before i switched over to Linux, and liked it, so it was nice for me to hear it runs on Linux as well. Unfortunately, the version that comes with the software manager for Ubuntu 14.04 is 0.4.3, and i was already used to 0.4.4 from playing with Windows, so i decided to compile it myself.

I didn’t compile any of the requirements myself; the packages i had to install were:

cmake
libogre-1.8-dev
libboost-filesystem1.54-dev
libfreetype6-dev
libjpeg8-dev
libtiff-dev
libboost-regex1.54-dev
libboost-signals1.54-dev
libois-dev
libboost-python1.54-dev
libopenal-dev
libvorbis-dev
libbullet-dev

Of course, this list might not be complete; i have stuff like gcc, make, … installed anyways, but these seem to be the prereqs you don’t typically install on your workstation.

There is one problem that seems to occur only with XUbuntu, not Ubuntu: XFCE interferes with the keyboard grabbing of the OIS Library that FreeOrion uses, and since OIS is obsolete, noone is going to fix that. What helped me is to put

x11_keyboard_grab=true

into my ~/.freeorion/OISInput.cfg which keeps the keyboard focus on FreeOrion all the time. I’m still not 100% happy with this, as a) i can’t use any applications on my 2nd screen while playing, and b) minimizing FreeOrion drops the keyboard focus, but restoring the window doesn’t grab it again, so i have a way to quickly run another app if i need to, but i’ll have to save the game and restart it to be able to type again.