Program to resume all your transmission torrent downloads when your computer is idle and pauses when it's active!



Hai, Recently I changed my broadband plan to unlimited. The new plan is much slower than the old one and I can't browse pages smoothly when my torrents are active. So I have to pause all downloads when I'm using my computer and resume before I go somewhere. The problem is, most of the times I forgot to do this; At last I decided to write a program to automate it :)

You must enable your screensaver before running this program and turn on the web client of transmission torrent [ edit > preferences > web ]
# This program automatically resumes your transmission torrent downloads 
# when your computer is idle and pause when its active.
# ( you must enable your screensaver and turn on webclient of transmission torrent )
# [ Author : Sreekumar ]
#
#
import gobject
import dbus
import os
from dbus.mainloop.glib import DBusGMainLoop

DBusGMainLoop(set_as_default = True)
session_bus = dbus.SessionBus()

def stateChanged(state):
#state : represents wheather the screensaver is avtive or not
if state == 1:
print "Resuming Downloads..."
#resumes all transmissions
os.system("transmission-remote --torrent all --start")
else:
print "Downloads Paused!"
#pause all transmisssions
os.system("transmission-remote --torrent all --stop")

session_bus.add_signal_receiver(stateChanged,"ActiveChanged","org.gnome.ScreenSaver")

#this is to check for new events from each of the event sources and dispatch them
mainloop = gobject.MainLoop()
mainloop.run()





Hope you like it :)

How to configure Sony Vaio CW + Nvidia Drivers in ubuntu !

Installing ubuntu in sony vaio cw series and configuring with nvidia display driver is a little complicated stuff . Here is a solution for that.

First you insert your disk and press f6  from boot menu and select "nomodeset" and boot.

( screenshot is taken using virtualbox because i cant take it from the original boot menu)



further installation steps are as usual

after installing remove the cd / other installation media and reboot the system.

again you will get a menu like i added below

press e  ( to edit)




now  you have to add the option nomodeset

type nomodeset  just  after quit splash  and press ctrl + x to boot



download these files

nvidia driver - display driver

http://www.nvidia.in/object/linux_display_ia32_190.42.html

edid.bin - Extended display identification data

http://www.4shared.com/file/cNpBak4w/edid.html

Xorg.conf - xorg configuration
http://www.4shared.com/file/RF1eFNIU/xorg.html

now you have

1. NVIDIA-Linux-x86-190.42-pkg1.run

2. xorg.conf

3 . edid.bin

place all these files in your home folder.

ok, again reboot your system and choose the second option recovery mode



after that you will get something like this. choose  netroot from that menu



then you will get a root shell

type
> init 3

and press enter . This is to change the run level to 3. now you will get text-mode login. use your username and password to login after that run these commands
 
> sudo chmod +x ./NVIDIA-Linux-x86-190.42-pkg1.run

> sudo ./NVIDIA-Linux-x86-190.42-pkg1.run

> sudo cp xorg.conf /etc/X11/xorg.conf

> sudo cp edid.bin /etc/X11/edid.bin

> sudo reboot

the last command reboots your system and still you have problems boot to the recovery mode again as i mentioned above and choose the netroot option and edit the file /boot/grub/grub.cfg


> sudo nano /boot/grub/grub.conf

and find the line that we modified earlier to add nomodeset option ( remember that option will not be there now) so we have to add it after "quit splash" . and save the file by pressing ctrl + o and press enter and ctrl + x to exit. then reboot
> sudo reboot

Everything will be alright now :)

How to know what's being copied from your blog / website !

I don't mind if someone copies my post or any content from my blog / website  because I never planed to make a living from writing a blog . I just want to share something that that I know, that's why I'm blogging . And I'm happy to have a blog to post it and have it read by a few people who may like it. And I know it depends on the way you think. But in my opinion it is also a kind of recognition or appreciation for you that someone likes your post or likes the way that you write, else he will not copy paste the exact thing.  :)


And this is some of my recommendations to monitor your website / blog, these tools may helps you to know who copied from your blog. :)



Copyscape



Copyscape is an  service that checks whether similar text content appears elsewhere on the internet. Copyscape is used by content owners to detect cases of "content theft", in which content is copied without permission from one site to another. It is also used by content publishers to detect cases of content fraud in which old content is repackaged and sold as new original content.   (wiki http://en.wikipedia.org/wiki/Copyscape )



Tynt.com



Tynt.com is a service that allows you to track your blog or website. Using tynt you can track who is copied from your blog and tynt automatically put a link to your (original post) post in their post ( like read more ).



Google Alerts



Google Alerts is content change detection and notification service, offered by the Google, that automatically notifies users when new content from news, web, blogs, video and/or discussion groups matches a set of search terms selected by the user and stored by the Google Alerts service. Notifications can be sent by email as a feed or displayed on the users iGoogle page ( wiki: http://en.wikipedia.org/wiki/Google_Alerts).


Hope you like this :)

If ( you use GNU / Linux ) : you must watch this ;

Revolution OS is a 2001 documentary film that traces the twenty-year history of GNU, Linux, Open-source and the free-software movement.





Program to count the number of lines of code in your project !

This is a simple program in python which counts the total number of lines of code in a list of files from a directory.
 #Program to count the number of lines of code in project
#Author : Sreekumar
#
import sys
import fnmatch
import os
rootPath = sys.argv[1]
pattern = sys.argv[2]
total_lines = 0
lines = 0
for root, dirs, files in os.walk(rootPath):
for filename in fnmatch.filter(files, pattern):
filename = os.path.join(root, filename)
try:
f = open(filename,"r")
lines = len(f.readlines())
print filename + " : %d Lines"% lines
total_lines += lines
except IOError:
print "Some error"
print "\nTOTAL LINES : %s "% total_lines

Save this program as "yourfilename.py" and open a terminal
type

python yourfilename.py /yourprojectdir-path/ *.*

example :

python countlines.py "/home/x/mypro/" "*.php"

the last argumet *.php" specifies the pattern to be filtered from the list of files.

Best download manager for Linux ! ( Like IDM )

I was in search of a download manager like IDM in Linux and I search a lot on blogs and forums, but i never get any solution. I have tried many but I never find any download managers in Linux like Internet download manager. At last I found one.. "Multiget". MultiGet is an easy-to-use GUI file downloader for Windows/Linux/BSDs/MacOs. It's programmed in C++ and has a GUI based on wxWidgets. It supports HTTP/FTP protocols which covers the requirements of most users. It supports multi-task with multi-thread on multi-server. It supports resuming downloads if the Web server supports it, and if you like, you can reconfig the thread number without stopping the current task. It's also support SOCKS 4,4a,5 proxy, ftp proxy, http proxy.

n v0.8.0, a new feature was introduced, that is so called P2SP, or in other words , get file from multiple servers, and combine the data from different site into one file. This makes downloads complete much faster.

MultiGet also supports switching language dynamically, you can choose Chinese or English interface. Generally it will automatic choose a proper language for you.

At this time(version 1.1.1), MultiGet can run on Windows 2000/XP, almost all Linux desktops, MacOs, BSDs. It can only depends on GTK+ runtime environment in Linux if statically linked with wxWidgets. It was tested on many system such as : Windows 2000, ubuntu ,kubuntu, xubuntu, fc5, opensuse10.4, mandriva 2007, MEPIS 6.0, PCLinuxOS, CentOS4.4, Puppy2.0, Xandros, edubuntu, RedFlag workstation 5, MagicLinux, dubuntu, archlinux, Hiweed, FreeBSD, MacOS etc.

To install multiget:

open a terminal and type

sudo apt-get install multiget

or

Download Files


Enjoy Downloading....!