Bitcoin donations are welcome:14snQXeLcnJtWUduKZ6rC2MHdPYrYar1Tw

Thursday, May 17, 2012

Stop rtorrent seeding immediately when done


First, the rtorrent ratio settings explained:
First you have to enable the ratio settings in .rtorrent.rc by typing this line:
ratio.enable=

Next, rtorrent has a setting for a minimal ratio to reach AND a minimum uploaded size which it has to reach before the max.ratio action can take place:
ratio.min.set=XXX
and
ratio.upload.set=XXX

I want it to stop immediately, so I set them as low as possible.

Next you can set the max ratio to reach before it stops. I have set it to 1, which equals something like 0.001.


# Stop torrents when reaching upload ratio in percent,
# when also reaching total upload in bytes, or when
# reaching final upload ratio in percent.
ratio.enable=
ratio.min.set=0
ratio.max.set=1
ratio.upload.set=1b

Saturday, May 12, 2012

Quick mount/umount dir with shortcuts

First make /usr/bin/mount_htpc:

volume="/home/user/htpc"

if mount|grep $volume; then
umount /home/user/htpc
notify-send "[ ] Umounted /home/user/htpc"
else
mount /home/user/XBMC
notify-send "[X] Mounted /home/user/htpc"
fi


Then create a shortcut to this function! Fast and easy!

Smart Lightweight Linux Launch Bar


Try this dmenu launchbar! Works wonders! Simply add a shortcut for it in your system, i.e. .fluxbox/keys:

Mod4 d :Exec $(dmenu_path | dmenu -fn arial -nf grey -sb grey -sf black -nb black)

Sunday, April 29, 2012

Easy NFS howto for Ubuntu/Debian

This works wonders!

Source: http://ubuntuforums.org/showthread.php?t=249889


Install NFS Server Support
at the terminal type
sudo apt-get install nfs-kernel-server nfs-common portmap
When configuring portmap do =not= bind loopback. If you do you can either edit /etc/default/portmap by hand or run:
sudo dpkg-reconfigure portmap
sudo /etc/init.d/portmap restart


Editing /etc/exports
the /etc/exports file is used for creating a share on the NFS server

invoke your favorite text editor or
sudo vi /etc/exports

Here are some quick examples of what you could add to your /etc/exports

For Full Read Write Permissions allowing any computer from 192.168.1.1 through 192.168.1.255
  • /files 192.168.1.0/24(rw,no_root_squash,async)

Or for Read Only from a single machine
  • /files 192.168.1.2 (ro,async)
save this file and then in a terminal type
sudo /etc/init.d/nfs-kernel-server restart

Also aftter making changes to /etc/exports in a terminal you must type
sudo exportfs -a

Install NFS client support
sudo apt-get install portmap nfs-common

Mounting manually
Example to mount server.mydomain.com:/files to /files. In this example server.mydomain.com is the name of the server containing the nfs share, and files is the name of the share on the nfs server

The mount point /files must first exist on the client machine. 
cd /
sudo mkdir files


to mount the share from a terminal type

sudo mount server.mydomain.com:/files /files

Note you may need to restart above services:
sudo /etc/init.d/portmap restart
sudo /etc/init.d/nfs-common restart


Mounting at boot using /etc/fstab
Invoke the text editor using your favorite editor, or
gksudo gedit /etc/fstab

In this example my /etc/fstab was like this:
  • server.mydomain.com:/files /files nfs rsize=8192,wsize=8192,timeo=14,intr
You could copy and paste my line, and change “servername.mydomain.com:/files”, and “/files” to match your server name:share name, and the name of the mount point you created.
It is a good idea to test this before a reboot in case a mistake was made. 
type
mount /files 
in a terminal, and the mount point /files will be mounted from the server.

Saturday, March 31, 2012

Auto enable numlock at ubuntu startup

Easy fix...

Just install numlockx.

apt-get install numlockx

Restart, DONE! :-)

Ubuntu Oneiric 11.10 60 second halt during startup

The error: "waiting for network configuration"


Well, I've been there, done that, fixed that.. Here it goes.


In my case I just updated to the latest version of ubuntu (11.10 oneiric). I am also using wicd-client for managing all my network connections, which works flawless. After the update I started getting these halt messages during startup. The problem is ubuntu's own network config files which has other expectations on how the network should act.


The fix:

root@System:/home/user# nano /etc/network/interfaces 


now # out all lines except "auto lo" and "iface lo inet loopback".
My file looks like this:


# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).

# The loopback network interface
auto lo
iface lo inet loopback

# The primary network interface
#auto eth0
#iface eth0 inet dhcp

Monday, September 5, 2011

Enable wakeup from suspend with usb keyboard or mouse in Linux Ubuntu

This guide is exactly what you need :)

In short;
1.) Enable it in your bios
2.) echo DEVNAME > /proc/acpi/wakeup
3.) Correct DEVNAME is found using the following script:

grep "USB.*pci" /proc/acpi/wakeup | cut -d ':' -f 2- | while read aaa; do find /dev/.udev -name "*$aaa*" -print -exec grep "$aaa" /proc/acpi/wakeup \; -exec echo \; ; done
4.) Add cmd(2.)) to /etc/init.d/wakeup


Your wakeup file should look something like this:

#!/bin/sh
# Set /proc/acpi/wakeup to allow devices to wake system
# sudo sh -c "echo USBX > /proc/acpi/wakeup"
echo USB4 > /proc/acpi/wakeup


5.) Enable wakeup to boot at startup:
update-rc.d wakeup defaults
6.) Done...