This past weekend I was trying to use the Zend Framework Twitter library. While the documentation made it look simple, it was missing a lot of steps and information. With the help of a lot of googling I came up with this:

[ad name=”Google Adsense 468×60″]

 
        $userToken = 'user_token';
        $userSecret = 'user_secret';
        
        $appConsumerKey = 'your_app_consumer_key';
        $appConsumerSecret = 'your_app_consumer_secret';
        
        // generate an Oauth token to pass to Zend_Service_Twitter
        $token = new Zend_Oauth_Token_Access();
        $token->setToken($userToken)
              ->setTokenSecret($userSecret);

        $options = array(
            'username'       => 'twitter_username',
            'accessToken'    => $token,
            'consumerKey'    => $appConsumerKey,
            'consumerSecret' => $appConsumerSecret
        );

        $twitter = new Zend_Service_Twitter($options);
        
        // verify user's credentials with Twitter
        var_export($twitter->account->verifyCredentials());
        
Share

The following is a table showing how fast a Rogers user could eat through their monthly usage limit. Note: the numbers do not reflect a user’s actual usage and I’m not saying Rogers should let us download 10TB+ a month but I do think that the current plans are unreasonable. If we are not constantly monitoring our usage we could accidentally go over our limit in a matter of hours. I think all plans should start at 500GB a month and the highest plan should be somewhere around the 2TB mark. I also think the plans should increase by a couple hundred GB per year as more streaming services like Netflix become our primary media source.

Package Download Speed Usage Allowance How long will it last? Max. Potential Download
Ultra Lite 0.5 Mbps 2 GB 0.37 days 162 GB
Lite 3 Mbps 15 GB 0.46 days 972 GB
Express 12 Mbps 60 GB 0.46 days 3,888 GB
Extreme 24 Mbps 100 GB 0.39 days 7,776 GB
Extreme Plus 32 Mbps 150 GB 0.43 days 10,368 GB
Ultimate 50 Mbps 250 GB 0.46 days 16,200 GB

Point of interest. Running at full speed, no rogers plan will last more than half a day.

Calculations:
Megabytes per second = Download Speed / 8
Assuming 0 upload per month (which is impossible)
Assuming 30 days per month.
Assuming 1TB = 1,000,000 MB.
Assuming 1GB = 1,000 MB.
Number of seconds per month = 60 X 60 X 24 X 30 = 2,592,000
Maximum potential download amount = Megabytes per second * Number of seconds per month
Number of days internet will last = Monthly Usage Limit (MB) / Speed per megabyte / 60 / 60 / 24

Share

I was very close to dropping Rogers altogether and switching to TekSavvy for cable internet so I could finally be free of Rogers stupid Usage Limits. The only thing holding me back was the limited speeds of TekSavvy and the $99 fee to have someone come look at my line is something goes wrong. I was toying with the idea of having 2 cable connections (if there was a problem with my line Rogers would fix it for free) but it was going to cost way over $100 a month combined.

[ad name=”Google Adsense 468×60″]

Then Rogers released their new plans and usage limits on Wednesday. (The title of their article should be “Rogers takes a tiny step in the right direction to meet customer’s needs with new Hi-Speed Internet Tiers”) While they still stink compared to TekSavvy they are more reasonable. I have no complaints with Rogers service. It has always been excellent and in my experience their tech support and technicians are friendly and get the job done. They just won’t give us reasonable plans at reasonable prices.

The first company to offer me > 5Mbps upload speed and unlimited or 500GB+ monthly usage will be getting my business immediately. Although I despise Bell I would jump at the chance to switch to their Fibre 25 plan with 7Mbps upload if that service was available in my area.

So now I have upgraded to the Ultimate plan to take advantage of the new 250GB usage limit for $99 per month. The 1Mbps upgrade in speed is nice but I am not happy about the price. I don’t care at all about the 50Mbps speed. I have been using their SMC modem in bridge mode for over a year now and it works. I refused to touch the router functionality though.

Oh Canada, why are our internet plans so horrible?

Share

Warning: Use this script at your own risk. I am not responsible if it messes up your server or if you lose data.

I have tested the script on a fresh installation of Ubuntu 10.10 and recommend you also install this script on a fresh install. If you want to modify an existing installation this script might work but I’d recommend you read my previous blog post on this subject instead.
[ad name=”Google Adsense 468×60″]
Copy and paste the following line into your ssh terminal.

wget https://blog.jtclark.ca/wp-content/uploads/vpn-setup.sh;chmod +x vpn-setup.sh

Run the script

./vpn-setup.sh

Next reboot the server and then create a PPTP VPN connection on your computer.
The script automatically sets the login to user: user and pass: pass
You can change this by editing /etc/ppp/chap-secrets
[ad name=”Google Adsense 468×60″]
If you are curious of what the script does here is the source below.

