Showing posts with label Php. Show all posts
Showing posts with label Php. Show all posts

Sunday, March 7, 2010

Azureus/Pidgin Integration

That write-up I promised in the "A whole 'nother level of Geekdom' post regarding the implementation of Pidgin as a remote-content-addition-mechanism for Azureus is now done... If you've ever wanted to be able to tell your home torrent box to start downloading something by doing something as simple as sending an Instant Message, give it a glance.

Using Pidgin To Add To Your Azureus Queue Remotely


First things first, there are countless ways to control a torrent-box remotely that will offer you a higher level of control than this procedure, but if your looking for a quick and easy way to add content on-the-fly, without much setup, then this guide is for you.



Requirements:


  • Azureus Vuze (latest version recommended)
  • Pidgin (latest version recommended)

The goal of this little project is to be able to add torrents to Azureus' queue from any computer with an AIM client. The basic setup is this: Azureus has a feature where it will autoscan a directory for new content at a predetermined time interval (i.e. 60 seconds). Pidgin has a plug-in where it will autoaccept file transfers from pre-defined 'AIM buddies', and save them to a pre-defined directory. By daisy-chaining these two features, we can IM .torrent files to an AIM account running on Pidgin on the torrent box, at which point Pidgin will automatically accept the file transfer, and Azureus will subsequently add the torrent to its queue.


Setting up Pidgin


Create a NEW AIM account that will be used on the torrent-box, say something like Steves-torrent-dedi. Next you are going to want to download and install Pidgin onto the torrent computer. Now, I use Linux almost exclusively, so I downloaded pidgin through my distribution's repositories. However if you are using Windows you can get the installer from Pidgin's Site. Now to actually set up the account settings. When you launch pidgin it will prompt you to enter account information.



0

Click the Add button and fill out the fields accordingly with the information of the AIM account you just created. Pidgin can use many protocols besides AIM, such as Yahoo, ICQ, Jabber, Google Talk, et cetera, so you may be able to use accounts operating on those networks as well, though I haven't tested it myself. It's also probably a good idea to have it remember the account password so it can login automatically.


1

If after entering all the information, and verifying that you input it correctly, the account still won't log in, you may have to fine-tune some of the advanced settings. The two biggest problems are 'Use SSL' and 'Use Client Login'. Toy around with these, SSL usually needs to be turned off for Pidgin to login to an AIM account successfully.


3

By this point, you should have the AIM account running on Pidgin, now you need to add your own personal AIM account to the newly created account's buddy list. To add your personal account as a buddy, simply click Buddies>Add Buddy and fill out the form. Once you have done this go Tools>Plugins, and check off autoaccept.


5

Next click the configure plugin to fine-tune its settings. Blocking transfers from users not on your buddy list is probably a good idea, since ideally you would want you to be the only person capable of doing this. The pop-up is a personal choice. Creating a new directory for each user will save all the transfers from Buddy-A in /folder/Buddy-A/file, this is useful for other applications, but not this one since Azureus will only scan one directory for .torrent files, and it won't do it recursivley. Configure the folder where you want the uploaded torrent files saved, the simpler the better. Despite what the screenshot says I used "/home/mint/Uploads".


6

Now just right-click the Buddy you want to autoaccept files from, and click autoaccept. Then check autoaccept once again.


7

Setting up Azureus


Congratulations, your done configuring Pidgin, now onto Azureus. I use version 4.3.1.4 with the classic interface, so you may have to adjust this based on your individual settings. Find your way into the options menu (Ctrl key and , key) and select mode, then change it to advanced.


8

