Tuesday, January 17, 2012

SC2ReplayHandler – contribution to the SC2 community

For those who know me, I grew up playing computer games and kind of never stopped. about 1.5yrs ago one of my favorite games came out which was Starcraft 2, and has become the only game I play.

So why do I blog about it ? I believe that everyone have their own skills and abilities to make things they like into bigger things, mine is coding I guess..

I created a tool that automatically renames ingame replay files based on parsed metadata of the replay files, and posted it on the biggest community site – TeamLiquid.net

I present to you : SC2ReplayHandler ( soon to be open source )

just a small tool that hooks to Windows’s event dispatcher for identifying when new replay files arrive, then parses them and renames them based on patterns defined by the user.

hope you like.

Sunday, January 01, 2012

Checking if a Stream is Online/Offline (PHP)

For the past year I have been watching SOOO many streams online. it got to a point where it almost completely replaces my TV view time.

as of 2011 the main streaming sites for video games are Justin.TV, Own3d.TV, Regame.TV.

all of these sites allow you to stream video over RTMP, and have become very popular with many sites and companies embedding such mechanisms to broadcast video on demand, and live streaming of events and games/tournaments.

each site therefor has its own API for developers/site builders to be able to embed things from their streams, and the most basic thing is an ONLINE Indicator.

so my 0.02 cents here will be to list functions that will enable you to have an Online indicator for each of the above, hoping that its saves some time…

for the examples, I used PHP for some quick and dirty coding.

for Justin.TV --

//justintv status check
function justinTVcheck ($channelName) {
$channelName = strtolower($channelName);
$json_file =
http://api.justin.tv/api/stream/list.json?channel=" . $channelName;
$json = file_get_contents($json_file);
if (strpos($json, 'name')) {
return (1); //online
} else {
return (0); //offline
}
}

for own3d.TV --