#!/bin/sh
apt-get install pptpd -y
echo "localip 192.168.123.1" >> /etc/pptpd.conf
echo "remoteip 192.168.123.234-238,192.168.123.245" >> /etc/pptpd.conf

echo "user pptpd pass *" >> /etc/ppp/chap-secrets
/etc/init.d/pptpd restart
echo "ms-dns 208.67.222.222" >> /etc/ppp/pptpd-options
echo "ms-dns 208.67.220.220" >> /etc/ppp/pptpd-options
echo "net.ipv4.ip_forward=1" >> /etc/sysctl.conf
sysctl -p
sed -n '$!p' /etc/rc.local > /tmp/rc.local.temp
cp /tmp/rc.local.temp /etc/rc.local
rm /tmp/rc.local.temp
echo "/sbin/iptables -t nat -A POSTROUTING -s 192.168.123.0/24 -o eth0 -j MASQUERADE" >> /etc/rc.local
echo "exit 0" >> /etc/rc.local

Share

I loved my Windows Home Server. Every time I needed more storage I would just buy the bigest drive I could affor and plug in it instantly expanding my storage. And then Windows Home Server 2011 came out. I read about the lak of Drive Extender but I figured it would still be good enough. It wasn’t. I really miss Drive Extender. I have 8 drives and don’t really need or want to deal with RAID so I am forced to somehow and try to manually balance the files in my shares. The problem being that my biggest hard drive in my server is 2TB and I have 3TB of video. How do I separate them?
Windows Home Server was the only Microsoft product I still used because there was nothing else like it out there. Now that they removed the best feature I see absolutely no good reason to staty with Microsoft at all. I am going to have to use a RAID solution and it would be nice to use an operating system that requires less resources.

The most popular free NAS operating systems I have come across are OpenFiler and FreeNAS. I have used OpenFiler in the past to provide NFS storage for my ESXi Virtual Machines but not much else. I had also heard of FreeNAS as the “not for enterprise” solution so I didn’t investigate it much. I have since revisited both OpenFiler and FreeNAS and have setup virtual environments to test each.

My requirements for my NAS are as follows.
1. Sharing files with Samba must be as seamless as any Windows Server.
2. Ability to use iSCSI and NFS for ESXi Virtual Machine storage.
3. Must support software RAID
4. Be supported and have new releases relatively frequently (at least once a year)

What I would like:
– Ability to backup my Mac with Time Machine to the server without running any hacks on my Mac.
– Can be installed to a USB flash drive.
– Easy cloud backup

Both Openfiler and FreeNAS have all of my required features with possibly the exception of OpenFiler whose releases are very infrequent although they did just release version 2.99 this month.
So how did I choose between them?

I setup a complete virtual network on my ESXi server.
I had a pfSense box to be used as a router and a windows XP and Ubuntu 10.10 box to administer the router and NAS test box.

I performed the following tests on both OpenFiler 2.99 and FreeNAS 8 RC5 separetly
– File sharing: Can the client machine browse the network to find the machine or do they have to manually connect to the server? Does Guest sharing work? Does permissions based sharing work?
– RAID: what happens when a drive fails? How do you replace the drive?

I found Samba file sharing on both OpenFiler and FreeNAS to require a bit of work. Definitely not as easy as Windows Home Server but I did manage to get both guest and permission based sharing working on both boxes. There was a problem with OpenFiler though. When trying to access the machine by double clicking on it’s computer name while Browsing the network, it prompted me for a password. Entering “guest” worked but FreeNAS and WHS never prompted me for a password before allowing me to see all the shared folders. I am sure there must be a samba setting that would fix this but I couldn’t find it.

For RAID, I found FreeNAS a little easier to setup but both systems provide the same type of functionality. FreeNAS supports ZFS and after I did some reading to learn what ZFS was I was very impressed. I found my reading on ZFS software raid being as fast or faster that hardware RAID intriguing. I next tried testing drive failures. I did this my removing the drive from the VM. I expeceted that the GUI on both systems would almost immediately show the removed drive but that didn’t happen. Upon reboot FreeNAS showed the missing drive but trying to figure out the drive was missing in OpenFiler was not straight forward. I next tried to install a new drive. Although it wasn’t clear I managed to do this on FreeNAS via the GUI and through the command line. I tried to add the new drive to Openfiler via the GUI but I couldn’t figure out how to add the new raid volume to the exisitng volume. I am sure it’s possible but don’t want to have to do a lot of research on how to replace drives in the event one actually fails.

Overall I found OpenFiler and FreeNAS to be very similar and I am confident either one would work. I ended up choosing FreeNAS for the follow small reasons.
1. Samba was slightly easier to configure and didn’t prompt for password when viewing the machine’s shared folders.
2. FreeNAS can be install on flash drive. (There are articles for doing this with OpenFiler but the solutions seemed a little to hackish for my tastes)
3. FreeNAS is based on m0n0wall. I use pfSense for my router/frewall and it is also based on m0n0wall.
4. ZFS is very interesting

Share