ichi.co.uk

Bypassing the UK Pirate Bay Blocks via Proxies/Mirrors and VPNs

I would like to start by pointing out that I’m not endorsing copyright infringement with this post, however The Pirate Bay has a massive amount of totally free downloads, from music promos to open source software, which the music and movie lobby groups have managed to get blocked in the UK courts (just ISPs Virgin Media, TalkTalk, O2, BT, Everything Everywhere) and I believe in a free and open internet. That being said, I’d also like to point out that infringement is not the same as theft, no matter how many times they tell you illegal downloading is ‘stealing’. I believe that until they give people reasonably priced, easy to access to TV shows and movies on demand, piracy is only going to keep getting more and more prevalent.

I won’t stay with an ISP that censors the internet, until I’m out of reasonable choices. I’m currently contracted to Virgin Media (because 100 meg), but I will switch to a fibre connection from a smaller ISP that hasn’t been forced into censorship by the BPI and company.

The craziest thing about all this for me is the fact that this has given The Pirate Bay a free massive profile boost via what is known as the Streisand effect.

The easiest option is to simply bypass the blocks with a mirror/proxy site. Here is a list of such sites that are tested to currently work on Virgin Media (and should work on all other UK ISPs): 

  1. https://tpb.pirateparty.org.uk/
  2. https://piratereverse.info/
  3. http://www.pirateproxy.net/
  4. Google Translate
  5. http://thepiratebay.se.proxy.piratenpartij.nl/
  6. Yahoo Babelfish Translate
  7. http://piratebay.org.nyud.net
  8. http://labaia.ws/
  9. http://tpb.europeancensorship.eu/nph-tpb.cgi/http/thepiratebay.se/
  10. http://all4xs.net/repress/thepiratebay.se
  11. http://freedomto.us/

Other sites that you shouldn’t use:

  1. alt.ragerik.info - Doesn’t work properly
  2. thepiratebay.ee - DO NOT USE. It is a scam site.
There is also a guide on how to make your own TBP proxy here. I’d also like to point out that you shouldn’t try to login via a TBP proxy site, as your username and password could be captured. If you do want to attempt to login to your account you should use a unique password that you only use on TBP.

By far my favourite in that list is Google Translate which you can just use as a fast, advert free, web proxy. Using something as simple as Google Translate to bypass a court-ordered block of The Pirate Bay made me chuckle. Another good tip is that you can just add .nyud.net to any URL to access it via the proxy, so http://thepiratebay.se becomes http://thepiratebay.se.nyud.net.

A reader called amity19 left a comment on this post pointing out that you can use the Opera web browser’s turbo feature to access The Pirate Bay and other blocked sites, as it routes all the requests via Opera’s servers for optimisation. To enable it, just go to Preferences > Webpages > Opera Turbo and enable it. It’s a  handy feature and seems to work well.

You can also configure your web browser to use an HTTP or SOCKS proxy quite easily and there is a list of free proxies here and here. For the more technically inclined, I wrote a guide a while ago that tells you how to setup an anonymous Squid proxy on Debian linux, so you could get yourself a Virtual Private Server in another country and use that. A much more simple option however is to SSH to a computer in a country where it isn’t blocked. There is an easy to follow guide on how to do that here

The above list will give you access to The Pirate Bay from UK ISPs, however if you really value your privacy, the best option is to use a VPN. You can download your torrents via this anonymously as well as broswing the site. If you want to be even more anonymous you can also use a pre-paid credit card to pay for them (to protect your privacy). There is a list of VPN providers here, however iPredator is operated by The Pirate Bay themselves and a good option. There are also free services such as VPNReactor, which will give you 30 minutes free per connection, which should be plenty of time to find the magnet link to download the latest music promo, etc.

To go one better than a VPN for downloading, use a Seed Box (more info here).

There is also a petition against the censorship of The Pirate Bay, here.

Free Ray-Bans page on Facebook

