Archive for the ‘HOWTOs’ Category

SABnzbd URL Bookmarklet (NZBMatrix)

Posted on the April 21st, 2010 under HOWTOs,Technology / Computing by jglemza

Here’s a simple bookmarklet that will take the URL of the current page you’re on and tell SABnzbd to download it. It works great if you’re using NZBMatrix and on the page for the post you’re wanting to download. Perfect for your mobile browser.

javascript:location.href='http://yourhost:8080/api?mode=addurl&name='+encodeURIComponent(location.href)+'&apikey=yourapikey';

Be sure to insert your SABnzbd API key and hostname (or IP address) into the bookmarklet’s code.

Perl Find and Replace One Liner

Posted on the January 20th, 2010 under HOWTOs,Sys Admin by jglemza

I’m constantly needing a way to easily change a line in a bunch of configuration files. I thought I’d share the way I do it here.

perl -p -i -e 's/oldstring/newstring/g' *

This allows you to use a regular expression and perform the find and replace.

HOWTO: Set the SSHD Idle Timeout

Posted on the June 24th, 2009 under HOWTOs,Sys Admin,Technology / Computing by jglemza

Here’s something that I usually forget to change from the default and then get annoyed when my terminal hangs.

  1. As root open your sshd_config file in an editor.
    su -
    vim /etc/ssh/sshd_config
  2. Add the following lines.
    ClientAliveInterval 600
    ClientAliveCountMax 3
  3. Restart the sshd process.
    service sshd restart

That’s it. That will keep you logged in for 30 minutes at a time without activity. (600 seconds x 3)