Tagged: linux Toggle Comment Threads | Keyboard Shortcuts

  • MD1032 1:46 am on October 10, 2010 Permalink
    Tags: ati, fglrx, linux, radeon,   

    fglrx in Ubuntu 10.10: disable underscan 

    Do you see black borders on your TV when you connect your Linux HTPC with ATI Radeon chipset/card? Usually you would be able to change overscan/underscan settings in the graphical ATI tool – but my plasma is detected as a projector, some underscan is applied and the slider to correct it is missing.

    The solution lies in the command-line tool aticonfig. It allows you to set the relative screen position and the absolute screen size. Create a new file containing this script:

    aticonfig --set-dispattrib=dfp1,positionX:0
    aticonfig --set-dispattrib=dfp1,positionY:0
    aticonfig --set-dispattrib=dfp1,sizeX:1920
    aticonfig --set-dispattrib=dfp1,sizeY:1080
    

    and make it executable. Now configure it as a “startup application” in the Ubuntu preferences. There’s a catch though: you need to find out the name of your display device first. Mine is called “dfp1”. Have a look at your /var/log/Xorg.0.log and find the line similar to

    [    25.483] (II) fglrx(0): Connected Display0: DFP1

    and insert the correct name into the script. Also make sure you set the correct display resolution. Run the script or log off and back on, and the black borders should be gone.

     
    • frans 3:21 pm on January 10, 2012 Permalink

      Thanks for this fix, Works great.

    • kevin 2:28 am on December 22, 2012 Permalink

      this fixed my projector as well… why isnt the default to not over/underscan the damn screen? the edid info has proper hz and res in the rest of the tools. wtf ati?

  • MD1032 7:47 pm on October 8, 2010 Permalink
    Tags: hack, linux, , udev   

    Disable automatic udev rules for network interfaces in Ubuntu 

    If you want to deploy a Ubuntu image across different hosts, each time you boot it on a new machine, a new udev rule for its network card will be created. You will then end up with eth1, eth2, and so on. There are different ways to work around this problem. Here is a simple approach that will completely disable the automatic rule file generation:

    1. rm /etc/udev/rules.d/70-persistent-net.rules
    2. mkdir /etc/udev/rules.d/70-persistent-net.rules

    It’s a hack, it’s not pretty, but it works.

     
  • MD1032 4:33 pm on October 8, 2010 Permalink
    Tags: linux, osx, ssh   

    SSH passwordless login: ssh-copy-id 

    To log on to a remote machine without the need to enter a password each time, you need to copy your SSH public key to the remote machine and add it to the .ssh/authorized_keys file. First, generate a keypair using ssh-keygen, then use this script to copy your key to the remote host:

    #!/bin/sh
     
    # Shell script to install your public key on a remote machine
    # Takes the remote machine name as an argument.
    # Obviously, the remote machine must accept password authentication,
    # or one of the other keys in your ssh-agent, for this to work.
     
    ID_FILE="${HOME}/.ssh/id_rsa.pub"
     
    if [ "-i" = "$1" ]; then
      shift
      # check if we have 2 parameters left, if so the first is the new ID file
      if [ -n "$2" ]; then
        if expr "$1" : ".*\.pub" > /dev/null ; then
          ID_FILE="$1"
        else
          ID_FILE="$1.pub"
        fi
        shift         # and this should leave $1 as the target name
      fi
    else
      if [ x$SSH_AUTH_SOCK != x ] && ssh-add -L >/dev/null 2>&1; then
        GET_ID="$GET_ID ssh-add -L"
      fi
    fi
     
    if [ -z "`eval $GET_ID`" ] && [ -r "${ID_FILE}" ] ; then
      GET_ID="cat ${ID_FILE}"
    fi
     
    if [ -z "`eval $GET_ID`" ]; then
      echo "$0: ERROR: No identities found" >&2
      exit 1
    fi
     
    if [ "$#" -lt 1 ] || [ "$1" = "-h" ] || [ "$1" = "--help" ]; then
      echo "Usage: $0 [-i [identity_file]] [user@]machine" >&2
      exit 1
    fi
     
    { eval "$GET_ID" ; } | ssh ${1%:} "umask 077; test -d .ssh || 
    mkdir .ssh ; cat >> .ssh/authorized_keys" || exit 1
     
    cat < <eof
    Now try logging into the machine, with "ssh '${1%:}'", and check in:
     
      .ssh/authorized_keys
     
    to make sure we haven't added extra keys that you weren't expecting.
     
    EOF

    Mac OS users can copy this script to /usr/bin to and make it executable (chmod +x ssh-copy-id) to make it accessible system-wide.

     
    • babil 5:18 pm on October 8, 2010 Permalink

      You can also use the following one-liner in absence of “ssh-copy-id”:

      ssh remoteuser@remotehost “echo $(cat locateion_of_your_id_rsa.pub) >> /home/remoteuser/.ssh/authorized_keys”

      To generate keys, use “ssh-keygen” as suggested above to get “id_rsa.pub”.

c
Compose new post
j
Next post/Next comment
k
Previous post/Previous comment
r
Reply
e
Edit
o
Show/Hide comments
t
Go to top
l
Go to login
h
Show/Hide help
shift + esc
Cancel