Dlink 323 eztv rss feed
by sean villani on Mar.27, 2012, under Random
I love the fact that i can load up my NAS with torrents and let it do it’s work without having to worry. I’m also a fan of automating anything. In an attempt to make my life easier; i’ve thrown together a quick and dirty eztv rss feed to fetch my favorite tv shows. Now there are a couple out there but nothing i could get set up on my NAS properly. I’ve written this quick and dirty script to handle it. This is what i did:
The first thing i needed to do was install Transmission on my dlink 323. Transmission is much better than the crappy bit torrent that comes with the 323. You can find install instructions here: http://forum.dsmg600.info/t2719-%5BREL%5D-Transmission.html.
Once transmission is installed the first thing you’ll need to do is make sure you start the daemon with the watch folder setting. A watch folder is a folder that you can dump .torrent files into and transmission will queue them up for you. Great little asset!. To tell transmission to watch a folder – edit your /ffp/start/transmission.sh file and look for transmission_start() function. Replace with:
1 | $su_cmd $user -c "$command -c /mnt/HD_a2/Downloads/watcher -g ${TRANSMISSION_HOME} -e ${TRANSMISSION_HOME}/$n |
Now that we have a watcher folder we need to get .torrent files to it. Queue EZTV. eztv.it is a great website that allows you to search through hundreds of TV show torrent rss feeds. It’s updated as soon as a new episode is available and it’s perfect for what i’m looking for. Since i want to keep everything very simple, i’ve opted to create a text file called feedList.txt and i’ll use this file to hold all of the tv show rss feeds that i’m interested in keeping up with.
And now the brains of the whole operation. I’ve written a script called getTorrents.sh that does the following:
- Check the feedList.txt file and loop through each rss feed on each line
- use wget to fetch the rss feed and check it against the previous one downloaded and saved. If it’s the first time we’ll create a blank
- then we do a diff with a regex (and some clean up) to get the diff of the rss links to the torrents that are missing in the saved file
- we again wget the .torrent files that diff returns and move them into our watcher folder.
Here’s the script in all it’s glory:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 | #! /bin/bash #set path for cron export PATH=/ffp/sbin:/usr/sbin:/sbin:/ffp/bin:/usr/bin:/bin count=0 feed=feedList.txt feedFolder="feeds" watchFolder="../watcher" # loop through the feed list while read line do let count++ echo -e "$count - $line" #look for saved file if [ ! `ls ./$feedFolder/$count.saved` ]; then #make it echo > ./$feedFolder/$count.saved echo "$count.saved doesn't exist, now creating" fi #update feed wget -O ./$feedFolder/$count.rss $line #get the diff and wget the torrents diff ./$feedFolder/$count.rss ./$feedFolder/$count.saved | grep -o '<link>[^"]*' | sed 's/<lin #diff ./$feedFolder/$count.rss ./$feedFolder/$count.saved | grep -o '<link>[^"]*' | sed 's/<li #move to watchfolder for transmission mv *.torrent $watchFolder #chown so that transmission can use those torrents chown -R nobody:501 $watchFolder/* #save the need feed for next run cp ./$feedFolder/$count.rss ./$feedFolder/$count.saved done <$feed |
The very last thing we need to do now is set up the cron to run this little gem on a daily basis:
1 | 0 0 * * * cd /mnt/HD_a2/Downloads/tvrss/; /ffp/bin/sh getTorrents.sh > /mnt/HD_a2/Downloads/tvrss/log 2>&1 |
If you want the code check it out here: http://code.google.com/p/transmission-tvrss/
You’ll also require you nas to have wget, diff installed on it. By default diff isn’t so you’ll have to dig around for 323 packages. I can’t remember off hand what i did to get it installed.
Iphone not connecting to wifi network linksys e3200
by sean villani on Jan.15, 2012, under Iphone Fun, Mac
I always seemed to have a weird issue with my wireless network and my iphone 3g and recently 4.
It would occasionally not connect to my wireless network. It was random and i seemed to fix it by restarting my linksys e3200 router. Restarting the Iphone didn’t solve the issue.
Here’s the fix:
Changing the Channel of the 2.4Ghz Wireless setting to channel 1 or 11, by default it’s Auto. As soon as i changed it the wireless on my iphone lit up and it hasn’t had that issue since.
I guess when i restarted the router it would reset the channel back to 1 which is why is would always work after the restart.
Magento Solr showing no results
by sean villani on Jan.05, 2012, under Magento, PHP
I ran into this issue when i was trying to plug in Solr with Magento 1.9 EE. It’s quite simple but if you have virtual inventory, meaning you’re not tracking stock you’ll run into the same issue that i had: NO RESULTS when searching from the UI.
As it turns out all you need to do to resolve the issue is to set “Display Out Of Stock Products” = yes on the Config->Inventory (under Catalog)->Stock Options. This will remove the in_stock:true param from all of your solr requests which will return results and save you from pulling your hair out.
Magento import csv issue
by sean villani on Mar.21, 2011, under Magento
I have an issue where i wanted to import (programmatically) a csv. So, i built a process that would transform my data into Magento csv, drop the file in the import folder and then i would run the “import all” process using wget to hit the page.
For some strange reason i kept running the script but it wouldn’t find the file. It kept looking for the imported file in a random folder: /var/tmp//magento/var/import. I searched through the code and couldn’t figure out why it was looking in that folder for my import folder. As it turns out one of the internal Magento configs was failling on the fact that my Magento/var folder wasn’t writeable, so it defaulted to /var/tmp//magento/var.
The obvious fix was to make my var folder writeable by Magento. Viola! working properly.
Xdebug on???
by sean villani on Mar.03, 2011, under Mac, PHP, Perplexed
I had an issue with thinking that xdebug wasn’t on or functioning properly on my mac osx 10.6. As it turns out it was my php.ini that was the problem.
Specifically, i was looking for the nice looking var dumps, error messages and stack traces that xdebug gives me.
After verifying, with phpinfo, that the xdebug module was in fact loaded. I found this little tidbit that solved my problem.
php.ini had the setting ‘html_errors’ set to off. After setting it to ‘On’, viola! Xdebug at it’s finest.
PHPUnit Head scratcher
by sean villani on Feb.18, 2011, under Random
I came across this while trying to develop on php 5.3.3.
1 | exception: Serialization of 'SimpleXMLElement' is not allowed |
After countless hours of banging my head against the wall the fix is to add the following 2 class variables to the construct of the extended PHPUnit_Framework_TestCase:
1 2 3 4 5 | public function __construct() { $this->backupGlobals = false; $this->backupStaticAttributes = false; } |
Disable Spotlight Search Mac OS X 10.6
by sean villani on Feb.11, 2011, under Mac
If you’re not a big fan of the Spotlight search for Mac OS X. Here’s how to turn it off:
Open the Terminal window from /Applications/Utilities/ and run the below command:
sudo mdutil -a -i off
To remove the Spotlight icon from the menu bar, run the below command in Terminal:
sudo chmod 600 /System/Library/CoreServices/Search.bundle/Contents/MacOS/Search
Then, run the below command to restart the menu bar:
killall SystemUIServer
In case, if you want to turn on the Spotlight, just run the below command:
sudo mdutil -a -i on
Use Quicksilver it’s dope! Unless anyone can suggest something better…
Jailbreak Iphone 3gs
by sean villani on Jan.08, 2011, under Iphone Fun
Trying to jailbreak and unlock and Iphone 3gs?? Here’s a quick how to…
What you’ll need:
Run redsnow and select the ipsw that works with your phone. Follow the redsnow instructions and VIOLA, cydia will be installed and you’ll have just jailbroken your Iphone.
Please note – i had some issues running it (redsn0w)on a machine with more than one processor. It kept getting stuck loading the ram disk. To prevent this:
- start redsn0w
- open windows task manager (as Administrator)
- find redsnow.exe
- right click on process and “Set Affinity” to CPU1
Gluten free sandwich meats
by sean villani on Dec.30, 2010, under Gluten Free
Since finding out about being gluten intolerant, an issue that i was fighting for years, i’ve had a hard time trying to finding sandwich meats that specifically say “gluten free” on the packaging. So i decided to go out on a limb a couple months back and try one that i’ve been eying for quite a while.
Maple Leaf has a “Natural Selections” line which i have tried and have no problems with. I prefer the ham, especially in the mornings with some eggs.
Now it doesn’t say Gluten Free on the package but i’ve had no problems with it.
Enjoy!
sfTaskExtraPlugin keeps me lazy
by sean villani on Nov.23, 2010, under 1.4, Symfony
So i just completed my first Symfony 1.4 plug-in: sfDoctrineRestBasicPlugin. It’s a rather simple plug-in but something that i was using as a private plug-in for some time. I decided that i would like to make a plug-in for Symfony and this was the best way to learn.
I’m not going to get into the full details of what i did. But i am going to promote another plug-in that helped me with the most mundane part of the whole process: building and packaging the tag as PEAR package syntax.
Essentially, you’ll need to add a couple things to your plug-in in order for the folks at Symfony to accept it:
- README – this gives information on your plug-in, what it does and how to install and use it.
- LICENSE – this is the license information that you define to any user that wants to use your plug-in. Essentially, this covers your ass if they try to blame you for your code ruining their business.
- package.xml – the PEAR package syntax info on your plug-in
Which brings me to the “meat and potato’s” of this post. I’m lazy and i was overwhelmed with one major thing in the package.xml structure. The <contents> node. Now what the Symfony community wants you to do is to define all of the files and folders that your plug-in uses. Like so:
<contents>
<dir name="/">
<file role="data" name="README" />
<file role="data" name="LICENSE" />
<dir name="config">
<file role="data" name="config.php" />
<file role="data" name="schema.yml" />
</dir>
<!-- ... -->
</dir>
</contents>Which is great for tracking what’s missing, etc… but let me tell you: like most programmers I’m terribly lazy. Too lazy to write xml on the 10-15 files and directories that i’d have to include in this content node.
Enter sfTaskExtraPlugin. This plug-in is a great Symfony command line tool that will take all the work out of publishing a plug-in. Especially generating the content node in the package.xml file. Just by running this from the Symfony command line:
1 | ./symfony plugin:package sfDoctrineRestBasicPlugin |
Thanks to Kris Wallsmith for writing such a useful plug-in that allows me to stay lazy!