//own3d status check
function ownedTVcheck ($channelName) {
$request = '
http://api.own3d.tv/liveCheck.php?live_id=';
$arg = $channelName;
$session = curl_init($request.$arg);
curl_setopt($session, CURLOPT_HEADER, false);
curl_setopt($session, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($session);
curl_close($session);

if (preg_match("/true/",$response, $result)) {
return (1); //online
} else {
return (0); //offline
}
}

for regame.TV --

//regame status check
function regameTVcheck ($channelName) {
$url = '
http://www.regame.tv/liveview_xml_multiple.php?stream_ids=';
$arg = $channelName;
$xml = simplexml_load_file($url.$arg);
$status=$xml->stream->online;
if (strcmp($status,'true')==0) {
return (1); //online
} else {
return (0); //offline
}
}

pretty straight forward, functions return 1 if the stream is online, and 0 if not. and should be easily transferable to other languages.

Saturday, August 07, 2010

StarCraft 2 GPU Overheating FIX

For those of that have been playing StarCraft 2 for the past few weeks since the release, you might have noticed that your GPU is overheating due to a game engine problem.

Although the solution to it is quite simple and can be found in many places ( including bottom of this post ) I have decided to go and explain the problem, and not just the solution.

Lets first explain how a graphics engine works ( super high level ) :

  • once all graphics are loaded to the graphics card memory, the math/physics engine is then able to start drawing the frame. given all inputs from the game engine and the scene.
  • The frame is then being calculated based on the scene and objects, and at the end its being drawn on the screen.
  • Obviously some cards are fasted and can draw frames at a much higher frame rate… but that means that the game will be out of sync, or will be really fast, so there is a time axis synchronization on the top of it. so if your computer’s GPU is slow, you will play at the same rate, but will see less frames, or less of a smooth movement.

The Problem :

In StarCraft 2, the game has no frame limit by nature, which is very noticeable in the game’s Menus and empty terrains with no/few units …

What happens is that the GPU has all of the graphics, but has nearly no calculations to make in order to build the frame to draw, so it can draw a lot more frames in less time, which just heats the GPU and may cause black screens/crashes of the system.

The Fix :

Blizzard the magnificent who already got lots of questions from its customers, has offered a solution, which is to edit the “Documents'\StarCraft II\Variables.txt” file and add the two following lines :

frameratecap=60
frameratecapGlue=30

This effectively adds a frame rate limiter to the game, and holds it from drawing too many frames, if you got a strong GPU, you may want to adjust the values up a notch. Thanks Blizzard, GG.

Labels: ,

Thursday, July 29, 2010

Starcraft 2 - 0day Download Experience - Boosted

The wonderful Starcraft 2 Wings of Liberty has been released earlier this week, and as a hardcore fan of the original game, wanted to get it just as it roll out, which meant the environmental way of downloading a digital copy.

If you happen to know Blizzard ( the magnificent ! ), their distribution tool is based on 2 channels, one which is the direct downloader over HTTP, and the other which is P2P based. which is the main issue when a new game rolls out, since there werent enough ppl that could share parts, and thus rendered the download for me ( in Israel ) to 90Kbps total, which is about 900Kbps under my acceptable ratio.

So i decided to go for the following – first i will download over a VM in the normal way ( so i could share like a normal user ), but i wanted to play right away (why else would i buy at day 0 ? :) so i had a second download running in the same time on my main computer, which i wanted to “tweak”.

sc2-3 The direction for me was to disable the P2P vector on my main computer, so i could download only from the HTTP source, which then climbs the the limits, and so i did.

When looking into the Log in the downloader i found the tracker ( the distributor of the list that is used to connect beteen the P2P users ) and found it to be http://eu.tracker.worldofwarcraft.com

then i ran a DNS Lookup on the FQDN of : eu.tracker.worldofwarcraft.com and got back a single resolution to - 80.239.178.125

In the following step, i configured a Firewall Rule to block any traffic from my computer to that IP Address, in order to prevent the sharing distribution.

sc2-2The result was easy , the few seconds after the rule as been configured, the P2P connections dropped, and the entire download reverted to HTTP, which then made the download climb to 500KBPS, and eventually to 1.1MBPS

so i still let the VM download, so i would share the bits to let other users play, but i also started enjoying this fantastic game right away!.

Way to go Blizzard !

Labels: , , , ,

Wednesday, May 12, 2010

How To Downgrade Windows 7 Ultimate to Professional

Recently, I had to build a workstation for myself that is based on Windows, and will be able to replace my laptop for some home office tasks. and i had a Windows 7 Ultimate trial that i was playing with for a few days, and already installed lots of the required software, and figured i will then just need a license for it and continue to work…

The day has come, and the trial period expired, when i discovered that the only license i actually have is for a Professional edition. so i though, the best way will be to downgrade the system, should be easy right ?

The Windows installation mechanism works only in one direction, from lower to higher , so you can upgrade from Home to Professional , and from Professional to Ultimate for example, but not the other way around.

If you try to use the Upgrade tool, it will halt on this limitation , and will pop up a message like “Windows 7 Ultimate cannot be upgraded to Windows 7 Professional” and asks you to run a fresh install …

Well, there is a solution that involves some Windows Registry editing, which can nail this sucker down.

Step-By-Step:

  1. using the Start menu, type “regedit” and go to \HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion
  2. you will get the following registry values that you need to alter
  3. change the values of
    1. value of “EditionID” from “Ultimate” to “Professional”
    2. value of “ProductName” from “Windows 7 Ultimate” to “Windows 7 Professional”
  4. The Windows 7 Upgrade utility will be now fooled , and you can upgrade with no real issue.

Labels: , ,

Friday, March 26, 2010

first impressions of Google’s Skipfish WVS

after getting really interested in a late Google project, i spent few hours today with Google’s Skipfish v1.25b , which is a Google project for a web application security scanner , or as some times referred in the professional arena – a WVS ( web vulnerabilities scanner ) and is completely open source as i like it.

as i mentioned, i am playing with version v.1.25b ( although 1.26b is available at time of writing the article ) against a vulnerable demo web application that i wrote a few months back… and got some impressions on the current version.

first of all, i have to admit , its blazing fast … once given a destination to scan, the scan is fast , and the results are displayed in a very elegant way ( although a bit too hardcore ) moreover the depth and methods of detecting problems are quite impressive.

that being said .. the security checks themselves missed lots of the application vulnerabilities , including some quite basic SQL Injections which were there especially for security demonstrations. but i will give the credit and wait until this tool matures a little more before i try it again , and i am sure it will be much better.

the report is excellent , very insightful and shows track of the trace of the stream until the vulnerability has been detected , which is always good, nevertheless – i would like to see in future versions some different export mechanisms of reports, such as XML and PDF, to make it more usable in the IT security ecosystem environment.

there is a point to remember that at current time it is being written and managed by one person at Google , as compared to enterprise tools such as IBM’s Rational AppScan or Qualys etc, so you have to give credit here :)

for ease of use , it is easy , but i do expect a UI , since most people that will run this scanner will require some interaction with it that does not require any CLI / Linux skills, since it is not in their job requirements , they just need to run a tool and test for baseline ( unfortunately that also includes lots of “consultants” ).

if i am to rate this tool , i would rate it at its current version (1.25b) with 6.5 of 10 for now , since i really like the speed and the overall architecture of it , but i do see the need for some more maturity and some more robust security tests.

