Connect Wireless XBox 360 Controller(s) to your Windows PC

0 comments

To further my quest to get 4 player Castle Crashers up and running on my computer, I needed to make use of both my PS3 and XBox 360 controllers. (Here's the guide to get the PS3 controller working on PC via USB cable or bluetooth)

Rather than using a standard bluetooth dongle, the Xbox 360 controller requires the purchase of a "XBox 360 Wireless Gaming Receiver For Windows" which allows you to connect up to 4 control pads.

The great thing about this is they don't have to cost much if you're ok with getting a cheap knockoff.

Hardware Requirements

Software Requirements

Setup

  • First of all, install the drivers. This ensures you've got everything in place ready to go.
  • Then plug in the wireless receiver into a USB port.

image

  • If Windows automatically detects the drivers for it and gives you the thumbs up then you're good to go!

 

  • If not, you'll have to manually select the drivers. Don't fret, it's not that hard.
  • Open up the Control Panel
  • Click on Device Manager
  • Expand "Other devices" and right click on "Unknown device"
  • Select "Update driver software"
  • Click "Browse my computer for driver software (advanced)"

64bit2

  • Select "Let me pick from a list of device drivers on my computer"
  • Select "Microsoft Common Controller for Windows Class" and click Next
  • Select "Xbox 360 Wireless Receiver for Windows" and click Next
  • Click Yes when prompted to confirm
  • It should now be successful.

Pairing the wireless controller with Windows

Surprisingly, this didn't work for me straight off. Not because of hardware or software but because of batteries. Yep, apparently if the batteries are weak it won't pair. The only way you can really know is to try it.

  • First you need to turn on the controller. Hold the big X button in the middle until it flashes

image

  • Then press the sync button on the receiver.

image

  • Lastly, press the sync button on the controller

image

  • After a few seconds it'll connect and stop flashing

image

An easy way of testing the controller is to just run Steam on Big Picture Mode. If you can navigate the menu using the controller then you're onto a winner!

Dghtrx8
Yep, it's really working. Try not to look so surprised!

Sources

Varnish: Enabling wildcard purging of cache content

0 comments

Varnish is great for load balancing and reducing load on your servers by caching content, but at the same time it's an absolute pain in the ass to clear the cache for multiple things at once. Fortunately, Varnish 3.0 makes it much easier to do mass purging.

Setup in Varnish 2.x

In 2.x syntax, we'd open up the VCL file and do something like:

sub vcl_recv {
if (req.request == "PURGE") {
if (!client.ip ~ purge_acl) {
error 405 "Not allowed";
}

return(lookup);
}
}

# Which also requires
sub vcl_hit {
# Clear the cache if a PURGE has been requested
if (req.request == "PURGE") {
set obj.ttl = 0s;
error 200 "Purged.";
}
}

Setup in Varnish 3.x

In 3.x syntax, purge() and purge_url() has been replaced by ban() and ban_url(). Contrary to the name, it doesn't ban a request but rather refresh it.

sub vcl_recv {
if (req.request == "PURGE") {
if (!client.ip ~ purge_acl) {
error 405 "Not allowed";
}

ban("req.http.host == " + req.http.host + " && req.url ~ " + req.url + "$");
error 200 "Purged.";
}
}

Requesting a PURGE

To clear the URL, we simply make a call using curl.

To clear a specific URL:

curl -X PURGE http://www.yourdomain.com/varnish/esi/comments/12345/

To clear any urls which match this pattern:

curl -X PURGE http://www.yourdomain.com/varnish/esi/comments/.*

Main differences

No more logic in vcl_hit() ! All your cache invalidation is done in the one place.

Another subtle difference is that purge() will clear the contents from memory, opening up your server to the thundering herd problem while ban() simply invalidates it and refreshes it when ready.

One last benefit of going to Varnish 3.0 is the support for GZip on ESI pages!

All great changes in my opinion!

aww-yea

Awww yeahhhhh~!

Sources

 
Copyright © Twig's Tech Tips
Theme by BloggerThemes & TopWPThemes Sponsored by iBlogtoBlog