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)

Tuesday 29 January 2013

Newznab PHP Memory Errors

Since the last big update have started to have Newznab crash out with the old "Allowed memory size exhausted" error so have edited the following scripts:


sudo nano /etc/php/cli/php.ini

Look for memory_limit, and either set it to 256MB, or -1 for no limit:
memory_limit = -1

(I had it set to 256M but now trying -1...systems has 1GB in total ram on the virtual)

Also

apache php.ini
sudo nano /etc/php5/apache2/php.ini

and find memory_limit and set it so
memory_limit = -1

Monday 21 January 2013

Newznab Updates ***New***

**Update Vr1.1***

Please note that if you do not run number 5 below then your site will break...leaving lots of nice blank pages to look at...which depending on if you enjoy watching snowstorms could be quite fun!

Well they have been coming thick and fast!

Here's a quick breakdown of what I did and all ran pretty smooth:

SVN Update currently showing alt revision of 2707

1.   svn update (in /var/www/newznab/)

2.   Deleted cached files:
...nnplus\www\lib\smarty\templates_c\
(ubuntu so rm *.* in above folder)

3.   DIDN'T import the new regex.sql or schema.sql
(this would overwrite your database)

4 Checked my "php.ini" file for this line and made sure it was active
extension=php_mysqli.dll

5 Ran the database conversion script:
...nnplus\misc\update_scripts
php update_database_version.php 

Results:

...executing patch 2012_12_29_anidb.sql
...executing patch 2013_01_04_host.sql
...executing patch 2013_01_05_category.sql
...executing patch 2013_01_05_unused_parts_index.sql
...executing patch 2013_01_14_nzb2nfo.sql
...executing patch 2013_01_17_templates.sql
...executing patch 2013_01_18_users.sql
...executing patch 2013_01_19_partsbinco1.sql

Sunday 6 January 2013

NewzNab Plus Blacklists

Version 2

Here's how mine is setup, comments would be nice. Here's a link for the text file & sql import versions:

Blacklist Download



Since implementing this, I've had no memory issues especially regarding the hdnectar HUGE blueray rips that were constantly crashing my box!