Showing posts with label ubuntu. Show all posts
Showing posts with label ubuntu. Show all posts

Tuesday, August 9, 2011

Changing display resolution on Ubuntu when the resolution option doesn't show up

It is very annoying when you have a good monitor (an NEC MultiSync LCD1970NX in my case), capable of supporting 1280x1024 or some such high resolution, whereas Ubuntu simply cannot see beyond 832x624.

Earlier versions of Ubuntu had the xorg.conf file which is no longer present, although if you craft it by hand it is still going to be used. That seems like a dangerous proposition, though - a simple mistake could screw up at least something that is working.

I found the savior in the command xrandr, thanks to X/Config/Resolution page on the ubuntu wiki. And here is what I have done so far:

1. I first ran the command xrandr to make sure that the VGA1 indeed existed. As it turns out, that command can also tell you what is the highest resolution your monitor can support:
sudipta@Springfield:~$ xrandr
Screen 0: minimum 320 x 200, current 832 x 624, maximum 4096 x 4096
VGA1 connected 832x624+0+0 (normal left inverted right x axis y axis) 376mm x 301mm
   1280x1024      60.0 +   75.0 
   1280x960       60.0 
   1152x864       75.0 
   1024x768       75.1     70.1     60.0 
   832x624        74.6*
   800x600        72.2     75.0     60.3     56.2 
   640x480        72.8     75.0     66.7     60.0 
   720x400        70.1 
LVDS1 connected 832x624+0+0 (normal left inverted right x axis y axis) 0mm x 0mm
   1280x720       60.0 +
   832x624        74.6*
   800x600        85.1     72.2     75.0     60.3     56.2 
   640x480        85.0     72.8     75.0     59.9 
   720x400        85.0 
   640x400        85.1 
   640x350        85.1 
See that 1280x1024 at the top of the list? That is how high my monitor could go. And see that line in the middle with a * at the end (832x624        74.6* in my case) - that one is what I am currently running. And strangely enough, although xrandr knew the highest possible on available, the monitor options only showed 832x624 to be the highest:

So all I had to do to rectify the situation was to open up the gnome terminal and run
xrandr --output VGA1 --mode 1280x1024
which was the highest one supported by my monitor, as mentioned above. Note that I did not specify a refresh rate (using --rate 75 or 60): I let the computer decide for itself. And voila! I had a 1280x1024 screen on my monitor!

I will post an update about how to make the change permanent as well, although the wiki already mentions some options.

Thursday, October 7, 2010

Strongswan: ike alg: unable to locate my private key

If you are using StrongSwan to establish an IPSec connection and you encounter this error:
root@crackjack:~# ipsec up conn-to-td
002 "conn-to-td" #2: initiating Main Mode
002 "conn-to-td" #2: ike alg: unable to locate my private key
002 "conn-to-td" #2: ike alg: unable to locate my private key
003 "conn-to-td" #2: empty ISAKMP SA proposal to send (no algorithms for ike selection?)

Then I have found the way to solve the first part of your problem - the private key part. Basically, after FreeSwan became OpenSwan and then finally StrongSwan, they created a directory for each individual part under /etc/ipsec.d. So for example the CA certs are stored in the folder /etc/ipsec.d/cacerts, or the certs you got are stored in /etc/ipsec.d/certs. Similarly, you are supposed to store your private key at /etc/ipsec.d/private. What you have probably done is that in /etc/ipsec.conf you wrote down
leftcert=/etc/ipsec.d/private/my_private_key.pem
When in fact you should have your /etc/ipsec.conf as the following:

# ipsec.conf - strongSwan IPsec configuration file

# basic configuration

config setup
    plutodebug=all
    plutostderrlog=/var/log/pluto.log
    charonstart=yes
    plutostart=yes


conn host-to-host
      left=
      leftcert=my_cert.pem
      leftid=my_private_key.pem
      right=
      rightid=
      auto=start
      pfs=no
      rekey=no
      keyingtries=3
After this, you can do the faithful /etc/init.d/ipsec restart and the private key problem will disappear

Thursday, June 24, 2010

MPlayer: Failed to open LIRC support

Whenever I run MPlayer from my terminal, which is always when I am playing any kind of media, including Youtube videos, I get the following error.

mplayer: could not connect to socket
mplayer: No such file or directory
Failed to open LIRC support. You will not be able to use your remote control.

I do not own a LIRC remote control, although I have read it is not too difficult to build one yourself. I this message had become an eyesore. The fix is rather simple. Add a line "nolirc = yes" without the quotes to the file ~/.mplayer/config in your home directory. Given how customizable MPlayer is, it is possible to fine tune almost everything from the config file. The default configurations are listed in /etc/mplayer/mplayer.conf and are overridden by the config file in the home directory.