Now while still in the options menu, expand the "Files" submenu, then highlight "Torrents"(don't expand click the actual menu name). Now check off "Import new .torrents automatically", and enter the directory that pidgin will autosave to. You can also modify the scan interval if you so choose.


9

And Voila! The setup is done. Try sending some .torrent files to the account set up on the torrent box, from the account you enabled auto accepts from. This isn't the most powerful solution when it comes to remote management, but it is one of the easiest to set up, and so long as you're not doing anything too intensive, it should suit you fine.



Sunday, January 3, 2010

Adventures in Linux-land

I've really outdone myself this time. So many modifications have been made to my home's technological components in the past week I barely know where to begin, so bear with me if this post seems to be an incongruous wasteland of disorganized thought, I'll try to organize it the best I can.

First off, new computer:
AMD Phenom II x4 965 @ 3.4ghz
8GB (4 2GB modules) of OCZ DDR3 RAM 2 (1600)
Integrated Radeon HD 3300 Graphics (for now)
500 Watt PSU
Optical Drive/HDD/Card Reader/other unexciting peripherals

Now I also modified the computer I had prior to this one to be a home media server of sorts. Specs here:
Pentium IV @ 2.8ghz
2GB DDR2 RAM (800)
80GB IDE Drive (yeah I know, but it's only for the OS)
1.5TB Sata drive in a hot swap in one of the 5.25" bays.
256MB DDR2 8400 GS Nvidia GPU
other uninteresting peripherals.

The Phenom II box I built by hand with a few of my friends. I literally put my own blood and sweat into this machine (pin on the motherboard stabbed me under my thumbnail). After the build, it wouldn't POST. It didn't keep resetting either it just wouldn't post. It just stood there, powered on, mocking me. I tried swapping out the PCI-E graphics card and running it off of integrated, still wouldn't POST. Tried reducing RAM to one measly stick, still nothing. We took it apart and put it back together again with the same results. Then when I got home I completely disassembled it and put it back together again (in various configurations) TWICE, and still nothing. It sucked, $700 for parts on a machine that won't boot, yet has nothing apparently wrong with it.

Next day, I took it to Microcenter, where we basically tried the same thing. Of course now that I'm there it works. The knowledge bar attendant told me the PCI-E graphics card was shot, and managed to get into BIOS while using the integrated graphics. While in BIOS we noticed that my RAM was set to 1066, "Not on my watch" he said and promptly adjusted it to 1600. For some reason the board defaulted to that. I haven't had any problems with this machine since then but am still troubled by one thing: That graphics card works fine. I plugged it into the P4 box and it runs fine. I'm watching it work right now! At this point I'm hoping it was just a compatibility issue between the card and the new motherboard rather than the motherboard's PCI-E just being shot. We tried both sockets on the board too...

A brief segue: For a while, my router's been giving me issues on dual-boot machines. All the computers with only Linux on them ran fine, but my laptop which had Linux Mint 8 and Vista would act... for lack of a better term, 'iffy'. I would have to reset my router every time I booted into Windows because I would get a local only connection with a "limited connectivity" error. I thought the problem was limited to the laptop until I got the new computer (the Phenom II box) which exhibited the same problem. Long story short, after fighting with my router for the better part of an hour I got it to take to a firmware upgrade which rectified the problem, as well as added many new features. The router went from being a rather persistent pain in my ass to one of the most efficient and streamlined routing systems I've ever used. Good work Trendnet, I forgive you now.

Now here's what I did after the router's hiccup was cured: Installed Linux Mint 8 Helena on the P4 box, copying over my /home/steve/.azureus directory from a previous installation so I could keep my statistics/settings/et cetera. I then installed a new copy of Vuze from their website, as the version in synaptic's repositories is hopelessly outdated. I also got apache2 and php5 (from synaptic). Now... here's where things get fun. I set Apache's document root to be /media, several directories above my 1.5TB's mount point. In the /media directory there are several php scripts and an html form that will prompt a user for a username and password before forwarding you to the 1.5TB's directory. This was designed to keep out anyone who had already broke through my router's WPA2 level security.

Although this seems like a task much better left to MySQL, I'm way more familiar with php and was feeling adventurous. So now the P4 is serving everything on the 1.5 TB drive via httpd. This is fantastic for the computer illiterate. Mint 8 ships with Firefox configured with various media plugins, so by clicking a link to a media file, it will seamlessly start playing in the browser. Neat parlor trick for the grandparents, huh? Because quite frankly, my recounting of how I jerry-rigged a php script ignoring all conventions of proper syntax etiquette would be lost on them.

Now that the server is up and accessible, I need a way of remotely adding new content. My first thought is 'remote-desktop', but somehow that seemed a bit too bulky (in terms of bandwidth) for my needs. All I needed was to point Vuze to new content. So believe it or not, I wound up using pidgin, an open-source and cross-platform instant messenger client. Pidgin comes with a plugin to auto-accept transfers from pre-determined screennames, so I set it up to auto-accept transfers from mine and add the files to /home/mint/Uploads. I also set Vuze to auto add new content from that directory which it scans every 60 seconds. So Voila! By sending a .torrent via an instant message file transfer, I can remotely add content to Vuze's queue. And yes, I do have remote-desktop enabled as well in case I need to do anything more intensive from afar.

Now it doesn't end there. Suppose I want to watch the media on my 1.5TB on a television? I can do that too. The 8400 GS that is in the P4 media server has s-video out... Yeah, we don't have HD... Anyway, So I can use the TV as a monitor and watch movies that way. I also have a 3.5mm headphone jack (standard audio out on a computer) to RCA audio converter (the red and white plugs for sound on older televisions), so sound is a go as well.

I'm working with VLC as the player at the moment though I would prefer Boxee. VLC is by no means a shoddy player. In fact it's fantastic, just not ideal for a home media box outputting video to CRT television. Boxee's UI is fantastic for this purpose, but sadly they have not released the beta yet, and the alpha relies on packages in Jaunty's repositories which are outdated/incompatible with Mint 8 which is based of of Karmic. Boxee paired with an ATI Remote Wonder provides a UI simple enough even the biggest tech-tards can navigate their way through it. Once Boxee's beta is released, I'm going to start building boxes that will run it on start up and browse to the 1.5TB, and connect them to every television in the house.

I've also stumbled upon a nifty little media player called Songbird. I'm quite impressed. It can play the .mp3's on my server as if they were a playlist. For example, If I point it to "domain.com/songs/artist/album/" it will play everything in that directory as if it were local content. It's also open-source and cross-platform which is always a plus in my book (as per my love affair with Azureus, Pidgin, Firefox, et cetera).

I think that about sums up the past week. Again, sorry for the mess.