Saturday, September 15, 2012

HP dm4 laptop right click fix

On Linux Mint Cinnamon, (and probably most Ubuntu versions at or before 12) my hp dm4's synaptics touchpad did not automatically detect that it has a right a left button.

To fix this, create the directory /etc/X11/xorg.conf.d/

$ sudo mkdir -p /etc/X11/xorg.conf.d

Then place this file into /etc/X11/xorg.conf.d:
https://bitbucket.org/zachwolfe/dotfiles/src/88321594ef20/etc/X11/xorg.conf.d/50-synaptics.conf

Restart the X Server (Ctrl Alt Backspace or log out or reboot)

Wednesday, August 1, 2012

nginx HTTP/HTTPS setup

Setting up nginx SSL is pretty easy. I'm running nginx/1.0.10.

Use make-ssl-cert to make your SSL certificate.
make-ssl-cert /usr/share/ssl-cert/ssleay.cnf /etc/ssl/private/zachwolfe.org.crt Copy this file to /etc/ssl/private/zachwolfe.org.key and /etc/ssl/certs/zachwolfe.org.crt.

Modify /etc/ssl/private/zachwolfe.org.key to only include the key (as follows):
-----BEGIN CERTIFICATE-----
...key text is here....
-----END RSA PRIVATE KEY-----


Modify /etc/ssl/certs/zachwolfe.org.crt to only include the certificate (as follows):
-----BEGIN RSA PRIVATE KEY-----
...certificate text is here....
-----END CERTIFICATE-----


nginx setup:
File /etc/nginx/conf.d/zachwolfe.org.ssl.conf
server {
    listen       443;
    server_name  zachwolfe.org;

    ssl                  on;
    ssl_certificate      /etc/ssl/certs/zachwolfe.org.crt;
    ssl_certificate_key  /etc/ssl/private/zachwolfe.org.key;

    ssl_session_timeout  5m;

    ssl_protocols  SSLv2 SSLv3 TLSv1;
    ssl_ciphers  HIGH:!aNULL:!MD5;
    ssl_prefer_server_ciphers   on;

    location / {
        root /var/www/;
        index  index.html index.htm;
    }
}


File /etc/nginx/conf.d/zachwolfe.org.conf
server {
    listen       80;
    server_name  zachwolfe.org;
    access_log /var/log/nginx/zachwolfe.org.access.log;

    location / {
        root /var/www/;
        index  index.html index.htm;
}

Wednesday, June 27, 2012

Running vim as a server without X

So far, running vim as a server without X is impossible as far as I know. I don't understand why vim depends on X at all, especially for this case.

$ vim --servername foobarbaz
doesn't work, and even worse, silently fails. No warnings, errors, etc.

I thought it could be that vim didn't have some kind of compile option, but:
$ vim --version | grep client
+clientserver +clipboard +cmdline_compl +cmdline_hist +cmdline_info +comments


The only way to use vim's built in server is to give it a valid DISPLAY value at startup. This makes vim behave a little slower, which is especially noticeable at startup.

DISPLAY=:11 vim --servername foobarbaz





To start a server:
DISPLAY=:0.0 vim --servername mainVim

To edit a file on an already running vim server:
DISPLAY=:0.0 vim --servername MAINVIM --remote-tab-silent `find -type f -name filename`