My wife has been writing a blog about our family since 2008, but it's been over a year since she's made a new post. Since it was not being used much, I decided to save money on the server hosting the blog and move it over to Blogger. The old blog was running under our company's closed source CMS (PHP, MySQL) and hosted both posts and images (over 3600 of them).
I decided to upload all of them to Picasa and move the blog over to Blogger in a spare hour or two. The only reason I went with these is their simplicity and ease of use (from the user's perspective at least). It took somewhat more time than that and I've hit a few snags in the process, so I thought it was time for a new post while I was still hurting from the experience. ;)
About code conjured, technologies discovered, games designed and brick walls hit.
Showing posts with label PHP. Show all posts
Showing posts with label PHP. Show all posts
2012-06-27
2012-04-17
Static code analyzer for Torque 3D BitStreams
Some very crude code that finds out of balance objects in terms of server/client bit stream communication in the Torque 3D game engine. I know, exciting, right?!
2012-01-18
Embedding text-to-speech into HTML5 games
I admit that the title is a bit misleading, but it better describes the aim of my article. This write-up offers one solution with code snippets to the problem of embedding Google's TTS service into a HTML5 page.
The unofficial Google TTS "API" lets you turn text to speech in well over 20 languages. It is a part of Google Translate, and works with text less than 100 characters long. So - how can you technically make use of this service to provide a better user experience?
The unofficial Google TTS "API" lets you turn text to speech in well over 20 languages. It is a part of Google Translate, and works with text less than 100 characters long. So - how can you technically make use of this service to provide a better user experience?
2011-06-10
Saving on EC2 costs through uptime management
For EC2 instances Amazon bills you by the hour. If you are like us, and need a few servers to be "ready" at all times - not too many, not too few - then here's a quick tip, something simple you can do to save some money on your EC2 instance costs.
For every instance, you pay at launch for the coming hour and when you cross that hour, you pay for the next one in advance. This means that stopping and starting an instance will incur an additional hour's cost - depending on when your instance was launched.
If you have several instances and don't need all of them, you can check their uptimes and see which ones are likely to cross into their next hour without being utilized until and after they do. Say, if a server has been up for 55 minutes and it's not being used at the moment, it is less likely to be used in the remaining 5 minutes than one that still has 35 minutes to go from its actual uptime hour.
But here's some actual code (in PHP, requires AWSSDKforPHP set up). Call getSortedEdgeInstanceData() to receive an array of your running instances in the order they are going to turn over into their next billing hour. I imagined these instances that are likely to turn over as "being on the edge" - hence the function name.
It's a simple idea but the costs it saves you could mount up to be significant - depending on the number of instances you manage in an on-demand manner. Hope it helps you!
For every instance, you pay at launch for the coming hour and when you cross that hour, you pay for the next one in advance. This means that stopping and starting an instance will incur an additional hour's cost - depending on when your instance was launched.
If you have several instances and don't need all of them, you can check their uptimes and see which ones are likely to cross into their next hour without being utilized until and after they do. Say, if a server has been up for 55 minutes and it's not being used at the moment, it is less likely to be used in the remaining 5 minutes than one that still has 35 minutes to go from its actual uptime hour.
But here's some actual code (in PHP, requires AWSSDKforPHP set up). Call getSortedEdgeInstanceData() to receive an array of your running instances in the order they are going to turn over into their next billing hour. I imagined these instances that are likely to turn over as "being on the edge" - hence the function name.
It's a simple idea but the costs it saves you could mount up to be significant - depending on the number of instances you manage in an on-demand manner. Hope it helps you!
2011-06-07
EC2 snapshots as backups
Today I did something silly, and changed the password to one of our AWS EC2 Windows servers to an empty string. I was gonna change it in the same RDP session to a generated password, but somehow forgot about it. My connection broke up due to a timeout (of course) and upon my next login I got this love note:
Now, on one hand this is pretty cool, because it won't let me stupidly set no password on any of my instances. But it also pretty much means good-bye to that instance. Up until now, I have not found a way to change the administrator password say, through ec2config. So, I imagine the best I can do is make sure that this or something similar does not surprise me again.
Logon failure user account restriction. Possible reasons are blank passwords not allowed, logon hour restrictions, or a policy restriction has been enforced.
Now, on one hand this is pretty cool, because it won't let me stupidly set no password on any of my instances. But it also pretty much means good-bye to that instance. Up until now, I have not found a way to change the administrator password say, through ec2config. So, I imagine the best I can do is make sure that this or something similar does not surprise me again.
2011-06-02
Listing AWS EC2 instances in PHP
You'll probably see many small snippets from me here on this site that deal with tasks that come up when working with Amazon Web Services. This example is in PHP, but AWS has many APIs for a number of languages and platforms.
This is something simple, yet I thought it could be of use for someone working with Amazon's EC2 instances via PHP. It requires Amazon's AWSSDKforPHP, which is one of the best APIs for AWS to date in my humble opinion.
What this snippet does is it lists your EC2 instances with their Name tag and public dns name. It could be an example on how to iterate through the resulting object that the describe_instances method returns.
This is something simple, yet I thought it could be of use for someone working with Amazon's EC2 instances via PHP. It requires Amazon's AWSSDKforPHP, which is one of the best APIs for AWS to date in my humble opinion.
What this snippet does is it lists your EC2 instances with their Name tag and public dns name. It could be an example on how to iterate through the resulting object that the describe_instances method returns.
Subscribe to:
Posts (Atom)