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 :


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

if (!is_user_logged_in()) {

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