Showing posts with label linux. Show all posts
Showing posts with label linux. Show all posts

Thursday, April 11, 2013

Extended desktop using XFCE

In the XFCE display settings manager, if you see your screen but instead of extending the desktop it clones the desktop on both displays.




To enable this. use xrandr
You should see something like this

LVDS1 connected 1366x768+0+0 (normal left inverted right x axis y axis) 310mm x 174mm

blahblah

HDMI1 connected 1280x720+1366+0 (normal left inverted right x axis y axis) 16mm x 9mm

To extend the desktop and use the HDMI connected monitor on the right side, do this:
➜  ~  xrandr --output HDMI1 --right-of LVDS1



Thursday, September 20, 2012

Fixing Penn State Wireless Network Stability Issues on Linux

On Linux Mint (and I'm assuming most Gnome-based distributions of Linux), NetworkManager does a bad job staying connected to the new psu network that has spread to most of campus.
wicd is an alternative network manager that seems to relieve a lot of the problems that NetworkManager had.

Install wicd
$ sudo apt-get install wicd
Then edit or create an encryption template "psu" as /etc/wicd/encryption/templates/psu. Note that this file may exist already but is probably outdated (as of today, mine was outdated). Find my version of the psu encryption template here: https://bitbucket.org/zachwolfe/dotfiles/src/2dc9a24fbc7b/etc/wicd/encryption/templates/psu
Then open the wicd-gtk client and connect to the "psu" network using the "psu" encryption template you just defined. You should also select the "use these settings for all networks sharing this essid" checkbox as well for obvious reasons.

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`