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

Thursday, 18 September 2014

using xrandr

identify your devices

xrandr

Screen 0: minimum 320 x 200, current 1920 x 1980, maximum 8192 x 8192
LVDS-1 connected 1600x900+0+1080 (normal left inverted right x axis y axis) 309mm x 174mm
   1600x900      60.01*+  40.00 
   1152x864      59.96 
   1024x768      59.92 
   800x600       59.86 
   640x480       59.38 
   720x400       59.55 
   640x400       59.95 
   640x350       59.77 
VGA-1 connected primary 1920x1080+0+0 (normal left inverted right x axis y axis) 510mm x 290mm
   1920x1080     60.00*+
   1680x1050     59.95 
   1400x1050     59.98 
   1600x900      59.98 
   1280x1024     75.02    60.02 
   1440x900      59.89 
   1280x800      59.81 
   1152x864      75.00 
   1280x720      59.97 
   1024x768      75.08    60.00 
   832x624       74.55 
   800x600       75.00    60.32    56.25 
   640x480       75.00    60.00 
   720x400       70.08 
DP-1 disconnected (normal left inverted right x axis y axis)
DP-2 disconnected (normal left inverted right x axis y axis)
DP-3 disconnected (normal left inverted right x axis y axis)



VGA-1 is the external monitor
LVDS-1 is the laptop's screen

Now, select the external screen above the laptop's.

xrandr --output LVDS-1 --below VGA-1

Set the screen as the primary one (so the notification area sits on it)

xrandr --output VGA-1 --primary



Monday, 10 June 2013

Rotate only one screen

check devices

xrandr -q

and rotate accordingly

xrandr --output LVDS-0 --rotate left

Sunday, 7 April 2013

vim screen and the nasty ABCD key-bindings for the arrow keys

This is the solution

set term=xterm

Adding this line to yout .vimrc file or 

:set term=xterm

once you are in vim.



Friday, 18 January 2013

How to grep a variable in bash?


export var='chr1'
grep -P ^$var'\t' file.to.grep

This will grep the lines that begin with chr1 followed by a tab. This ignores cases as chr11 or chr19


Wednesday, 14 November 2012

How to iterate through an array in bash? one liner


$ export MYARRAY=("one" "two" "three" "four")
$ for i in ${MYARRAY[@]}; do echo $i;done
one
two
three
four

and to reverse the loop



$ for (( idx=${#MYARRAY[@]}-1 ; idx>=0 ; idx-- )) ; do    echo ${MYARRAY[idx]} ; done

How to scroll up using screen in linux

Crtl + a then press ESC to enter copy mode.

You use the mouse wheel to scroll up and down.

Wednesday, 20 June 2012

Good vimrc resources

Examples of changing spelling highlight modes

http://bodhizazen.net/Tutorials/vimrc


And another resource from Amir Salihefendic http://amix.dk


http://amix.dk/blog/post/19691#The-ultimate-Vim-configuration-on-Github

http://amix.dk/vim/vimrc.html

Monday, 11 June 2012

Yumex Authentication in Openbox

add the next line to your autostart script


(sleep 1 && /usr/libexec/polkit-gnome-authentication-agent-1) &

Wednesday, 29 February 2012

How to enable SSH on Fedora 16

# become super user
su -
# to activate it
systemctl start sshd.service

# to run it at boot
systemctl enable sshd.service

#enable it on the firewall
system-config-firewall

Monday, 20 February 2012

How to rc.local fedora 16?

F16 by default has removed the rc.local file (see the release notes). You just need to create the rc.local file in /etc/rc.d , make it executable and tell the system that is a bash script. See steps below

su -
(root password)


 echo '#!/bin/sh' > /etc/rc.d/rc.local


 chmod +x /etc/rc.d/rc.local


Now you can add your favorite lines to rc.local in order to run commands at start up.


Wednesday, 1 February 2012

Firefox too slow in Fedora (15)


In firefox


   about:config


Find


network.dns.disableIPv6


set to true

Wednesday, 25 January 2012

Inverting screen colours in linux

xcalib -invert -alter

You can set this command to a keyboard shortcut.

Very useful for reading in the screen without bleeding eyes.