Friday, December 13, 2013

Send transmission torrent complete notification to pushbullet

1. sudo git clone git://github.com/randomchars/pushbullet.py.git pushbullet
2. python /home/pi/install.py install
3. create a new file /var/lib/transmission-daemon/notify.py

4. edit  /var/lib/transmission-daemon/transfinish.sh (File created in this post) and add below lines.

/var/lib/transmission-daemon/notify.py "${TR_TORRENT_NAME}"

NOTE: To find the device ID use below python script 

 from pushbullet import PushBullet
pb = PushBullet(api_key)
print(pb.devices)

Thursday, December 12, 2013

How to send Pushover notification from Transmission

UPDATE: Before using below script --> sudo apt-get install curl

1. Create a file with name transfinish.sh
sudo nano /var/lib/transmission-daemon/transfinish.sh
This will create a new file.
2. Create a new application for transmission in pushover by giving the name , type = script , icon etc.
3. Supply API code for app and user in below code and and paste in transfinish.sh code

4. Save the file. 

5. execute chmod 755 transfinish.sh
chmod +x ttransfinish.sh
6. Add below lines in the transmission configuration file
"script-torrent-done-enabled": true, "script-torrent-done-filename": "/path/to/where/you/saved/transfinish.sh",





Tuesday, December 10, 2013

Setting Up Home Media Center

Installation of RASPBMC

1. Install the RASPBMC from online installer  http://www.raspbmc.com/download/
2. Make sure that the wifi connection is selected before starting the installation on the card.
3. Connect it to Device and start
4. Online updated
5. Check wifi Connection from the RASPBMC settings.
6. Add External Drive and add sources to the XBMC
7. Create Folders -
mkdir /media/usb0/Downloads
mkdir /media/usb0/Downloads/complete
mkdir /media/usb0/Downloads/incomplete
mkdir /media/usb0/Downloads/torrents

8.  Install Tramsmission
sudo apt-get install transmission
sudo apt-get install transmission-daemon
sudo rmdir /home/xbian/torrents

9. Remove Transmission default folders
sudo rmdir /home/xbian/downloads
sudo rmdir /home/xbian/incomplete

10 If external drive is not NTFS then execute below else go to step 11
chmod -R 777 /media/usb0/Downloads
chmod -R 777 /media/usb0/XBMC Media Center/

11. From the SSH console, type sudo nano /etc/init.d/transmission-daemon
Look for the line that says 'USER=debian-transmission' and change it to 'USER=pi'
Press CTRL+X  to save and exit.
type the following comands:
    sudo chown -R $USER /var/lib/transmission-daemon/info/
    sudo chown -R $USER /etc/transmission-daemon/
    sudo service transmission-daemon start

12. Edit transmission config file by executing -

sudo service transmission-daemon stop
sudo nano /etc/transmission-daemon/settings.json


"alt-speed-down": 400,
"download-dir": "/home/pi/downloads",
"download-queue-enabled": true,
"download-queue-size": 2,
"ratio-limit": 0.2,
"ratio-limit-enabled": true,
"rpc-whitelist-enabled": false,
"seed-queue-enabled": false,
"seed-queue-size": 2,
"speed-limit-down": 2000,
"speed-limit-down-enabled": true,
"speed-limit-up": 90,
"speed-limit-up-enabled": true,
"watch-dir": /media/Ankit/Downloads/complete,
"watch-dir-enabled": true

press CTRL+O and then choose enter to save the file. Then press CTRL+X to exit the settings file.
copy/paste and run this command: sudo service transmission-daemon start

Installation of Sickbeard - for torrents - GitHub --> https://github.com/bricky/Sick-Beard

13. cd ~
14. git clone https://github.com/bricky/Sick-Beard.git Sick-Beard
15. cd Sick-Beard
16. python SickBeard.py
17. Start Sick Beard on startup
sudo nano /etc/rc.local
Put "python /path/you/cloned/sickbeard/SickBeard.py -d" above the "exit 0".
18. Install CouchPotato
cd /home/pi
git clone http://github.com/RuudBurger/CouchPotatoServer.git
python CouchPotatoServer/CouchPotato.py --daemon

