How to fix XBMC that quits on Apple TV 2G and disable updates
If you have NitoTV installed there is a very simple solution:
1. NitoTV>Settings>Update NitoTV
2. NitoTV>Settings>Reboot
3. NitoTV>Install Software> updatesBeGone
4. NitoTV>Settings>Reboot
Silly message will go away
How to change time zone on Apple TV 2G
On the jailbreaked Apple TV 2 login as root using ssh.
find / -name localtime
it should come up with
/private/var/db/timezone/localtime
now got to this directory
cd /private/var/db/timezone/
remove link
rm localtime
and create new one for example in my case Madrid.
ln -s /usr/share/zoneinfo/Europe/Madrid localtime
to get your time zone
check what’s available in
cd /usr/share/zoneinfo/
Reboot and that should be it.
Apple TV 2 XBMC installation dkg was interrupted, you must manually run dpkg –configure –a to correct the problem
In the artice below I described how to install XBMC on Apple TV 2.
Some users reported errors while installing XBMC on Apple TV 2.
In the step 5 where we go to NitoTV > Install Software > XBMC-ATV2
Apple TV 2 downloads XBMC, reboots and XBMC does not appear in the menu or this error appears:
E: dkg was interrupted, you must manually run ‘dpkg –configure –a’
To correct the problem follow these steps:
1. Find out the IP address of the APTV2 in Settings >Network
2. If you are on Windows download Putty http://the.earth.li/~sgtatham/putty/latest/x86/putty.exe (it is ssh client)
3. Launch Putty and in Host Name (or Ip Address) enter the IP address of Apple TV 2 for example 192.168.1.24
4. If you get message about encryption click Yes
5. You will get login screen. As user type in root and as password alpine
6. Launch the following command:
apt-get install wget wget -O- http://apt.awkwardtv.org/awkwardtv.pub | apt-key add - echo "deb http://apt.awkwardtv.org/ stable main" > /etc/apt/sources.list.d/awkwardtv.list echo "deb http://mirrors.xbmc.org/apt/atv2 ./" > /etc/apt/sources.list.d/xbmc.list apt-get update apt-get install org.xbmc.xbmc-atv2
If by any chance you get error exit status 1
1. Run commands:
apt-get remove org.xbmc.xbmc-atv2 apt-get install org.xbmc.xbmc-atv2 --fix-missing
2. XBMC should appear in Apple TV 2 Menu.
If you still get the problem the best idea is to do Restore thorugh iTunes and start the process again.
For some reason restore and installation worked for many.
Good Luck
Cheap Multiroom Media Center System with Apple TV and XBMC
Many people look for cheap multiroom media solutions. There are many options. In this article I would like to share what media center system I have built and how reliable it has been so far.
Firstly, I started with my living room. I’ve already had plasma TV and audio amplifier with 5.1 speaker system. All I needed was some sweet media center and storage for my films, music and pictures. As storage I went for NAS Storage Synology DS110j. Honestly, forget NAS systems from WD, LinkStation and Netgear. I have read a lot of comments about NAS products before buying one and a lot of people always had some problems with these.Synology though has good reputation amongst its users and there is no mistake – this product is great!I bought 2TB hard drive and installed it in the NAS. Created shares and uploaded content to it.
What about media center? Well, I’ve always been big fan media center software and I have tried few. At the begging I had PC with Windows Media Centre 2005 hooked up to the TV. Not a good solution. Big case and fan noise. Also, I didn’t like Windows Media Centre. It didn’t support many file formats, subtitles and I got windows errors while watching films too many times. I moved to XBMC and it became my best friend!. I strongly recommend trying it. It has so much to offer!
What most I like about it is:
- haven’t found video or audio format xbmc doesn’t support
- multiple subtitles in various formats
- allows me to add content from various sources : windows and linux shares , UPnP AV ….
- choice of skin
- allows me to stream content directly from internet (youtube, megavideo)
Some months later I took PC out and put first generation of Xbox with XBMC on it. I didn’t have to wait for PC to boot up and shutdown anymore. Xbox was ready in about 5 seconds and I could just shut it down with 1 button click just as DVD player. It served me well until I got Apple TV 2 and installed XBMC on it.
This is what I came up with:

And what you get is this:
Here are links where you can buy this stuff:
Synology DS110j
http://www.amazon.co.uk/Synology-DS110j-Disk-Station-Enclosure/dp/B002U42XD6/ref=sr_1_1?ie=UTF8&qid=1297860833&sr=1-1
Seagate 2TB hard drive
Apple TV
Here you can learn how to install XBMC on Apple TV 2
Apple TV 2 Untethered Jailbreak on Windows and XBMC media centre installation
Yesterday I got a new Apple TV 2 as a birthday gift and I decided to stick XBMC media centre on it since I already have one on the first generation of Xbox. I thought that would be perfect fanless replacement.

