Run rtorrent as a daemon in Arch Linux

Archlinux-icon.png

Copy this into /etc/rc.d/rtorrent and add the daemon to /etc/rc.conf. Make sure you change USER in the script below to your user name

#!/bin/bash

. /etc/rc.conf
. /etc/rc.d/functions

case "$1" in
  start)
    stat_busy "Starting rtorrent"
    su rtorrent -c 'screen -d -m rtorrent' &> /dev/null
    if [ $? -gt 0 ]; then
      stat_fail
    else
      add_daemon rtorrent
      stat_done
    fi
    ;;
  stop)
    stat_busy "Stopping rtorrent"
    killall -w -s 2 /usr/bin/rtorrent &> /dev/null
    if [ $? -gt 0 ]; then
      stat_fail
    else
      rm_daemon rtorrent
      stat_done
    fi
    ;;
  restart)
    $0 stop
    sleep 1
    $0 start
    ;;
  *)
    echo "usage: $0 {start|stop|restart}"
esac
exit 0

Source:
http://forums.gentoo.org/viewtopic-t-600362.html
http://wiki.archlinux.org/index.php/RTorrent#rtorrent_Daemon_with_screen

http://bbs.archlinux.org/viewtopic.php?id=53395

3 Great Books For Free

copyleft.png

I’ve found that three of my favorite books are available for free for download and re-distribution, so I’m just spreading the word and providing some mirrors

Richard Stallman’s book:  Free Software Free Society
Download the PDF file here: http://tuxtraining.com/files/rms-essays.pdf
Source: http://shop.fsf.org/product/free-software-free-society/

Lawrence Lessig’s book:  Free Culture
Download the PDF file here: http://tuxtraining.com/files/freeculture.pdf
Source: http://www.free-culture.cc/freecontent/

Eric Raymond’s : The Cathedral and the Bazaar
Download the postscript file here:  http://tuxtraining.com/files/cathedral-bazaar.ps
Source:  http://www.catb.org/~esr/

Linux: Rute User’s Tutorial and Exposition

tux.png

Recently added to the site: Linux: Rute User’s Tutorial and Exposition (you’ll notice another link to it on the right hand column beneath the sections).

This is a great Linux reference covering a great deal of the basics, available for legal electronic distribution.  Enjoy.

An introduction to sed

terminal.png
  • sed reads from a file or from its standard input, and outputs to its standard output. You will generally want to redirect that into a file, but that is not done in these examples just because it takes up space. sed does not get along with non-text files, like executables and FrameMaker files. If you need to edit those, use a binary editor like hexl-mode in emacs.
  • The most frustrating thing about trying to learn sed is getting your program past the shell’s parser. The proper way is to use single quotes around the program, like so:>sed ’s/fubar/foobar/’ filenameThe single quotes protect almost everything from the shell. In csh or tcsh, you still have to watch out for exclamation marks, but other than that, you’re safe.
  • The second most frustrating thing about trying to learn sed is the lovely error messages:
    	sed 's/fubar/foobar' filename
    	sed: command garbled: s/fubar/foobar
  • The GNU version of sed generally has better error messages:
    	gsed 's/fubar/foobar' filename
    	gsed: Unterminated `s' command

    So, if you’re having problems getting sed syntax correct, switch to gsed for a while.

Continue reading ‘An introduction to sed’ »

Install and configure SLiM on Arch Linux

Archlinux-icon.png

SLiM (Simple Login Manager) is a desktop-independent graphical login manager for the X Window System. SLiM aims to be light, completely configurable, and suitable for machines on which remote login functionalities are not needed.

SLiM supports the following features:

  • PNG and XFT support for alpha transparency and anti-aliased fonts
  • External themes support
  • Configurable runtime options: X server, login / shutdown / reboot commands
  • Single (GDM-like) or double (XDM-like) input control
  • Can load predefined user at startup
  • Configurable welcome / shutdown messages
  • Random theme selection

Continue reading ‘Install and configure SLiM on Arch Linux’ »

Bash Color Escape Codes

terminal.png

Below is a quick rundown on how to color output of echo in bash.

Continue reading ‘Bash Color Escape Codes’ »

Add useful information to the statusbar in wmii

wmii.png

Want your wmii statusbar to give a bit more information than the defaults? Not all that different than how you pull info into Gnu Screen’s statusbar with scripts/backticks, and pretty simple.  See below:.

Continue reading ‘Add useful information to the statusbar in wmii’ »

How to have video thumbnails in Rox file manager in Arch and Gentoo

Archlinux-icon.png

ROX-Filer is a fast and powerful graphical file manager for the X Window System.

By default ROX-Filer has thumbnailing disabled, and when enabled only supports some basic image formats. The thumbnail suport can be expanded by using VideoThumbs which will allow ROX-Filer to generate and display thumbnails for most common video formats.

Continue reading ‘How to have video thumbnails in Rox file manager in Arch and Gentoo’ »

Scan for and connect to networks from an openbox pipe menu

wireless.jpg

Source

So the other day when i was using wifi-select (awesome tool) to connect to a friends hot-spot, i realized “hey! this would be great as an openbox pipe menu.”  i’m fairly decent in bash and i knew both netcfg and wifi-select were in bash so why not rewrite it that way?

Continue reading ‘Scan for and connect to networks from an openbox pipe menu’ »

Reducing memory use with urxvtd and urxvtc

terminal.png

Source

I have always resented the fact that my terminal-based systems running under X incur a rather hefty price in the way of one instance of urxvt per application, which in turn implies one instance of bash per application. (One of these days I’ll get off my rear end and pick a shell that isn’t quite as hefty, relatively speaking, as bash. Suggestions welcomed. )

I had been using dmenu in Musca to start applications with urxvt -e (application), and each time I saw options for both urxvtd and urxvtc. A quick skim through some man pages, and now I understand that urxvtd is the daemon, and urxvtc triggers the daemon to spawn a new terminal window.

Which means that instead of four terminal emulators taking up a wide slice of the 16Mb I have in this Pentium, I have one daemon running and four applications hooked into it.

Why bother? Well for me, as I have already implied, the amount of space required is suddenly a fraction, inversely proportional to the number of emulators you originally needed. (That makes almost no sense at all, but suffice to say that when I ran tty-clock, centerim and hnb alongside charm, I used to need four terminals and four instances of bash to run them. Now I need only one daemon, which I suppose suggests it takes up one-quarter of the resources. … )

Continue reading ‘Reducing memory use with urxvtd and urxvtc’ »

Pages: Prev 1 2 3 4 5 6 7 8 ...63 64 65 Next