Red5 on Ubuntu : start to finish. (svn, apache, eclipse, etc)

Install java, the right way.
http://www.javadesign.info/SystemsHardware/OS/Ubuntu/install-java-on-ubuntu

Set up a docroot in sites-enabled, set up a DNS record, and restart whatever you need to restart.

root@rockstar:/usr/local/docroots/red5# cat /etc/apache2/sites-enabled/red5
DirectoryIndex index.php
php_value include_path ".:/usr/local/lib/php"
DocumentRoot /usr/local/docroots/red5/webapps
ServerName red5.dakotaspots.com

Set up a red5 repo and sub directories like so.
user@trinity:~$ svn list file:///usr/local/svn_repo/red5/
red5-0.8.0/
red5_flex/

Check in an empty flex project into the repo, and then check out both repos as new projects in eclipse.

svn co svn_ssh://user@trinity://usr/local/svn_repo/red5-0.8.0
[leave off the trailing slash to check out the whole docroot.]

No Comments

Setting up MySQL Replication [5.3.1] on Ubuntu Server

I got a little sick of a bunch of outsourced dbas ‘working’ for us on a project so I pushed them out and decided it’d be quicker if I just did it myself.  (by working, they took over a month just to do what took me four hours — the company is bluewolf by the way.)

What you need to do this:

  1. Reasonable UNIX system administrator skills.
  2. The ability to use the mysql command line.
  3. Root access everywhere, root db access
  4. db1 -> An existing database to replicate, something with test data already in it, that you can already connet to it, run queries, connect via navicat, shell, etc. (for more information, learn about MySQL’s bind address property) For this tutorial, I’ll assume you’re going to replicate the “wordpress” and “wikidb” schemas.
  5. db2 -> the replication instance, a brand new, installed from source, configure/make/make installed to /usr/local/mysql
  6. I strongly suggest navicat [50 bucks]  and mysqladmin [free]
  7. A mac, or a linux workstation!  [well, I'm just saying.. PC's suck, so get a mac, or a debian notebook or something. I am completely through in my life answering PC questions, so if you ask a question on this, make sure it has nothing to do with Windows.]

db1->my.conf

make sure it has something like this — server ID 1 means it’s going to be a master database, there’s some performance tuning stuff in here, and at the bottom it sets up the logs to bind to the replication db.

[mysqld]
user                                   = mysql
pid-file                              = /var/run/mysqld/mysqld.pid
socket                               = /var/run/mysqld/mysqld.sock
port                                   = 3306
basedir                             = /usr/local/mysql
datadir                             = /usr/local/mysql/var
tmpdir                             = /tmp
language                         = /usr/local/mysql/share/mysql/english
skip-external-locking
bind-address                 =192.168.1.2
key_buffer                     = 64M
max_allowed_packet  = 64M
thread_stack                 = 128K
thread_cache_size       = 8
myisam-recover          = BACKUP
query_cache_limit       = 1M
query_cache_size        = 16M
server-id                         = 1
log_bin                           = /var/log/mysql/mysql-bin.master.log
expire_logs_days        = 14
max_binlog_size         = 1G
binlog_do_db            = wordpress
binlog_do_db            = wikidb

Create replication user on DB1

GRANT REPLICATION SLAVE, SUPER, RELOAD, SELECT
ON *.*
TO 'replication'@'db1'
IDENTIFIED BY 'replication';

Get the replication database to run as a regular database.

http://dev.mysql.com/doc/refman/5.1/en/quick-install.html