I read a lot of post how to jailbreak it with Pwnage Tool and Seas0nPass but all these methods have two huge disadvantages.
1. These programs come only for Mac computer for now. (I don’t have one)
2. They are tethered, which means everytime you shutdown Apple TV you will have to connect it to the Mac to boot it in jailbreaked mode.
I found little program that is called GreenPois0n and it comes for Mac, Linux and Windows and very little reference on the internet on how to use it. I thought I will give it a go. Program can be downloaded here: http://greenpois0n.com/
What you need:
1. Micro USB cable – unfortunately it is not supplied with Apple TV 2 so you need to get one or ask your friends. I had one as it came with my Blackberry.
2. iTunes software on your computer. http://www.apple.com/itunes/
3. GreenPois0n program http://greenpois0n.com/ (latest version RC6)
4. Find out which version your Apple TV 2 is running (Settings > General > About) Ideally should be 4.1.1. Mine came with 4.1 and I had updated it via iTunes to 4.1.1
UPDATE: 06.04.2011
If you have version 4.1 update your Apple TV with this firmware http://appldnld.apple.com/AppleTV/061-8940.20100926.Tvtnz/AppleTV2,1_4.1_8M89_Restore.ipsw
as doing it via iTunes now will update to 4.2.1.
If you already have 4.2.1 do not upgrade or downgrade. Just follow instructions below. I haven’t tested it but apparently it works.
Ok let’s do the magic:
Important! I do not take responsibility to any damage you do to your Apple TV 2. Remember, you are doing it at your own risk.
*It is highly unlikely to brick it or break it. Never heard of anyone messing up Apple TV 2 yet. You can always restore the firmware to its original state through iTunes.
1. Unplug all cable from Apple TV 2
2. Run the GreenPois0n program and follow instructions



If Jailbreak! button is not active that means you failed to put Apple TV 2 in DFU mode. Try again. When Apple TV 2 goes into DFU mode the LED light on the front panel flashes rapidly. Make sure that your timing is ok. I managed to put it in DFU mode on 3rd attempt.

3. Once GreenPois0n is done. Disconnect it and hook it back to your TV.
*When I did mine for the first time it didn’t boot properly. I have noticed that before jailbreaking my version was 4.1. I connected Apple TV 2 back to my PC and did the Restore process through the iTunes. Restore process updated latest Apple TV 2 firmware to 4.1.1. I run Green Pois0n again and it did work.
* Although I haven’t experienced any problems and all worked well once I had 4.1.1 user Fluxx has recommended to wait 40 seconds after the jailbreak is done.
4. Now you should get this option:

5. Click on Inject Software and than Install . Your Apple TV 2 will automatically restart and you will get this new menu item called NitoTV. Select NitoTV and in the submenu select Install Software. Find XBMC-ATV2 and hit install it.

6. It will automatically download and install XBMC. After install Apple TV 2 will automatically reboot.
* If you don’t see XBMC in menu option after the installation.
Reboot Apple TV 2 and install again.
It happend to me while jailbreaking aptv2 of one of my friends. If you still get the problems such as:
E: dkg was interrupted, you must manually run ‘dpkg –configure –a’ to correct the problem


Skins I have tried that work well on Apple TV 2:
Alaska Revisited
Night
I will be trying to install these too:
Rapier – I used to use in XBMC on my xbox – very responsive
Aeon – my favorite
* You can also log in via SSH to your Apple TV2 ![]()
1. Find out what IP is assigned to the box: Settings >Network

2. Use program such as Putty http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html to login

Username: root
Password: alpine
*Also since the TV I hooked up Apple TV 2 to doesn’t have HDMI input I used a converter from HD Fury (version 1) to convert HDMI to VGA. It works perefectly without any additional power supply.

