čtvrtek 25. února 2016

X11: change display resolution with xrandr


1. get current state:

cyril@workstation: xrandr 
Screen 0: minimum 320 x 200, current 3840 x 2160, maximum 16384 x 16384
DFP1 connected primary 1776x1000+0+0 (normal left inverted right x axis y axis) 621mm x 341mm
   3840x2160     29.97 +  24.00    25.00    23.98    29.97  
   2560x1440     59.95  
   2048x1536     24.00    25.00    23.98    29.97    29.97  
   1920x1440     60.00  
   ...
   640x480       72.81    75.00    66.61    59.94  
DFP2 disconnected (normal left inverted right x axis y axis)
DFP3 disconnected (normal left inverted right x axis y axis)

2. change resolution:
cyril@workstation:> xrandr --output DFP1 --mode 3840x2160 --dpi 162
cyril@workstation:> xrandr --output DFP1 --mode 2560x1440
cyril@workstation:> xrandr --output DFP1 --mode 2048x1536 
 
3. in case of "unkonwn mode":

# compute parameters of new mode
cvt 1440 900 60
#then define and add new mode
xrandr --newmode  "1440x900_60.00"  106.50  1440 1528 1672 1904  900 903 909 934 -hsync +vsync 
xrandr --addmode VNC-0 1440x900_60.00
 
#and finally set 
xrandr -s 1440x900
 

pátek 19. února 2016

wordpress obracene poradi

přirozené pořadí příspěvků blogu od nejstaršího:
viz https://wordpress.org/support/topic/order-posts-by-date-ascending-in-a-particular-category :

I have had a go at solving thi smyself and it seems to work.
Here's what I did
1. Go to the template folder for the active wp templete
2. Copy index.php to a file called category-n.php (where n is the number of the category you wish to sort in). You can find this number by looking at the terms table in phpMyAdmin. In my case the category was 9 so I created a file called category-9.php
3. Edit category-n.php
4. just before the loop <?php while (have_posts()) : the_post(); ?>)
place this line of code
<?php query_posts($query_string."&orderby=date&order=ASC"); ?>
5. Edit the cosmetic navigation page links from “Previous Posts” to “Further Posts” as follows. Change the line
<div class="alignleft"><?php next_posts_link('&laquo; Previous Entries') ?></div>
To
<div class="alignright"><?php next_posts_link('Further Entries &raquo;') ?></div>
`
6. Save the file and upload it to the template folder on your server.