above command will start CouchPotato in daemon mode.
19. Start CouchPotato on startup
sudo nano /etc/rc.local
python CouchPotatoServer/CouchPotato.py --daemon


Sunday, January 27, 2013

Windows Media Services – Starting Publishing Points with VB Scripts

Its good to be back after two & a half months break. Probably when you become too active it’s a way to tell yourself to hold back and relax for a while. Well I spent my 2 months on bed rest not in a particularly good way.

But nothing hold you back from learning new things and this time it’s the Windows Media Services. I am using windows media services 9 on windows server 2003(yeah I know it was last used by Pharaohs Smile)

The Problem :

                             I am working on a live webcasting project where I need to configure 6 media servers across the country to push the live video feed from one server to other. The drawback is that if the 1st media server is down or encoder is down it starts a chain reaction and turn off all the media servers. The problem is compounded with the cumbersome process of restarting the multicast publishing points. We need to run the Multicast announcement wizard all over again for each publishing point and for each server.

The solution

                           I came up with a couple of VB scripts.

First script is the one responsible for starting all the publishing points on the server.

   1: set obj = createobject("WMSServer.server")
   2: for each pubpt in obj.PublishingPoints
   3: ' check for broadcast type
   4:   if pubpt.Type = 2 then
   5:      pubpt.Start
   6:   end if
   7: next
   8:  

Save the above script as start.vbs on C Drive of  WMS server. Running the script will start all the publishing points.


Now I need some mechanism to run this script (located on WMS server) from my local machine.


