Tuesday 16 March 2010

Limit Deluge based on time of day, command arguments or a toggle button

I live with my girlfriend and share the apartment with two others, so I can't use all of the bandwidth all of the time. I also work from home, and like to limit my torrent sharing if I'm doing something that requires more bandwidth, so I made this script.

It runs at startup and at 7.10pm on week days. If my computer is turned on in the evening, it limits the bandwidth deluge uses so others in the apartment can do what they like without me clogging things up. This works better than a normal cron job would since I may not have my computer turned on when the cron job is scheduled to run.

I also run this command via a menu entry, with the argument 'toggle', so i can cycle through the three bandwidth settings when i need to.



For deluge versions >= 1.2.0, the script is available here. For pre 1.2.0, the script is available here. See update post for details.

Change the config values at the top of the script to ones that are suitable for you. The script sends a notification via send-notify, and also logs actions to /var/log/messages.


Because it also accepts the arguments 'limit', 'partial' and 'unlimit', it can also be run from the command line, perhaps via ssh if you run deluge on your server or if you want to create buttons for every setting, rather than rely on the 'toggle' functionality.

Monday 1 March 2010

Securely delete files using shred via nautilus-actions

"shred - overwrite a file to hide its contents, and optionally delete it"



I encrypt my sensitive information with PGP, but when unencrypting the files to view them I'm left with a plain text version. Using this script enables me to get rid of the plain text versions from within the right-click menu in a secure manner using shred. Shred will overwrite the file(s) 25 times with various patterns before deleting it from the filesystem, making recovery difficult without specialist equipment.

 

Simply download the script and create a nautilus-actions config. Just pass it the parameter %M, and use it on single or multiple file selections.