it detected 9 of 14 SQLi and 4 of 8 XSS , and none of the 4 persistent XSS vulnerabilities ( although it claims to detect it ) .. and yes , i have fed it some credentials as needed..

its a descent alternative to lots of the tools out there even in its current stage , and i would definitely go back to it when some holes are put to its belt.

 

Finally, just a quick install HOW-TO for it.
if you want to install it under CentOS ( i used 5.2 ) then do the following :

1. download and extract the tgz file anywhere ( example : tar zxpfv skipfish*.tgz )
2. install some neccesary packages for the install

- yum instll gcc
- yum install openssl-devel
- yum install libidn-devel

3. step into the folder extracted and run – make
4. there you go. :)

Labels: , , , , ,

Thursday, March 04, 2010

My New ESXi Lab System

For a while now , i have been thinking about building a Lab Server at home , that will save me time and effort for my day to day dev and other tech stuff. and decided to go with VMWare’s ESXi solution for a virtual environment.

My basic requirements were :

  1. need to run at least 6 resource demanding machines at the same time
  2. need for virtual networking
  3. silence in my lab
  4. performance.

After some spec digging , I finally went for the following spec :

  • Motherboard : Gigabyte GA-X58A-UD3R (link)
  • Memory : Crosair 12GB (6x2GB) DDR3 1333 (link)
  • CPU : Intel i7 920 (link)
  • CPU Cooler : Thremaltake V1-AX CPU Cooler (link)
  • HD : 4x WD Caviar Blue 500GB 7200RPM 16MB WD5000AAKS (link)
  • RAID Controller : Adaptec 2405S (link)
  • Display : Gigabyte HD 4350 512MB GDDR2 DX10.1 HDTV DVI HDMI PCI-E (link)
  • Case : Antec - Nine Hundred Two (link)
  • PSU : Thermaltake ToughPower W0103 600W PFC (link)
  • Additional NIC : Intel PRO/1000 GT Desktop Adapter (link)

Although the Motherboard of my choice includes 3 (!) built in RAID controllers for different raid approaches , i had to introduce a more robust RAID controller that will support my demand for performance ( RAID 10 ) , will offload the CPU cycles to a dedicated processor , and will also be supported by VMWare ESXi , which is not trivial. same reason goes for the additional NIC – the Intel PRO/1000 MT is there in order for the ESXi HSC to have all drivers and hardware in my box officially supported.

Some design decisions :

  • first , i wanted to make sure that the network card is officially supported , because as of now , VMWare only supports specific certified hardware ( an up-to date list of supported hardware can always be found here ) but the problematic ones are always the network controller and the disk controller (which halt the install if the install process doesn't like them). that's why i went with an Intel one, which at the time can be purchased in eBay for around 25-30$.
  • for the disks , i chose 4 x Caviar Blue 500GB disks, and wanted to use them as a RAID 10 array , so all and all i will get 1TB of extremely fast storage, and i chose the Caviar Blue, because unlike the Caviar Green which throttles down to save energy , i need performance – and the Caviar Blue maintains a constant 7200RPM rate.
  • the network card consumed my one and only PCI slot on the Motherboard , so although i was already considering a PCI Express RAID Controller , this became an essential part. at first i thought i could try to use one of the onboard RAID controllers , but VMWare rejected them, which at the end was ok – since by introducing the Ataptec card , all of the CPU cycles that are required to maintain the RAID are offloaded to a dedicated processor on the card. choosing the adaptec was fairly easy , since i wanted 4 disks in RAID 10 and PCI Express , and then i came across this article from Overclock3d.net which was enough to convince me im taking the right approach.
  • for power supply i went as i always do with a Thermaltake Toughpower PSU , which i calculated based on their online PSU calculator , and multiplied by 1.6 as I always do when scaling a PSU.
  • for RAM , just wanted a Triple Channel memory, and as much of it as i can get for a descent price, same as for display – i just had to have a display adapter in , so this was a cheap one with DVI+VGA+HDMI which made sense to have for future screens if i ever need one on this system.
  • for the chasis , i wanted a box that will be cool , good air flow and fanning , and will be easy to build a heavy duty system into. my only complain will be that in order to mount drives , i had to take out the drive bay out ( the bold holders are hidden ) which took some time, but other than that , its an impressive beast. a good review of the box could be found here.

The ESXi latest version at time of install is the 4.0U1 which has more than a handful of features.

I am a happy chap today.

 

not one of my standard posts … but hey , its my blog :)

Barry.

Labels: , , , ,


About

    My Name is Barry Shteiman, im a devoted tech junkie, and this is my blog.
    E: barry.shteiman -at- gmail.com
    Twitter : bshteiman

Tags & Categories

Mailing List & RSS

Stay Updated  
Add to Technorati Favorites