My feed was full of people sharing and liking a Free Ray-Bans page today. The page is at ‘s3.amazonaws.com/fulluse/raybans.html’ and the code is very simple. It has a count-down of the number of Ray-Bans they have left which starts at a fixed value such as 973. If you click ‘like’ then ‘share’ as it instructs it’ll just redirect you to the spammers survey affiliate partners, the link is ‘jmp.realtraq.net/aff_c?offer_id=6114&aff_id=3358’.

Basically, this is just spam, ignore it and warn others that they probably want to unlike the page.

Another address for the page (which just redirects to the address above) is: ‘s3-us-west-1.amazonaws.com/rayban99/8.html

[Flash 9 is required to listen to audio.]
edit:four - iamichi

211 plays

edit:four

by iamichi

My latest downtempo DJ mix.

Cross Domain Visual Studio 2010 Remote Debugging

Some software I wrote a while ago had a feature break on a single machine, so I needed to remotely debug it today. I have VPN access but my development VM isn’t a member of their domain, which causes an authentication error when you try to connect to the remote machine. To remedy this you need to complete a few steps.

Prepare The Remote Computer

If you haven’t done already, download and install the Microsoft Visual Studio 2010 Remote Debugger on the remote machine. 

You’ll also need an account with administrator permissions on the remote machine, so if you don’t have a domain admin account, you’ll need to make your domain user an administrator on the remote machine (which you can do in Control Panel > Users > Add).

Log onto the remote machine as your user and make sure the Visual Studio 10 Remote Debugger service is started in services.msc, then fire up the Visual Studio Remote Debugging Monitor (on Windows XP this is at C:\Program Files\Microsoft Visual Studio 10.0\Common7\IDE\Remote Debugger\x86\msvsmon.exe) and it should say something like “Msvsmon started a new server named ‘my-domain\user@computer’, note down the last part.

Setting Up Your Development Computer

My dev VM is Windows 7, so that is what I’ll detail here. Firstly, if you can’t ping the remote machine name because it won’t resolve you’ll need to add an entry with it’s IP to your hosts file (C:\windows\System32\drivers\etc\hosts).

Go to the Control Panel > User Accounts and Family Safety > Credential Manager. This can also be accessed via the Run dialog from the start menu and entering “Control Userpasswords2”. Select the Advanced tab and select Manage Passwords.

Click Add a Windows credential and enter the name of the remote computer that you took from Msvsmon. Enter your username including the domain, such as ‘my-domain\user’ and your password.

An easy way to test if this works is to browse the remote computer in Windows Explorer. If you’re not prompted for a username and password the saved credentials are working.

You can now connect to the remote machine in Visual Studio by entering it’s name in the Attach To Process dialog.

That should be it and now you should be able to attach to any process on the remote machine. I hope that helps.

Storage Helper for WinRT (Win8 Metro) in C#

Windows 8 Metro Storage Helper

I’m currently coding a Windows 8 Metro app version of a Windows Phone 7.5 Mango app I previously made. There are quite a few differences in the code and one of the first stumbling blocks I hit was the lack of Isolated Storage in WinRT. There are some ways of making shared libraries compatible,  but I wanted to learn the new ways of doing things. One of the things I need to do is store POCOs to storage for caching and while having a quick search to see if someone had any examples, I came across Generic Object Storage Helper for WinRT by Jamie Thomson, which was a great help. The code is out of date now however as it was written for the Developer Preview and I’m coding against the Consumer Preview. Also the example also isn’t quite what I wanted as I want to be able to pass in a file-name each time, so I decided to modify and fix the code as well as make some changes to make it the way I like.

Here is my updated version of the class:

using System;
using System.IO;
using System.Threading.Tasks;
using System.Xml.Serialization;
using Windows.Storage;
using Windows.Storage.Streams;

namespace MyWinRTApp
{
    public enum StorageType { Local, Temporary, Roaming }