UPDATE: 21.03.2010
Solutions to some common problems:
1. Changing time zone / setting up date and time:
http://arturito.net/2011/03/21/how-to-change-configure-time-zone-on-apple-tv-2g-xbmc-time/
2. XBMC exiting/crashing is due to the Apple TV 2 updates
This fixes it and gets a rid off the annoying update prompt.
http://arturito.net/2011/03/21/how-to-fix-xbmc-that-quits-exits-on-apple-tv-2g-disable-update/
Good Luck!!!
ASP.NET MVC2 jQuery Form Post with JSON Tutorial
In one of the previous post I covered how to post form with ASP.NET MVC2 using jQuery.
Today I will explain how to return data in JSON format. Why return data in JSON format. Well there are several reasons for it:
1. You can easily update several parts of the page without reloading entire page
Imagine that you have ajax login and after successful login the name of the user is updated in the header of the page and content of the saved cart in the right column.
2. It reduces the amount of data sent from the server to the browser.
In a lot of cases developers send data wrapped in html such as:
return Content(“<p class=\”mark-it-green\”>You submitted: “ + data.FirstName + ” “ + data.LastName +“<p>”);
or they send PartialView. But the idea of JSON is to send data only without html tags, which also reduces the traffic.
3. It separates application logic from design
Sending only data using JSON means data doesn’t have to be wrapped in html tags in your controller, you only send pure data. This way one developer can concentrate on developing logic and doesn’t have to think how it will be displayed, leaving web designer to handle presentation part.
Let’s start modifying previous project:
1. Open MVC2JQuery project that can be downloaded here MVC2JQuery at MediaFire
2. Open RegisterViewModel and modified it as below:
public class RegisterViewModel
{
public string FirstName { get; set; }
public string LastName { get; set; }
public int NumberOfPosts { get; set; }
public string LastPost { get; set; }
}
3. Open HomeController and make changes as shown below:
[HttpPost]
public ActionResult Index(RegisterViewModel data)
{
// here you can save data to database
// and return some feedback to the user
data.NumberOfPosts = 5;
data.LastPost = “This is my last post”;
if(Request.IsAjaxRequest())
return Json(data); // here data object is being converted to JSON format
else
return Content(“Please enable JavaScript”);
}
4. Also modify Views/Index accordingly
In the <head> part:
<script type=”text/javascript” src=”<%=Url.Content(“~/Scripts/jquery-1.4.4.min.js”)%>“></script>
<script type=”text/javascript” src=”<%=Url.Content(“~/Scripts/jquery.form.js”)%>“></script>
<script type=”text/javascript”>
$(document).ready(function() {
var options = {
beforeSubmit: showRequest, // call this function before sending data to the server
success: showResponse, // call this function once we have a response form the server
type: ‘post’,
dataType: ‘json’, // important! expecting data type is JSON
resetForm: true
};
$(‘#form-user’).ajaxForm(options);
});
function showRequest(formData, jqForm, options) {
$(“#result-user”).empty().html(‘Loading….’); // display loading
$(“#form-user :input”).attr(“disabled”, true); // disable inputs
}
function showResponse(data, statusText, xhr, $form) {
$(“#result-user”).empty();
$(“#form-user :input”).attr(“disabled”, false);
// here ‘data’ is an object. See below how it is used:
$(“#welcome”).html(“Hello, “ + data.FirstName + ” “ + data.LastName);
$(“#number”).html(“Number of posts: “ + data.NumberOfPosts);
$(“#lastpost”).html(data.LastPost);
}
</script>
In the <body> part:
<body>
<% using (Html.BeginForm(“Index”,“Home”,FormMethod.Post, new { id=“form-user”, name=“form-user”})) {%>
<div style=”float:left” id=”welcome”></div>
<div style=”float:right” id=”number”></div>
<div style=”clear:both;“></div>
<fieldset>
<legend>Fields</legend>
<div class=”editor-label”>
<%= Html.LabelFor(model => model.FirstName) %>
</div>
<div class=”editor-field”>
<%= Html.TextBoxFor(model => model.FirstName) %>
<%= Html.ValidationMessageFor(model => model.FirstName) %>
</div>
<div class=”editor-label”>
<%= Html.LabelFor(model => model.LastName) %>
</div>
<div class=”editor-field”>
<%= Html.TextBoxFor(model => model.LastName) %>
<%= Html.ValidationMessageFor(model => model.LastName) %>
</div>
<p>
<input type=”submit” value=”Save” />
</p>
</fieldset>
<% } %>
<div id=”result-user”></div>
<div style=”border:solid 1px #ccc;margin:10px;“ id=”lastpost” ></div>
</body>
5. And we are done! Hit F5 and see result:


Here you can download complete source code: http://www.mediafire.com/?ul8wl6o2fe47qk4
Good Luck!
Funny SQL jokes
Just a bunch of sql jokes that I found on the net and I thought they are funny.CREATE PROCEDURE MyMarriage BrideGroom Male (25) , Bride Female(20) AS BEGIN SELECT Bride FROM india_ Brides WHERE FatherInLaw = 'Millionaire' AND Count(Car) > 20 AND HouseStatus ='ThreeStoreyed' AND BrideEduStatus IN (B.TECH ,BE ,Degree ,MCA ,MiBA) AND Having Brothers= Null AND Sisters =Null SELECT Gold ,Cash,Car,BankBalanceFROM FatherInLaw UPDATE MyBankAccout SETMyBal = MyBal + FatherInLawBal UPDATE MyLockerSET MyLockerContents = MyLockerContents + FatherInLawGold INSERT INTO MyCarShed VALUES('BMW') END GOThen the wife writes the below query:DROP HUSBAND; Commit;A SQL query goes into a bar, walks up to a table and asks 'May I join you?SELECT * FROM politicians WHERE clue > 0; SELECT finger FROM hand WHERE id=3; SELECT * FROM girls WHERE freesex = True;
Publishing ASP.NET MVC2 Application on Windows Server 2008 IIS 7 with Visual Studio 2008 on platform .NET 3.5 SP1
Prepare you server:
1. Go to Server Manager and select Add Roles, and install Web Server



2. Mark ASP.NET and install



3. Confirm the CLR of ASP.NET has been installed

4. Install .NET Framework 3.5 and .NET Framework 3.5 SP1

5. Let’s create a directory where we stick our MVC2 application. In my case it is C:\www\windows.amk
6. Once you are done go to the Security properties of that directory and add read and write permissions for group IIS_IUSRS

7. Go back to IIS Manager and Add Site


8. In Application Pool double click pool of your site and make sure that Managed pipeline mode is Integrated


Now the server is prepared to run MVC2 web application!
Prepare your project to be published
1. Go to your project properties and mark Release

2. Go to References and and change Property Copy Local to true for
System.ComponentModel.DataAnnotations.dll
System.Web.Mvc.dll


If you are running .NET Framework 3.5 NOT .NET Framework 3.5 SP1 change properties for all these.
System.ComponentModel.DataAnnotations.dll
System.Web.Abstractions.dll
System.Web.Mvc.dll
System.Web.Routing.dll
6. In Web.config change lines
<compilation debug="true">
to
<compilation debug="false">
And uncomment this bit:
<customerrors mode="RemoteOnly" defaultredirect="GenericErrorPage.htm">
<error statuscode="403" redirect="NoAccess.htm" />
<error statuscode="404" redirect="FileNotFound.htm" />
</customerrors>
7. Generate and upload files to directory on the server in my case c:\www\windows.amk
* What we need:
- Configuration and settings files (e.g., Web.config and any *.settings files)
- Uncompiled view templates (*.aspx, *.ascx, and *.Master)
- Global.asax (this tells ASP.NET which compiled class represents your global HttpApplication)
- Any static files (e.g., images, CSS files, and JavaScript files)
- Optionally, the *.pdb files in your \bin folder, which enable extra debugging information (these are rarely deployed to production servers)
* We don’t need:
- C# code files (*.cs, including Global.asax.cs or any other ‘code behind’ files)
- Project and solution files (*.sln, *.suo, *.csproj, or *.csproj.user)
- The \obj folder
- Anything specific to your source control system (e.g., .svn folders if you use Subversion, or the .hg or .git folders if you use Mercurial or Git)

Good Luck!
ImageMagick PHP Image Resizing Imagick with Canvas
<?php
try{
$width = 60;
$height = 60;
$image = 'ct.jpg';
$im = new Imagick($image);
$im->thumbnailImage($width, null );
$canvas = new Imagick();
$canvas->newImage($width, $height, 'white', 'jpg' );
$geometry = $im->getImageGeometry();
/* The overlay x and y coordinates */
$x = ( $width - $geometry['width'] ) / 2;
$y = ( $height - $geometry['height'] ) / 2;
/* Composite on the canvas */
$canvas->compositeImage( $im, imagick::COMPOSITE_OVER, $x, $y );
/* Save image */
$canvas->writeImage( 'ct_th.jpg');
/* Output the image*/
header( "Content-Type: image/jpg" );
echo $canvas;
}
catch(Exception $e)
{
echo $e->getMessage();
}
?>
Remote Desktop Data Encryption Error When Connecting to Windows 2003
Today I have tried to connect to my Windows Server 2003 on the LAN and I got welcomed by a message decorated with Christmas colours (red dominating). Data Encryption Error! Huh??
Googled here and there and found a solution:
- Start Registry Editor.
- Locate and then click the following registry subkey:
HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\TermService\Parameters
- Under this registry subkey, delete the following values:
- Certificate
- X509 Certificate
- X509 Certificate ID
- Quit Registry Editor, and then restart the server.
Full description: http://support.microsoft.com/?kbid=323497