cd /usr/local/mysql
chown -R mysql:mysql ./*
./bin/mysql_install_db  –user=mysql
chown -R mysql:mysql ./*

#and of course, set up symlinks so it starts correctly.!
ln -s /usr/local/mysql/share/mysql/mysql.server /etc/init.d/mysql
ln -s /usr/local/mysql/share/mysql/mysql.server /etc/rc2.d/S91mysql

test that everything installed by just starting the db.

/etc/init.d/mysql start

Run mysql and create yourself as user to use MySQL Admin with.

mysql> grant all on *.* to ‘afraser’@'%’ identified by ‘acleartextpasswordstring’;

I suggest you add the same ‘user’ to the replication db that is used by the php host in case you ever need to shut off the slave and use it as a master.

mysql> grant all on *.* to ‘apache’@'%’ identified by ‘acleartextpasswordstring’;

/etc/init.d/mysql stop

Copy over the db1 database as a starting point for db2

db1 -> Shut down the database for the tar to avoid running a bunch of mysql commands.

db1 -> cd /usr/local/mysql/var

db1 -> tar cvf ~afraser/mysqlstuff.tar wikidb wordpress

db1 -> scp ~afraser/mysqlstuff.tar afraser@db2:~

db2 -> cd /usr/local/mysql/var

db2 -> cp ~afraser/mysqlstuff.tar .

db2-> tar xvf ./mysqlstuff.tar

db2-> set up the my.conf

This is pretty much straight defaults, or close to it, except you have to set the server ID.

[mysqld]
user                                              = mysql
pid-file                                        = /var/run/mysqld/mysqld.pid
socket                                          = /var/run/mysqld/mysqld.sock
port                                             = 3306
basedir                                       = /usr/local/mysql
datadir                                       = /usr/local/mysql/var
tmpdir                                        = /tmp
language                                    = /usr/local/mysql/share/mysql/english
skip-external-locking
key_buffer                                = 64M
max_allowed_packet            = 64M
thread_stack                           = 128K
thread_cache_size                 = 8
myisam-recover                     = BACKUP
query_cache_limit                = 1M
query_cache_size                 = 16M
server-id                                 = 2
expire_logs_days                 = 14
max_binlog_size                  = 1G

Now restart the DB2 DB, make sure it works by connecting to it with MySQL Administrator with your user.

Set db2’s master pointer to the D1 server.

First log into D1 and figure out what you need to set up.

mysql> show master status;
+------------------+----------+-----------------------------------------------------------------------+------------------+
| File             | Position | Binlog_Do_DB                                                          | Binlog_Ignore_DB |
+------------------+----------+-----------------------------------------------------------------------+------------------+
| mysql-bin.000015 |      106 | central,redtrax,redtrax_node,redtrax,wordpress,wikidb,phpsession_prod |                  |
+------------------+----------+-----------------------------------------------------------------------+------------------+
1 row in set (0.00 sec)

Now punch that into Db2’s database.

mysql> CHANGE MASTER TO
MASTER_HOST=”IP.Ad.Of.D1″,
MASTER_USER=”replication”,
MASTER_PASSWORD=”replication”,
MASTER_LOG_FILE=”mysql-bin.000015″,
MASTER_LOG_POS=106;

mysql>SLAVE START;

Then, you just go back and forth between DB1>MYSQL> Show Slave status; and DB2>Mysql>Show Master Status; until you figure out how it all works.

No Comments

Casting Zend DB results as VO Objects for flex.

It’s really simple really, you just did a zendDB->fetchAll and you want to return the result array as an VO object back to flex.

You’d think that this would work.

$userObject = (UserVO) $zendDBResult;

But it doesn’t. That kind of casting is not built into PHP. Ok open source guys, this is kind of important, but that’s another discussion…
So you try this.
$zendDBResult = $statement->fetchObject();
$userObject = (object) $zendDBResult;

Of course this sort of works, but on the flex side, you realize that it just isn’t going to cast.  Everything comes across as a string and as an object of stype stadard class. Without throwing out all of your VO’s in the AS3 side and replacing everything with strings, you’re just flat hosed.

user = event.result.object as UserVO;  // yeah, forget it.

How do you fix it all and have it work for ALL of your VO’s?

It’s simple, use inheritance. Have your all your VO objects extend some kind of generic data object, and then just put this method into the parent.

public function populateMyself($dbResult) {
error_log(”Populating Myself”);
foreach ($dbResult as $key=> $value) {
$this->$key = $value;

}
}

To use it, just have the VO object call itself with the result set.

Then, just tell the object to ‘popluate itself’ by passing in the ZendDB result.

$userVO = new UserVO();
$zendDBResult = $statement2->fetchObject();
$userVO->populateMyself($zendDBResult);

Works like a charm.!

No Comments

Zend_AMF and Flex

Many people are switching from old school php type architectures to a more object oriented MVC system to pass data back and forth between front ends and back ends. In the world of php and flex, this generally means either Zend_AMF or AMFPHP.

If you want to see how this works, I suggest starting here.

http://corlan.org/2008/11/13/flex-and-php-remoting-with-zend-amf/

It’s a snap to do and you can probably get your first simple test up and running in a single day.

Here’s what the tutorial doesn’t say that maybe it should.

1. Start by creating a pop up title window to display your AMF errors with and make it really useful. Stick your ‘remoteFault’ method into your singleton so you can use it everywhere. I have a little MXML called RPCErrorWindow that’s basically just a TextArea that I send data into.

public function remoteFault(event:FaultEvent, caller:DisplayObject):void {
pop = mx.managers.PopUpManager.createPopUp(caller, RPCErrorWindow,true) as RPCErrorWindow;
pop.rpcErrorString = event.fault.message;
pop.showCloseButton = true;
pop.width=500;
pop.height=300;
pop.title=”RPC Error Console”;
pop.addEventListener(CloseEvent.CLOSE, closeRemoteFaultViewer);
PopUpManager.centerPopUp(pop);

}

2. In the services-config.xml file, you point to a service endpoint. Make sure to set production false so the errors display in the title window above.

$server = new Zend_Amf_Server();
$server->setProduction(false);

3. In the same file above, you don’t need to get fancy to add multiple ’service’ files or multiple VO objects. Just add them in.

//To add multiple services…

$server->addDirectory(dirname(__FILE__) .’/../service/’);

//To add multiple VO objects.

$server->setClassMap(”OrderVO”, “OrderVO”);
$server->setClassMap(”AddressesVO”, “AddressesVO”);

4. In your services, make them extend something like a generic service class and in that class, have a print function that sends everything to the phperrors.log file. You’ll get really tired of writing error_log(print_r($object, true)). Here’s my generic service method that I just call with parent::p($myObject);

public function p($object) {
error_log(”Dumping variables from object of type ” . get_class($object));
error_log(print_r($object, true));
}

5. And lastly, just because you’re in an instantiated service class, that doesn’t mean you can daisy chain functions like you’re probably used to in PHP.  In my ‘address service’ class, I have methods that deal with getting address objects, and I have two little wrapper functions I call from the flex. Notice below I call AddressService::getAddress instead of just this.getAddress or even getAddress.

public function getBillingAddress($user){
$address = AddressService::getAddress($user, “billing”);
return $address;
}
public function getShippingAddress($user){
$address= AddressService::getAddress($user, “shipping”);
return $address;
}

That’s about it. Overall, it’s much easier than you’d expect.

No Comments

After Frankie’s funeral

I keep thinking about how I met my wife swing dancing.
About how all my closest friends are swing dancers.
About how both my grandmother and my mother were swing dancers.
About how I just put up a photo album of my four year old with about 50 other swing dancers.
About how I’m quite sure at least 1/5th of the baby boom generation back from WWII met swing dancing.
About how I was sitting next to Tony and Auralie from Boston, and they too met swing dancing.
About the countless hours I’ve spent studying Frankie’s aerials footage frame by frame.

Man, the the list goes on and on..

Who would have ever thought one man could have made such an impact on so many people.

This may be our dance now, but it doesn’t feel the same. It was a rough day for me today, perhaps it was just as rough for us all, but, I do feel blessed to have been able to attend and pay my respects to the man I believe is one of the most American of all Americans. Though the eulogy said the typical stuff about celebration of life and moving on, I sure feel like there’s a huge hole that is not going to / can never be filled. He was just a normal guy. He wasn’t even trying to be a legend, he wasn’t trying to be the leader. I suppose that’s what makes it all the more difficult for me personally.

Carol and I have decided to put up a picture in our new hallway with his picture, and inside the frame we’re going to put the his granddaughter gave me today and the red white and blue ribbon they gave Carol. He will always be a part of my own family history.

My four year old son told me today he was up in heaven dancing with God now.

No Comments

Collegiate Shag through changing times

Tony and Shannon performing a collegiate shag routine

Tony and Shannon performing a collegiate shag routine

I have this passion for a rare form of swing dancing called Collegiate Shag. I sincerely think I may be one of the few who truly appreciate this dance right down to my core. What’s it like to have such a passion? Well, it’s wonderful and rough at the same time.

It’s wonderful that there are a select few others out there that share my passion. We sort of clump together here in the New York City scene, birds of feather and all that. I’ve spent many hours in the studio with them just practicing, working on the craft, practicing like there’s no tomorrow, sacrificing, and just generally giving it everything I have. It’s been the most rewarding journey into swing dancing I think I’ve ever taken and I’m grateful to have the ability to do it. I am also greatful to have the support of my friends and family on this passion, my wife who understands I have to do it, my partners Shannon and Jen who have tried to pick up my style, and the several students who’ve repeatedly come to the classes I’ve taught at Dance Manhattan and around the city.

It’s rough because the American swing dance environment itself is changing. To me, shag tends to be easier to do to music that has more of a constant downbeat, like say to jump blues or rock and role style swing music of the late 40’s and early 50’s, or perhaps the modern versions of similar beats like those from Big Six, even a good old fashioned swing tune with a good base line like many from Basie, Benny Goodman, or Bill Elliot. All around me though, I’m seeing socially danced music infusing more and more into the categories of charleston-like or groovy. At least to me, regardless of speed, to me these two styles of music do not easily lend themselves to the collegiate style. When I hear charleston, I want to do charleston. And when I hear groovy, I want to use channel it with musical lindy hop. Forcing groovy shag to come out, at least to me, just doesn’t work.

Where does that leave Shag? Like Balboa and Lindy Hop, maybe shag itself will change to fit the music too. Or, perhaps as people say, it’ll all come back around. I hear it’s making a huge impact in certain cities that aren’t NYC, but we’ll see about all that here in NYC. Heck, with all spots I’ll be showing the style over the next year, perhaps that alone will create at least exploratory interest within our local community.  I guess we’ll see what we see.

Either way  I’ve never been able to shake this passion so you can bet Collegiate Shag will be alive and well in the Fraser household.

No Comments

Frankie Manning

frankie1

Frankie, I can’t even begin to say how sad it is to hear that you are not with us anymore. You’re the founder of all swing dancing, the aerialists that I’ve studied the most, and just about the single biggest role model for two entire generations of swing dancers. (both in the 40’s and in current.) And to top it all off, you’re just a nice, normal and humble guy.

Rest in peace, and it’s an honor to have met you, studied under your wing, and just to know you. Thank you for inspiring me.

One of the many frankie bios.

tony fraser

No Comments

The 60’s are gone — The fall of the traditional American advertising industry

What is an “ad man” anyway?

Well, I think we all know what it used to be. The ad man used to be the guy with the big idea. It was the guy who could churn out the great campaigns and make millions of dollars for a client. He was a slickster for sure, he could go out for golf and come back with a a signed contract for a million bucks.

Well, not much has changed since then, at least in the USA. We still operate that same way.

But, something bigger than the USA has changed the landscape, and it’s going to/already is sending US advertising into a tail spin. It’s called global competition. We may be the country that built up the advertising business, but I doubt we can compete doing it the way our great founders wanted us to.

Simply stated, we as an industry will reach equilibrium with the rest of the world. More and more money will flow out out the United States and into the smaller more agile shops of the globe. Yes, this sucks, but times change.

I suppose the single biggest gripe I have about advertising in the USA is efficiency. And I believe if we as an industry could just get our head around it and start thinking and working differently, we could at least buy time to see where the industry itself goes.

Advertising pretty much works like this. An exec lands the deal, throws it over to a project manager, who throws it over to an up and coming senior project manager to manage, who throws it over to a lower level project manager for details. It’s like a training system built into the industry. All aspects of work pretty much happen the same way, from creative, to technology, to operations, etc. Basically, it’s passed around like a hot potato, and nobody seems to want to stop and just make sure it gets done right. After the project changes hands, it usually ends up going out the door in not the most suitable way for the client, well, at least a significant portion of the time. To me, the whole thing is like a big giant game of telephone.

If it’s a half a million dollar deal, what part of that is actually used to do work, and what part of that is simply wasted passing things back and forth? My guess is that on average at least 1/3rd the cost of a standard ticket is just because of communication inefficiency.

Of course we really can’t quantify that unless we have a control group to test against. And that of course isn’t a billable project so I doubt we’d ever do it. I suppose that leaves the responsibility of those tests to the MNC’s of the globe who feel quite confident incubating an international advertising system. Wait. So are we just going to wait for the clients to tell us they have other alternatives?

Maybe the inefficiency isn’t that big of a deal for just one or two projects, but take say 50 of these projects for a monster client. You don’t think they are going to notice? You don’t think they will start to wonder exactly where their money goes and demanding all sorts of accountability? You don’t think they’re smart enough to know that the people in dozens of 5$ a day labor places that can use quark and photoshop as well as we can here in NYC for 100$?

So who are the modern ad men? I believe the they are the guys devote everything they have into cleaning up what we already do. Those are the guys who will do whatever it takes to 500k project by 1/3rd. Those are the guys that will flatten and embrace individual members as part of a team, even though those team members live in other parts of the world. They’re the guys that are striving to automate everything they can. And lastly, the future ad men are the guys who can speak any language with no communication barriers or telephone games, to everybody.

There will be a dawn shortly, when the experience of all the technology the world has will infuse into advertising, streamline their processes, and possibly reduce costs by as much as half. Or, we’ll go under.

No Comments

Board Jockeys

Not too long ago, like everybody else, I was out of a job. It didn’t take me long to find something, but during that time of looking, I posted my resume just about everywhere. It was a good resume, it showed a bunch of senior exec leadership, and a history of close to two decades worth of technology industry experience.

Because of that last search and those last posted resumes, I am now bombarded with a daily list of at least half a dozen offers to interview for, say, an entry level tech support position, a windows DBA, or perhaps a c# programming job. All you who know me know that’s simply not something I’m going to do.

Nate Heasley, a friend of mine from the Bond Street Group, coined the term “board jockey” to me once. To him a board jockey is a bad recruiter that just watches indeed.com, slams whatever req he can find into one of the resume banks like career builder or monster, and almost randomly fires off emails to thousands of people hoping that somebody will bite.

It’s a mentality, a board jockey thinks that because they happen to know a position somewhere in the country is looking for somebody, that I will be interested in the job, perhaps even if perhaps it only pays 35k a year. And of course they always start there letters with “I saw your resume and think you’d be a great candidate for this job we have” though I know they didn’t actually look at my resume.

Look, recruiting may be dog eat dog, but there’s only one way to do it. A good recruiter is a master matchmaker. Job description and experience are one filter, but the most important one is always fit, and you’re just not going to get that from a computer screen.

I’ve decided to start keeping an ongoing list of recruiting firms to not work with, because they employ board jockeys. I can’t stand any of these guys, and I just can’t seem to shake my email address out of email lists.

Watch this thread as time goes on, it’ll grow.
Post some of your own!

1 Comment

Here comes the Fozlock!

My manufacturing operation is coming together. The first prototypes are due in a few weeks and I have a world class designer working on the front end of the website. Stay tuned to http://www.fozlock.com.  I can’t wait to see what he come up with.

FYI, this invention received a full patent, and won the Best In Show award at the biggest inventor’s convention in the USA, Inventbay.

No Comments