    class IsoStorage<T>
    {
        private ApplicationData appData = Windows.Storage.ApplicationData.Current;
        private XmlSerializer xmlSerializer;
        private StorageFolder storageFolder;
        private StorageType storageType;
        public StorageType StorageType {
            get { return storageType; }
            set
            {
                storageType = value;
                // set the storage folder
                switch (storageType)
                {
                    case StorageType.Local:
                        storageFolder = appData.LocalFolder;
                        break;
                    case StorageType.Temporary:
                        storageFolder = appData.TemporaryFolder;
                        break;
                    case StorageType.Roaming:
                        storageFolder = appData.RoamingFolder;
                        break;
                    default:
                        throw new Exception(String.Format("Unknown StorageType: {0}", storageType));
                }
            }
        }

        public IsoStorage() : this(StorageType.Local) {}
        public IsoStorage(StorageType type)
        {
            xmlSerializer = new XmlSerializer(typeof(T));
            StorageType = type;
        }

        /// <summary>
        /// Saves a serialized object to storage asynchronously
        /// </summary>
        /// <param name="filename"></param>
        /// <param name="obj"></param>
        public async void SaveAsync(string fileName, T data)
        {
            try
            {
                if (data == null)
                    return;
                fileName = AppendExt(fileName);
                var file = await storageFolder.CreateFileAsync(fileName, CreationCollisionOption.ReplaceExisting);
                var writeStream = await file.OpenAsync(FileAccessMode.ReadWrite);
                var outStream = Task.Run(() => writeStream.AsStreamForWrite()).Result;
                xmlSerializer.Serialize(outStream, data);
                writeStream.Dispose();
            }
            catch (Exception)
            {
                throw;
            }
        }

        /// <summary>
        /// Delete a file asynchronously
        /// </summary>
        /// <param name="fileName"></param>
        public async void DeleteAsync(string fileName)
        {
            try
            {
                fileName = AppendExt(fileName);
                var file = await GetFileIfExistsAsync(fileName);
                if (file != null)
                    await file.DeleteAsync();
            }
            catch (Exception)
            {
                throw;
            }
        }

        /// <summary>
        /// At the moment the only way to check if a file exists to catch an exception... :/
        /// </summary>
        /// <param name="fileName"></param>
        /// <returns></returns>
        private async Task<StorageFile> GetFileIfExistsAsync(string fileName)
        {
            try
            { return await storageFolder.GetFileAsync(fileName); }
            catch
            { return null; }
        }

        /// <summary>
        /// Load a given filename asynchronously
        /// </summary>
        /// <param name="fileName"></param>
        /// <returns></returns>
        public async Task<T> LoadAsync(string fileName)
        {
            try
            {
                fileName = AppendExt(fileName);
                StorageFile file = null;
                file = await storageFolder.GetFileAsync(fileName);
                IRandomAccessStream readStream = await file.OpenAsync(FileAccessMode.Read);
                Stream inStream = Task.Run(() => readStream.AsStreamForRead()).Result;
                return (T)xmlSerializer.Deserialize(inStream);
            }
            catch (FileNotFoundException)
            {
                //file not existing is perfectly valid so simply return the default 
                return default(T);
                //throw;
            }
            catch (Exception)
            {
                //Unable to load contents of file
                throw;
            }
        }

        /// <summary>
        /// Appends the file extension to the given filename
        /// </summary>
        /// <param name="fileName"></param>
        /// <returns></returns>
        private string AppendExt(string fileName) {
            if (fileName.Contains(".xml"))
                return fileName;
            else
                return string.Format("{0}.xml", fileName);
        }
    }
}

It seems that at the moment, there is no way to check if a file exists without using a try/catch block, but I expect that will be sorted in the final release. 

Saving an Object

Saving a POCO (any serializable object) is as simple as:

            var forecast = new Forecast { Date = DateTime.Now, Type = FeedType.Daily };
            var isoStorage = new IsoStorage<Forecast>(StorageType.Local);
            isoStorage.SaveAsync("daily", forecast);

You could also save a generic list by doing something like

            var isoStorage = new IsoStorage<List<Forecast>>(StorageType.Local);

Retrieving an Object

