Tuesday 5 March 2013

Video Modes running Ubuntu 12.10 server in Parallels & screen blanking issue

Had some trouble in changing the terminal resolution even after installing the Parallels Tools, while the tools install allowed me to see my shared folders it didn't offer any way of changing the (tiny) 800*600 default screen...sooooo:

First determine the resolution you wish to have the console run at. Most cards support the standard VESA resolutions and their associated mode numbers. Pick the resolution you want and remember it's mode number. I wanted 1024x768x16 so my mode number is 791.

Type sudo su at the terminal prompt and enter your password. This leaves you with a root capable shell. 

Edit /etc/default/grub with:

nano /etc/default/grub

Find the line with GRUB_CMDLINE_LINUX_DEFAULT and add vga=xxx where xxx is the mode number. It should look something like:

GRUB_CMDLINE_LINUX_DEFAUT="quiet vga=791"

Save the changes and exit the editor

Update grub with the new settings. The settings will not take affect with out this.

update-grub

Restart your machine with the reboot command if you are still elevated or su reboot 

*****I choose 794 personally (1,280*1,024, 16bit) but goto Vesa Modes and fill your boots :-)

Is your screen blanking out after about 5-10 mins and hiding all those nice tmux screens!!!??


Edit /etc/default/grub with:

nano /etc/default/grub

Find the line with GRUB_CMDLINE_LINUX_DEFAULT and add consoleblank=0. It should look something like:

GRUB_CMDLINE_LINUX_DEFAUT="quiet consoleblank=0 vga=791"

then run "update-grub" & reboot....no more blank screen (epic win!) :-)

Newznab, Tmux, Backfill & Running on boot (Phew!)

Too many things to type in everytime you reboot your server? Want to backfill a buttload of nzb's you've torrented or been given? Follow the guide below, it automates everything into 1 script & then using tmux shows what's happening:

Step 1:


Postprocess script.

This script only does postprocessing. By default update_releases.php post processes the last 100 releases. if you backfill or if your update_releases.php has more than 100 releases some may not process. This script is to be run in another shell and only does post processing on releases that have not been done yet. when there is nothing to to it looks like it is hung but if you have more releases the script continues. Another rational is that it allows update_releases to finish quicker because the number of post processing it does is changed to 1.


nano +333 /var/www/newznab/www/lib/postprocess.php << change the 100 to a 1.

link to script download (place in update_scripts) justpostprocess

chmod 755 justpostprocessing.php << you can now run this script in a another shell.


Step 2:

The requirements to run this are as follows:

you must have followed the instructions for the Post-Processing script (above)
you must have installed sysstat (apt-get install sysstat)
you must have instaled ifstat (apt-get install ifstat)
you must have a basic understanding of how Tmux works (really really basic if you follow this guide :-)

Step 3:

If you go to your newznab installation folder, (mine for future reference is /var/www/newznab) and look in the misc/testing folder. You’ll see a script called nzb-importmodified.php. Copy that to /where/your/newznab/is/www/admin:

cp /where/your/newznab/is/misc/testing/nzb-importmodified.php /where/your/newznab/is/www/admin

Go to your screen script (or batch script on windows, then nano (or your choice of editor):

nano /where/your/newznab/is/misc/update_scripts/nix_scripts/newznab_screen.sh

Inside there, you should add a reference to your new import modified, with a link to where your nzbs are stored. Here is what my newznab_screen.sh looks like:


By adding true to the end of the request, it uses the name from the NZB file and doesn’t re-look it up.

create a folder in /var/www/newznab - mkdir tempnzbs 
(This is where you would store any nzb's you want to do a backfill import on....)

Step 4:

Copy this script into /var/www/newznab


you must modify line 20 with the appropriate newznab_screen_backfill.sh script for your configuration
(in step 3 I created a copy of newznab_screen.sh & renamed it to newznab_screen_backfill.sh)

Step 5:

run your new startup script:

./NN_Autostart

and watch the magic happen!

If you want to end the session (maybe to run an update etc..) ctrl+c to exit a screen then "tmux kill-server"

PS. If not using Sphinx (why not!) then just edit it out of the script above....same with any information windows you do not require)