<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
   <title>My Random Blog</title>
   <link rel="alternate" type="text/html" href="http://www.zcentric.com/blog/" />
   <link rel="self" type="application/atom+xml" href="http://www.zcentric.com/blog/atom.xml" />
   <id>tag:www.zcentric.com,2007:/blog/1</id>
   <updated>2007-06-14T17:28:45Z</updated>
   <subtitle>This is a blog to share my thoughts about life, work and other random thoughts. I basically want a place to store my thoughts</subtitle>
   <generator uri="http://www.sixapart.com/movabletype/">Movable Type 3.33</generator>

<entry>
   <title>Make MySQL and GFS play nice</title>
   <link rel="alternate" type="text/html" href="http://www.zcentric.com/blog/2007/06/make_mysql_and_gfs_play_nice.html" />
   <id>tag:www.zcentric.com,2007:/blog//1.15</id>
   
   <published>2007-06-14T17:24:09Z</published>
   <updated>2007-06-14T17:28:45Z</updated>
   
   <summary>So you want to use a GFS shared storage option and have mysql run its databases on that shared storage? Well I had this problem at work and it took a bit to figure out since there wasn&apos;t much documentation...</summary>
   <author>
      <name>Mike Zupan</name>
      
   </author>
   
   
   <content type="html" xml:lang="en" xml:base="http://www.zcentric.com/blog/">
      <![CDATA[So you want to use a GFS shared storage option and have mysql run its databases on that shared storage? Well I had this problem at work and it took a bit to figure out since there wasn't much documentation on it but it works. It is slower then just using it over ext3. I have never tested it on a mysql cluster so I am unsure of the speeds compared to that

So the first thing you want to do is edit your /etc/my.cnf file

in the [mysqld] section you want to add this

skip-innodb

Then in the /etc/init.d/mysql script you want to add --external-locking to the following line so it looks like 

<blockquote>
/usr/bin/mysqld_safe  --defaults-file=/etc/my.cnf --external-locking --pid-file="$mypidfile" --log-error="$errlogfile" >/dev/null 2>&1 &</blockquote>

That is pretty much it.. Now if you want to connect to localhost you need to set a new sock file

so in [mysqld] I do something like this

socket=/var/lib/sock/mysql.sock

and in the [client] section ( create one if one isn't in the cnf file)

socket=/var/lib/sock/mysql.sock

Then 

<blockquote>mkdir /var/lib/sock/
chown mysql:mysql /var/lib/sock/</blockquote>

mysql should now run over gfs!]]>
      
   </content>
</entry>
<entry>
   <title>Webapp from scratch the right way part 1</title>
   <link rel="alternate" type="text/html" href="http://www.zcentric.com/blog/2007/03/webapp_from_scratch_the_right.html" />
   <id>tag:www.zcentric.com,2007:/blog//1.14</id>
   
   <published>2007-03-19T17:40:20Z</published>
   <updated>2007-03-19T17:52:41Z</updated>
   
   <summary>So I am writing this series to help others that might stumble upon this entry as a starting point for building a good web application from the start. Let me tell you that there is nothing worse then building up...</summary>
   <author>
      <name>Mike Zupan</name>
      
   </author>
   
   
   <content type="html" xml:lang="en" xml:base="http://www.zcentric.com/blog/">
      <![CDATA[So I am writing this series to help others that might stumble upon this entry as a starting point for building a good web application from the start. Let me tell you that there is nothing worse then building up a web application just to figure out you need to make a change that requires a change in 8 other sections. 

So a bit of background. I am the lead developer for <a href="http://Photoblog.com">Photoblog</a>. Before doing <a href="http://Photoblog.com">Photoblog</a>, I had around 5-6 years of <a href="http://PHP.net">PHP</a> experience. I made many mistakes and have learned a lot from them. So please use this and the others I write to learn from my mistakes. 

So my first and foremost advice is to create a wrapper class around the database driver. If you were one of the poor souls that didn't do this and wanted to move from php's mysql to their mysqli class then you had to change a ton of mysql_* commands. So that is where the benefits of a wrapper class comes in. When you need to make some changes, you just do it in the wrapper class. 

Basically to make a simple mysql query this is what I do

<blockquote>$DB = new Database; <br>
$DB->connect();<br>
$DB->query("SELECT * FROM table WHERE id=1 LIMIT 1");<br>
$DB->fetch_array();</blockquote>

Do you see the benefits to that? You might at first think that it is overkill to do this but its really not. You can do so much with a wrapper class. If you want to run an explain on each query or find the time to complete each query you just add it in the query() function in the wrapper class. 

Doing this will save you time in the end. 

I use to write sql queries like this

<blockquote>mysql_query("query here") or die(mysql_error());</blockquote>

So now I just do

<blockquote>$DB->query("query here");</blockquote>

In that query() function I can create my own error page if sql errors out. For <a href="http://Photoblog.com">Photoblog</a> what I do is if the user is an admin it shows the SQL query and the error. If its a normal user it will email the admins the SQL error and just show a error page that the user can understand and say a email has been sent out. 

So as you can see there are major benefits to creating a wrapper class for mysql. This is just the tip of the iceberg of what you can do with a wrapper class. ]]>
      
   </content>
</entry>
<entry>
   <title>Calculate Distance In Mysql with Latitude and Longitude</title>
   <link rel="alternate" type="text/html" href="http://www.zcentric.com/blog/2007/03/calculate_distance_in_mysql_wi.html" />
   <id>tag:www.zcentric.com,2007:/blog//1.13</id>
   
   <published>2007-03-10T03:25:25Z</published>
   <updated>2007-03-10T03:28:51Z</updated>
   
   <summary>So you have a whole table full of members or places with latitude and longitude&apos;s associated with them. Just replace the $lat and $lon with the center point you want to find distances from. You can also change the distance...</summary>
   <author>
      <name>Mike Zupan</name>
      
   </author>
   
   
   <content type="html" xml:lang="en" xml:base="http://www.zcentric.com/blog/">
      <![CDATA[So you have a whole table full of members or places with latitude and longitude's associated with them. Just replace the $lat and $lon with the center point you want to find distances from. You can also change the distance<=10 to a number you want to search from. This will limit your results to all results that are under 10 miles from the starting point

<blockquote>SELECT ((ACOS(SIN($lat * PI() / 180) * SIN(lat * PI() / 180) + COS($lat * PI() / 180) * COS(lat * PI() / 180) * COS(($lon - lon) * PI() / 180)) * 180 / PI()) * 60 * 1.1515) AS distance FROM members   HAVING distance<='10' ORDER BY distance ASC</blockquote>]]>
      
   </content>
</entry>
<entry>
   <title>Bash Patch to log to mySQL</title>
   <link rel="alternate" type="text/html" href="http://www.zcentric.com/blog/2007/03/bash_patch_to_log_to_mysql.html" />
   <id>tag:www.zcentric.com,2007:/blog//1.12</id>
   
   <published>2007-03-01T22:04:28Z</published>
   <updated>2007-03-02T13:15:16Z</updated>
   
   <summary>So at work we wanted to create a centralized syslog server. I had a great idea of why don&apos;t we log all user commands run on all servers into mysql. I knew about the bash-paranoia patch so that gave me...</summary>
   <author>
      <name>Mike Zupan</name>
      
   </author>
         <category term="Work" scheme="http://www.sixapart.com/ns/types#category" />
   
   
   <content type="html" xml:lang="en" xml:base="http://www.zcentric.com/blog/">
      <![CDATA[So at work we wanted to create a centralized syslog server. I had a great idea of why don't we log all user commands run on all servers into mysql. I knew about the <a href="http://e133.enemy.cx/xSH-paranoia/">bash-paranoia patch</a> so that gave me the idea of using that as my basis for my mysql patch. This should apply to both 3.0 and 3.1 even with all the all the latest security patches included. 

So first lets download the paranoia patch

<blockquote>wget http://e133.enemy.cx/xSH-paranoia/download/bash-paranoia.patch</blockquote>

Using that and compiling bash with ---enable-paranoia will allow you to log all user commands to syslog. 

So now lets download my patch now

<blockquote>wget http://zcentric.com/bash-mysql.patch</blockquote>

Now if you want to apply it to bash 3.1 I will give a little howto on how to do that. All in 1 step

You want to create the following table in a mysql database


<blockquote>CREATE TABLE `logs` (
  `rowid` mediumint(8) NOT NULL auto_increment
  `host` varchar(100) character set utf8 collate utf8_unicode_ci NOT NULL default '',
  `user` varchar(100) character set utf8 collate utf8_unicode_ci NOT NULL default '',
  `as_user` varchar(100) character set utf8 collate utf8_unicode_ci NOT NULL default '',
  `ip` varchar(100) character set utf8 collate utf8_unicode_ci NOT NULL default '',
  `ut_line` varchar(100) character set utf8 collate utf8_unicode_ci NOT NULL default '',
  `command` text character set utf8 collate utf8_unicode_ci NOT NULL,
  `ts` timestamp NOT NULL default CURRENT_TIMESTAMP,
  PRIMARY KEY  (`rowid`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;</blockquote>


Now that mysql table is made lets install bash and patch it and all that good stuff

<blockquote>wget http://ftp.gnu.org/gnu/bash/bash-3.1.tar.gz <br />
tar zxfv bash-3.1.tar.gz<br />
cd bash-3.1<br />
wget http://e133.enemy.cx/xSH-paranoia/download/bash-paranoia.patch<br />
wget http://zcentric.com/bash-mysql.patch<br />
patch -p0 < bash-paranoia.patch<br />
patch -p1 < bash-mysql.patch<br />
autoconf<br />
./configure --enable-paranoia --prefix=/usr<br />
make</blockquote>

Now the config file to let bash know where the mysql server is. Now if the mysql server is down bash shouldn't crash or anything.

So you have to create a file <strong>/etc/bash.conf</strong> and use the following lines. 

<blockquote>SERVER=192.168.0.10<br />
USER=username<br />
PASS=password<br />
DB=dbName</blockquote>

Now you should be able to like run /path/to/bash-3.1/bash and it should bring you to a new shell that is now the bash version with mysql. You should now be able to type commands it it will log to mysql!

You can then run make install if you wish to install
]]>
      
   </content>
</entry>
<entry>
   <title>Get topleft position of a element in javascript</title>
   <link rel="alternate" type="text/html" href="http://www.zcentric.com/blog/2007/02/get_topleft_position_of_a_elem.html" />
   <id>tag:www.zcentric.com,2007:/blog//1.11</id>
   
   <published>2007-02-15T17:28:17Z</published>
   <updated>2007-03-02T13:15:16Z</updated>
   
   <summary>I am doing this as a first part of my series on how to make a Fotonotes system like Flickr uses but from scratch. Ok well almost from scratch. The reason I want to redo this is mainly because Fotonotes...</summary>
   <author>
      <name>Mike Zupan</name>
      
   </author>
         <category term="Work" scheme="http://www.sixapart.com/ns/types#category" />
   
   
   <content type="html" xml:lang="en" xml:base="http://www.zcentric.com/blog/">
      <![CDATA[I am doing this as a first part of my series on how to make a <a href="http://www.fotonotes.net/">Fotonotes</a> system like <a href="http://Flickr.com">Flickr</a> uses but from scratch. Ok well almost from scratch. 

The reason I want to redo this is mainly because Fotonotes imports the note data in an XML form inside the jpeg image. Now this is good for a site like Flickr that only shows one image but I want it to be able to handle 20 images on a page. So my idea was to put everything into a database and then just have the notes be hidden until a user hovers over a image. Then just use javascript to show those images. I am thinking this would be easier on the server since it doesn't have to reload the image each time to show the data. I could be wrong though :)

The first thing you want to do is is download <a href="http://www.twinhelix.com/javascript/dragresize/">dragresize</a>. This pretty much creates the re-sizable boxes so you can select an area you want to add a note to. 

I pretty much took the example that comes with it and I found this <a href="http://codingforums.com/archive/index.php?t-75188.html">thread</a> that had the perfect solution to find a x/y coordinate of a element on a page in javascript. Check out the second post for the function I am using. Right now it does just what I want. 

The issue I am running into with this test is that firefox does not move the div to the upper left corner until you actually click on it. IE6 and opera seem to behave how I want. I will have to look into this issue and update. 

<a href="http://zcentric.com/examples/notes/ex1.html">Example of this in action!</a>

The example has some bounding issues, but I just think that it is due to it being right at the top. 

Also its a layout ripped from <a href="http://Photoblog.com">Photoblog</a> since I need for this to work on that site :)

]]>
      
   </content>
</entry>
<entry>
   <title>Great Examples of mySQL Queries</title>
   <link rel="alternate" type="text/html" href="http://www.zcentric.com/blog/2007/02/great_examples_of_mysql_querie.html" />
   <id>tag:www.zcentric.com,2007:/blog//1.10</id>
   
   <published>2007-02-01T21:02:03Z</published>
   <updated>2007-03-02T13:15:16Z</updated>
   
   <summary>So this is just a quick on to show a nice website I found about great example of queries in mySQL v5 http://www.artfulsoftware.com/queries.php...</summary>
   <author>
      <name>Mike Zupan</name>
      
   </author>
         <category term="Work" scheme="http://www.sixapart.com/ns/types#category" />
   
   
   <content type="html" xml:lang="en" xml:base="http://www.zcentric.com/blog/">
      <![CDATA[So this is just a quick on to show a nice website I found about great example of queries in mySQL v5

<a href="http://www.artfulsoftware.com/queries.php">http://www.artfulsoftware.com/queries.php</a>]]>
      
   </content>
</entry>
<entry>
   <title>Remove Leading 0&apos;s in Bash</title>
   <link rel="alternate" type="text/html" href="http://www.zcentric.com/blog/2007/01/remove_leading_0s_in_bash.html" />
   <id>tag:www.zcentric.com,2007:/blog//1.9</id>
   
   <published>2007-01-25T16:11:23Z</published>
   <updated>2007-03-02T13:15:16Z</updated>
   
   <summary>So you have a var you want to remove leading 0&apos;s on.. well do the follwing mzupan@mzupan-desktop:~$ var=00014 mzupan@mzupan-desktop:~$ let var=&quot;10#$var&quot; mzupan@mzupan-desktop:~$ echo $var 14 mzupan@mzupan-desktop:~$...</summary>
   <author>
      <name>Mike Zupan</name>
      
   </author>
         <category term="Linux" scheme="http://www.sixapart.com/ns/types#category" />
   
   
   <content type="html" xml:lang="en" xml:base="http://www.zcentric.com/blog/">
      <![CDATA[So you have a var you want to remove leading 0's on.. well do the follwing

<blockquote>mzupan@mzupan-desktop:~$ var=00014<br>
mzupan@mzupan-desktop:~$ let var="10#$var"<br>
mzupan@mzupan-desktop:~$ echo $var<br>
14<br>
mzupan@mzupan-desktop:~$ <br>
</blockquote>]]>
      
   </content>
</entry>
<entry>
   <title>Make the HP dv2120us webcam work in Linux</title>
   <link rel="alternate" type="text/html" href="http://www.zcentric.com/blog/2007/01/make_the_hp_dv2120us_webcam_wo.html" />
   <id>tag:www.zcentric.com,2007:/blog//1.8</id>
   
   <published>2007-01-16T19:41:26Z</published>
   <updated>2007-03-02T13:15:16Z</updated>
   
   <summary>So here is a little quick little howto on how to get the dv2120us webcam working in Linux. I am using the 2.6.20-rc5 kernel, which at the time of writing this is the latest release candidate kernel. It was not...</summary>
   <author>
      <name>Mike Zupan</name>
      
   </author>
         <category term="Linux" scheme="http://www.sixapart.com/ns/types#category" />
   
   
   <content type="html" xml:lang="en" xml:base="http://www.zcentric.com/blog/">
      <![CDATA[So here is a little quick little howto on how to get the dv2120us webcam working in Linux.

I am using the 2.6.20-rc5 kernel, which at the time of writing this is the latest release candidate kernel. It was not picked up in Linux but a lspci  produced the following

03:09.2 System peripheral: Ricoh Co Ltd Unknown device 0843 (rev 01)

I think that is it.. I am not sure if it sees it as a usb or pci device or not. The module uses usbcore so its beyond me. So to get it working I ran the following commands

<blockquote>svn checkout http://svn.berlios.de/svnroot/repos/linux-uvc/ <br>
cd linux-uvc/linux-uvc/trunk/<br>
make<br>
make install<br>
modprobe uvcvideo</blockquote>

You should see something like this in your dmesg once you load it

<blockquote>[ 1022.224000] usbcore: deregistering interface driver uvcvideo<br>
[ 1045.764000] uvcvideo: Found UVC 1.00 device USB 2.0 Camera (0c45:62c0)<br>
[ 1045.764000] usbcore: registered new interface driver uvcvideo<br>
[ 1045.764000] USB Video Class driver (v0.1.0)</blockquote>


Also on a side not it sees it as a v4l2 device and not a v4l device]]>
      
   </content>
</entry>
<entry>
   <title>Slideshow for Photoblog</title>
   <link rel="alternate" type="text/html" href="http://www.zcentric.com/blog/2007/01/slideshow_for_photoblog.html" />
   <id>tag:www.zcentric.com,2007:/blog//1.7</id>
   
   <published>2007-01-11T19:24:10Z</published>
   <updated>2007-03-02T13:15:16Z</updated>
   
   <summary>So I have been working on a nice little slideshow application that will be used for Photoblog. Its a little bit of html and editing some java code to make it work. I am looking to make this work a...</summary>
   <author>
      <name>Mike Zupan</name>
      
   </author>
         <category term="Work" scheme="http://www.sixapart.com/ns/types#category" />
   
   
   <content type="html" xml:lang="en" xml:base="http://www.zcentric.com/blog/">
      <![CDATA[So I have been working on a nice little slideshow application that will be used for <a href="http://www.photoblog.com">Photoblog</a>. Its a little bit of html and editing some java code to make it work. I am looking to make this work a big better so it will be easily implemented into any webpage.

So first here are two examples of how you can use it

<strong>Showing most recent post</strong>
<a href="http://www.zcentric.com/examples/slideshow_front.html">http://www.zcentric.com/examples/slideshow_front.html</a>

<strong>Show a certain post by date</strong>
<a href="http://www.zcentric.com/examples/slideshow_date.html">http://www.zcentric.com/examples/slideshow_date.html</a>


You can see the different things you can change in the one javascript line for now.. This will probably change but for now it works

http://www.photoblog.com/slideshow/js/slideshow.js?user=mikezupan&type=large&timer=6&date=2006-12-3

now you can see some things

<strong>user</strong> : that will be your username
<strong>type</strong> : this is the size of the images you want to show.. the options can be large/medium/small
<strong>timer</strong> : this is the time in seconds you want it to cycle each picture. It will default to 3 so you can't put anything less. 
<strong>date</strong> : this is optional but it needs to be in the yyyy-mm-dd format. If you leave it out it will show your most recent post. ]]>
      
   </content>
</entry>
<entry>
   <title>ARP Poison A Network</title>
   <link rel="alternate" type="text/html" href="http://www.zcentric.com/blog/2006/12/arp_poison_a_network.html" />
   <id>tag:www.zcentric.com,2006:/blog//1.5</id>
   
   <published>2006-12-17T17:37:10Z</published>
   <updated>2007-03-02T13:15:16Z</updated>
   
   <summary>So this little video I made will describe on how to use Cain &amp; Abel to ARP poison a wireless network. It will then show you how you can get all the passwords from clients on the network. So watch...</summary>
   <author>
      <name>Mike Zupan</name>
      
   </author>
         <category term="HacK" scheme="http://www.sixapart.com/ns/types#category" />
   
   
   <content type="html" xml:lang="en" xml:base="http://www.zcentric.com/blog/">
      <![CDATA[So this little video I made will describe on how to use <a href="http://www.oxid.it/cain.html">Cain & Abel</a> to ARP poison a wireless network. It will then show you how you can get all the passwords from clients on the network. So watch and learn. This is one of the rare times I will do something like this in windows. This is the first part in the series and I hope to do more advanced stuff.

<a href="http://zcentric.com/videos/arp_poison/arp_poison.html">Learn to ARP poison</a>

Here is a Xvid of the video to for the people that don't have flash8 installed

<a href="http://zcentric.com/videos/arp_poison/arpXVID.avi">Learn to ARP poison (xvid version)</a>
]]>
      
   </content>
</entry>
<entry>
   <title>Get the Broadcom BCM4311 to work in Linux</title>
   <link rel="alternate" type="text/html" href="http://www.zcentric.com/blog/2006/12/get_the_broadcom_bcm4311_to_wo_1.html" />
   <id>tag:www.zcentric.com,2006:/blog//1.4</id>
   
   <published>2006-12-12T21:54:39Z</published>
   <updated>2007-03-02T19:38:41Z</updated>
   
   <summary>So I was pulling my hair for a bit on this. Now to start off the driver for this card is still under major development along with the whole wireless subsystem in the Linux kernel so this could become outdated...</summary>
   <author>
      <name>Mike Zupan</name>
      
   </author>
         <category term="Linux" scheme="http://www.sixapart.com/ns/types#category" />
   
   
   <content type="html" xml:lang="en" xml:base="http://www.zcentric.com/blog/">
      <![CDATA[So I was pulling my hair for a bit on this. Now to start off the driver for this card is still under major development along with the whole wireless subsystem in the Linux kernel so this could become outdated soon. 

So first lets download the kernel. I am gonna use kernel 2.6.18.1 since it just seems to work. There are a few upstream patches for .19 but they locked up my cpu.

<blockquote>cd /usr/src <br>
wget http://ftp.kernel.org/pub/linux/kernel/v2.6/linux-2.6.20.tar.bz2<br>
wget ftp://lwfinger.dynalias.org/patches/combined_2.6.20.patch</blockquote>

Now lets extract the kernel

<blockquote>tar xfj linux-2.6.20.tar.bz2<br>
ln -s linux-2.6.20 linux </blockquote>

Ok now lets apply the patches

<blockquote>cd linux<br>
patch -p1 < ../combined_2.6.20.patch</blockquote>

Now you want to compile your kernel.. I will not go into this.. there are plenty of howtos that describe it. Now you have to install the bcm43xx-fwcutter package

Now you want to get the driver. You have to use v3 of it.. I will post the one I used. From what I know it shouldn't matter if you have a 64 or 32 bit system. I could be wrong though. You want to run cutter as root

<blockquote>cd /tmp<br>
wget http://www.zcentric.com/brcmDrv340rc100a.zip<br>
unzip brcmDrv340rc100a.zip<br>
bcm43xx-fwcutter -w /lib/firmware /tmp/bcmwl5.sys</blockquote>

Once the kernel is installed and you rebooted you should be able to boot into the new kernel and the light for the wireless should turn on which means the radio is on. The following command should return APs

<blockquote>iwlist scan ethX</blockquote>

If for some reason it doesn't work.. try to extract the firmware into the kernel version

<blockquote>mkdir /lib/firmware/2.6.20<br>
bcm43xx-fwcutter -w /lib/firmware/2.6.20 /tmp/bcmwl5.sys</blockquote>
]]>
      
   </content>
</entry>
<entry>
   <title>Calling for Super Dodgeball On the Wii</title>
   <link rel="alternate" type="text/html" href="http://www.zcentric.com/blog/2006/11/calling_for_super_dodgeball_on.html" />
   <id>tag:www.zcentric.com,2006:/blog//1.3</id>
   
   <published>2006-11-27T23:47:28Z</published>
   <updated>2007-03-02T13:15:16Z</updated>
   
   <summary>So I&apos;ve played the Wii for almost a week and I love it. I can&apos;t begin to explain how fun the Wii Sports game is and it gets even better with a crowd. So that got me thinking about what...</summary>
   <author>
      <name>Mike Zupan</name>
      
   </author>
         <category term="Life" scheme="http://www.sixapart.com/ns/types#category" />
   
   
   <content type="html" xml:lang="en" xml:base="http://www.zcentric.com/blog/">
      <![CDATA[So I've played the Wii for almost a week and I love it. I can't begin to explain how fun the Wii Sports game is and it gets even better with a crowd. 

So that got me thinking about what old games, I would love to see re-made in Wii form. One of the games I loved playing as a kid was <a href="http://en.wikipedia.org/wiki/Super_Dodge_Ball">Super Dodgeball</a> for the NES. Its a perfect game to get a face lift and use the Wii for. 

I mean what person hasn't played dodgeball at sometime in their life. So I am calling for any developing studio out there to PLEASE make a game as fun as the NES version was for the Wii. I am thinking full online play too. Why not right? I mean you have everything built in to make a great game. Throwing and dodging. You could use the nunchuck to move your guy around. 

I am including some pictures to remember this game in all its glory. 


<img alt="sdb-1.gif" src="http://www.zcentric.com/blog/sdb-1.gif" width="256" height="224" />
<p>
<img alt="Dball2.jpeg" src="http://www.zcentric.com/blog/Dball2.jpeg" width="203" height="177" />
<p>
<img alt="dodgeball.gif" src="http://www.zcentric.com/blog/dodgeball.gif" width="240" height="160" />]]>
      
   </content>
</entry>
<entry>
   <title>Install NoSteam Counterstrike 1.6 server</title>
   <link rel="alternate" type="text/html" href="http://www.zcentric.com/blog/2006/11/install_nosteam_counterstrike.html" />
   <id>tag:www.zcentric.com,2006:/blog//1.2</id>
   
   <published>2006-11-20T14:38:08Z</published>
   <updated>2007-03-02T13:15:16Z</updated>
   
   <summary>So I was a long time Counterstrike player who broke the habit around 3 years ago. A few weeks ago people at my office were saying how we should setup a gaming server and Counterstrike got mentioned. We decided to...</summary>
   <author>
      <name>Mike Zupan</name>
      
   </author>
         <category term="HacK" scheme="http://www.sixapart.com/ns/types#category" />
   
   
   <content type="html" xml:lang="en" xml:base="http://www.zcentric.com/blog/">
      <![CDATA[So I was a long time Counterstrike player who broke the habit around 3 years ago. A few weeks ago people at my office were saying how we should setup a gaming server and Counterstrike got mentioned. We decided to play 1.6 since none of us have the video cards to play CS:S. 

So I have setup a server in the 1.3 days for Counterstrike and it was easy to get around connecting in using an invalid CD key. You just removed the auth servers from the cfg file. I forget the filename but no one plays 1.3 anyway. 

So this little howto will get you to setup a LAN type environment and not worry about having people use steam to auth. You can find on various places a NoSteam version of Counterstrike. This is great for office environments or if you are setting up a LAN event. You could do this and place the server on the Internet but there are so many cheaters they almost destroy the experience. 

So first lets download all the needed files. 

<blockquote>wget http://www.steampowered.com/download/hldsupdatetool.bin <br>
wget http://www.cstrike.ro/cstrike_files/engine.v15.tgz</blockquote>

Now lets extract and use the update tool

<blockquote>chmod +x hldsupdatetool.bin<br>
./hldsupdatetool.bin</blockquote>

Now lets run the download and update tool. You will probably have to run this command twice till you see a <strong>HLDS installation up to date</strong>

<blockquote>./steam -command update -game valve -dir .</blockquote>

Now lets install the counterstrike mod

<blockquote>./steam -command update -game cstrike -dir .</blockquote>

Ok now that the server is installed, lets install the cracked engine files

<blockquote>rm -rf engine_amd.so<br>
rm -rf engine_i486.so<br>
rm -rf engine_i686.so<br>
tar xfvz engine.v15.tgz</blockquote>

Now in the same directory you are in you want to edit the following file ./cstrike/server.cfg and put the following contents in. Change what you feel needed

hostname "Server Name"
mp_autokick 0
mp_autocrosshair 0
mp_autoteambalance 0
mp_buytime 2
mp_consistency 1
mp_c4timer 35
mp_fadetoblack 0
mp_falldamage 0
mp_flashlight 1
mp_forcecamera 3
mp_forcechasecam 2
mp_friendlyfire 1
mp_freezetime 3
mp_fraglimit 0
mp_hostagepenalty 0
mp_limitteams 6
mp_logfile 1
mp_logmessages 1
mp_logdetail 3
mp_maxrounds 0
mp_playerid 0
mp_roundtime 3
mp_startmoney 800
mp_timelimit 35
mp_tkpunish 0
mp_winlimit 0
sv_aim 0
sv_airaccelerate 10
sv_airmove 1
sv_allowdownload 1
sv_clienttrace 1.0
sv_clipmode 0
sv_allowupload 1
sv_cheats 0
sv_gravity 800
sv_lan 1
sv_maxrate 7000
sv_maxspeed 320
sv_maxupdaterate 101
sys_ticrate 10000
decalfrequency 60
pausable 0
log on
decalfrequency 60
edgefriction 2
host_framerate 0
exec listip.cfg
exec banned.cfg
rcon_password yourpassword

Now  we need to put it in unsecure mode. So edit ./cstrike/liblist.gam and change the the secure from a 1 to a 0

Now you can run the server

./hlds_run -game cstrike +ip you.ip.here +sv_lan 1 -nomaster +maxplayers 18 +map de_dust2

You should now be able to connect to it and have fun playing]]>
      
   </content>
</entry>
<entry>
   <title>How I got free mp3s</title>
   <link rel="alternate" type="text/html" href="http://www.zcentric.com/blog/2006/10/how_i_got_free_mp3s.html" />
   <id>tag:www.zcentric.com,2006:/blog//1.1</id>
   
   <published>2006-10-31T15:36:15Z</published>
   <updated>2007-03-02T13:15:16Z</updated>
   
   <summary>So I idle a lot and help out on a IRC channel called #linux-noob on Efnet when someone asked if they could grab all the mp3&apos;s from Puscifer. Me being a giant Maynard fan myself I decided to do it....</summary>
   <author>
      <name>Mike Zupan</name>
      
   </author>
         <category term="HacK" scheme="http://www.sixapart.com/ns/types#category" />
   
   
   <content type="html" xml:lang="en" xml:base="http://www.zcentric.com/blog/">
      <![CDATA[So I idle a lot and help out on a IRC channel called <a href="http://linux-noob.com">#linux-noob</a> on <a href="http://efnet.org">Efnet</a> when someone asked if they could grab all the mp3's from Puscifer. Me being a giant Maynard fan myself I decided to do it. So here are the steps I took to get the music.

From what I know the two tracks he has released.. He released for free. There is some live Tool and A Perfect Circle tracks there also that are pretty good so I took on the challenge.
So I use Linux but the way I figured out where the mp3s are you could do the similar thing in windows. So my first thought was to run a command called strings on the flash file. So I downloaded the file the following way

<blockquote>wget http://store.puscifer.com/puscifer.swf</blockquote>

Then I ran strings on the swf file

<blockquote>strings puscifer.swf</blockquote>

That basically returned nothing.. It wasn't like running strings on a compiled C/C++ file.. it got a ton of data like this

    <blockquote>=YWAxhN
    .q5{
    cWl_
    uR.k#k
    }^x$D
    }@uw\b
    JT5e
    `O]R
    5'2z
    ?AGm
    H?v
    -F?CAg
    C?En7
    loTl
    ECGm
    cvHb
    g^!1
    $Nz$*</blockquote>

So nothing there you can get anything useful out of. So it got me thinking that Adobe just released a stand alone player for flash9. So I downloaded that and ran the flash file with that. I was using Wireshark to sniff the http traffic to see what URL it got the playlist from. So when I loaded up the flash file I got nothing on the sniffer and the playlist never loaded. So I guess there is some security check in there that it has to be on that same host that its grabbing the playlist for.

So then I got the good idea of setting up a vhost for store.puscifer.com. So first I added a entry in my /etc/hosts file that looks like this

    <blockquote>127.0.0.1 store.puscifer.com</blockquote>

Then I created a vhost entry in apache that had something like this. I will not go into getting vhosts working in apache.. If you can't do it.. learn something


    <blockquote>&lt;VirtualHost *&gt;
    ServerAdmin webmaster@localhost
    DocumentRoot /var/www/
    ServerName store.puscifer.com
    CustomLog /var/log/httpd/access.log combined
    &lt;/VirtualHost&gt;</blockquote>

So I put the flash file in /var/www/ and then I restarted firefox to make sure the dns cache is regenerated. Then I hit the following URL again
<blockquote>
http://store.puscifer.com/puscifer.swf</blockquote>

Then in the /var/log/httpd/access.log I saw the following

<blockquote>127.0.0.1 - - [30/Oct/2006:16:03:19 -0500] "GET /music/playlist9.xspf HTTP/1.1" 404 344 "-" "Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.1) Gecko/20061010 Firefox/2.0"
127.0.0.1 - - [30/Oct/2006:16:03:19 -0500] "GET /puscifer1.flv HTTP/1.1" 404 337 "-" "Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.1) Gecko/20061010 Firefox/2.0"</blockquote>

BINGO! I got the playlist file. So then I removed the store.puscifer.com in my hosts file and then restarted firefox again and hit the following URL

    <blockquote>http://store.puscifer.com/music/playlist9.xspf</blockquote>

There it is.. a XML file with paths to mp3 files.

I am pretty sure you can do this to almost any flash file that doesn't embed the music in the flash file itself. I'd like to hear of any other sites people may find that you could do this to

<strong>UPDATE</strong>
So its 11/2 and thanks for the comments.. You know I never figured to try liveheaders even though I had it loaded right in my browser.

For those with firefox2 you can find a version at http://phaistonian.pblogs.gr/files/3408-livehttpheaders-0.12.xpi 

So I loaded liveheaders and there is was after some viewing

<blockquote>https://store.puscifer.com/music/playlist9.xspf

GET /music/playlist9.xspf HTTP/1.1
Host: store.puscifer.com
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.1) Gecko/20061010 Firefox/2.0
Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
Accept-Language: en-us,en;q=0.5
Accept-Encoding: gzip,deflate
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
Keep-Alive: 300
Connection: keep-alive
Cookie: cookie_test=please_accept_for_session

HTTP/1.x 200 OK
Date: Thu, 02 Nov 2006 14:30:27 GMT
Server: Apache/1.3.34 (Debian) mod_gzip/1.3.26.1a PHP/4.3.10-16 mod_ssl/2.8.25 OpenSSL/0.9.8a
Last-Modified: Sat, 28 Oct 2006 20:36:11 GMT</blockquote>

An even simpler method then I used.

]]>
      
   </content>
</entry>

</feed>