Retrieving a POCO is equally easy:

            var isoStorage = new IsoStorage<Forecast>(StorageType.Local);
            Forecast forecast = await isoStorage.LoadAsync("daily");

I hope that helps someone. Please feel free to leave feedback or comments below. Big thanks go out to Jamie Thomson for the initial code that I modified.

SqlException: Execution of user code in the .NET Framework is disabled

We just migrated Kick News to new SQL Server 2008 database servers, everything went fine, but I’d missed one thing before we bought it back up and we were receiving the error “SqlException: Execution of user code in the .NET Framework is disabled”.

It was an easy and very quick fix. Just run this and you should be fine again…

sp_configure 'show advanced options', 1;
GO
RECONFIGURE;
GO
sp_configure 'clr enabled', 1;
GO
RECONFIGURE;
GO

For further details see here

An error occurred uploading to the itunes store

I’ve just spent the last 2 hours trying to upload an updated iOS app to Apple. Using Xcode Organiser, I’d get the message “An error occurred uploading to the itunes store” then it’d show me “Validation failed”. I successfully submitted an update for the same app a few days ago but had to reject the binary, so this was a little strange.

After failing numerous times and trying a few things, I went to Organiser, right clicked my archive and selected “Show in finder”, then right-clicked the xcarchive file and selected ”Show Package Contents”, compressed the .app file and uploaded it with the Application Loader (/Developer/Applications/Utilities/Application Loader.app). The first time it failed and I got the message that the validation failed due to “The app references non public selectors: multitaskingSupported”. That was easy to fix by just updating to the latest version of Appirator, however after that I was still getting a very generic error message about it failing.

The only thing I’ve changed with my system since I last submitted the app is that I installed some OS X updates, one of which was “Java for Mac OS X Lion 2012-001”. I know the app submission software uses Java, as I’ve seen it ask me for permission for something about allowing Java to accept remote connections while uploading an app. I remembered that I hadn’t rebooted since I installed the update, so I tried that, but still no luck. 

In the end, I got fed up of wasting a so much time trying to work it out, so I pushed my changes to my git repository on my desktop machine (OS X 10.7), pulled them on my laptop (OS X 10.6) and it submitted first time directly from Organiser. I can see update “Java for Mac OS X 10.7 Update 7” waiting to be installed on that, which I’m slightly hesitant to install now.

I’m kind of frustrated I don’t have an answer to the problem and will look into it a bit more when I have more time, but using a different machine to submit it is a good option if you’re up against it. 

Update

It seems this was an issue with Java. I have since installed another Java update, rebooted and that fixed the issue. 

Add a virtual directory to multiple sites in IIS 7.x using PowerShell.

Someone needed to add virtual directory to a few dozen sites in IIS, so I wrote them a little script to do it. To use it save the code below as something like ‘CreateVirDirs.ps1’, open a Powershell prompt with administrator rights, cd to the directory you saved it in and then execute it with .\CreateVirDirs.ps1

Import-Module WebAdministration

$sites = Get-Childitem 'IIS:\Sites'
$name = "NewVirtualDirectory"
$vdPath = "D:\Temp"

foreach ($site in $sites) {
    $path = 'IIS:\Sites\' + $site.Name + '\' + $name
    New-Item $path -type VirtualDirectory -physicalPath $vdPath
    Write-Output $path
}

You should get output like:

PS D:\> .\CreateVirDirs.ps1

Name                                                        PhysicalPath
----                                                        ------------
NewVirtualDirectory                                         D:\Temp
IIS:\Sites\Default Web Site\NewVirtualDirectory
NewVirtualDirectory                                         D:\Temp
IIS:\Sites\www.ichi.co.uk\NewVirtualDirectory
NewVirtualDirectory                                         D:\Temp
IIS:\Sites\Some Other Site\NewVirtualDirectory

That will add the virtual directory to every site in IIS, but you can limit it quite easily which is explained here. If you get an error due to not having the WebAdministration module, this might be of some use. Hope that helps!