Below is the script which I save on the local machine as *.vbs and running this script will run the above script on each server.



   1: 'Turning on WMS1
   2: strComputer = "<IP of the WMS1>"
   3: strCommand = "cscript c:\start.vbs"
   4:  
   5: Set objWMIService = GetObject("winmgmts:" & "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
   6: Set objProcess = objWMIService.Get("Win32_Process")
   7:  
   8: errReturn = objProcess.Create(strCommand, null, null, intProcessID)
   9:  
  10: If errReturn = 0 Then
  11: Wscript.Echo "All Publishing Point started at WMS1  with a process ID: " & intProcessID
  12: Else
  13: Wscript.Echo "Publishing Points at WMS1 could not be started due to error: " & errReturn
  14: End If
  15:  
  16: 'Turning on WMS2
  17: strComputer = "<IP of the WMS1>"
  18: strCommand = "cscript c:\start.vbs"
  19:  
  20: Set objWMIService = GetObject("winmgmts:" & "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
  21: Set objProcess = objWMIService.Get("Win32_Process")
  22:  
  23: errReturn = objProcess.Create(strCommand, null, null, intProcessID)
  24:  
  25: If errReturn = 0 Then
  26: Wscript.Echo "All Publishing Point started at WMS2  with a process ID: " & intProcessID
  27: Else
  28: Wscript.Echo "Publishing Points at WMS2 could not be started due to error: " & errReturn
  29: End If

Points to remember with this process-


1. Sequence of the servers on the second script should be considered based on the webcasting feed layout. It means WMS1 to be started before WMS2 so that WMS should have source of WMS1 publishing points.


2. User who is executing 2nd script should have admin rights on all the WMS servers.


-Cheers Smile

Sunday, October 14, 2012

Love for After Effects

Lately I have been working on After Effect (part of Adobe Creative Suite) and I am highly impressed with the quality of graphics we can design.
I was working on one of the project to create a online learning module and decided to create a motion graphic intro video for that. Soon I came across “TrapCode Plugin” and believe me its awesome. Once you install it the possibilities are limitless.

I designed intro which you can see below.

You can try with the free template (credit goes to Acrez). Below is the link for download.
https://rapidshare.com/files/1111568391/Clean-Particle-Logo-Reveal_ProjectFol...

Wednesday, October 10, 2012

Implementing GTD on Outlook–Part 3


How to add Macro Buttons on open email view.
In Implementing GTD on Outlook–Part 1 & 2 we have seen how we can create task from Macros. We have also seen how we can add these Macros as buttons on command bar of outlook. Now we will explore the options to add these buttons on open email view.
First open any email in outlook and click on drop down on quick access bar. See below image.

2012-10-10_2039
Now click on more commands and from “Choose command from” dropdown select Macros
2012-10-10_2042
Now select the Macros you have created from left pane to add to right pane. Once all the Macros are added then select each Macro one by one to Modify. This step is important because on quick access bar you will see only icons not the title. Now assign the icon to each Macro and save it. Now your Quick access bar will look like this-
2012-10-10_2045
Now whenever I open a unread email I can see these icons on top of the email. Let say a office task is to be created from this email. I just click the “man in coat” icon and a Office task is created for me with reminder , due date(3 days from current date – if any changes are there, it gets updated in my weekly review) and a copy of original message attached.

Cheers!

Monday, October 8, 2012

Implementing GTD on Outlook–Part 2


Create appointment directly from the email.
Code for same is given below
   1:  Option Explicit
   2:  Sub NewMeetingRequestFromEmail()
   3:      Dim app As New Outlook.Application
   4:      Dim item As Object
   5:      Set item = app.ActiveInspector.CurrentItem
   6:      
   7:      If item.Class <> olMail Then Exit Sub
   8:      
   9:      Dim email As MailItem
  10:      
  11:      Set email = item
  12:      
  13:      Dim meetingRequest As AppointmentItem
  14:      
  15:      Set meetingRequest = app.CreateItem(olAppointmentItem)
  16:      
  17:      meetingRequest.Categories = email.Categories
  18:      meetingRequest.Body = email.Body
  19:      meetingRequest.Subject = email.Subject
  20:      meetingRequest.Attachments.Add email
  21:      
  22:      Dim attachment As attachment
  23:      For Each attachment In email.Attachments
  24:          CopyAttachment attachment, meetingRequest.Attachments
  25:      Next attachment
  26:      
  27:      Dim recipient As recipient
  28:      
  29:      Set recipient = meetingRequest.Recipients.Add(email.SenderEmailAddress)
  30:      recipient.Resolve
  31:      
  32:      For Each recipient In email.Recipients
  33:          RecipientToParticipant recipient, meetingRequest.Recipients
  34:      Next recipient
  35:      
  36:      Dim inspector As inspector
  37:      
  38:      Set inspector = meetingRequest.GetInspector
  39:          
  40:      'inspector.CommandBars.FindControl
  41:      inspector.Display
  42:      
  43:  End Sub
  44:   
  45:  Private Sub RecipientToParticipant(recipient As recipient, participants As Recipients)
  46:      Dim participant As recipient
  47:      
  48:      If LCase(recipient.Address) <> LCase(Session.CurrentUser.Address) Then
  49:          Set participant = participants.Add(recipient.Address)
  50:          Select Case recipient.Type
  51:          Case olBCC:
  52:              participant.Type = olOptional
  53:          Case olCC:
  54:              participant.Type = olOptional
  55:          Case olOriginator:
  56:              participant.Type = olRequired
  57:          Case olTo:
  58:              participant.Type = olRequired
  59:          End Select
  60:          participant.Resolve
  61:      End If
  62:   
  63:  End Sub
  64:   
  65:  Private Sub CopyAttachment(source As attachment, destination As Attachments)
  66:      On Error GoTo HandleError
  67:      
  68:      Dim filename As String
  69:      
  70:      filename = Environ("temp") & "\" & source.filename
  71:      
  72:      source.SaveAsFile (filename)
  73:      
  74:      destination.Add (filename)
  75:      
  76:      Exit Sub
  77:      
  78:  HandleError:
  79:      Debug.Print Err.Description
  80:  End Sub
  81:   
  82:   



The code will open a pop up with the content from the current email copied to its body. Also the original email copy is attached to it (for future reference)