Before continuing with a development environment setup, a set of security credentials were first created using the Amazon AWS Console. From the user menu in the toolbar, select the Security Credentials option.
There are options for generating various types of identity credentials:
Not really knowing what I will need first (and ignoring the basic security tenet of only generating what you need when you need it), I generated credentials in all three categories, and saved them off to a safe place. Finally, I used the PUTTYGEN tool to convert the Key Pair into something that will work with the PUTTY suite of tools. Its a fairly simple matter to import the *.pem file you created and
convert it to a PUTTY-friendly *.ppk file (also saved off to a safe
place).
Now equipped with an account and a plethora of security credentials, I think I have the bare minimum requirements in place for moving forward.
My hobby notebook, infrequently used. This is primarily to clean off my desktop, but if someone else can make use of any of it, all the better...
Tuesday, April 30, 2013
Monday, April 29, 2013
Creating a new Amazon AWS Account
Continuing along with my journey into the cloud, I spent 10 minutes creating a new Amazon AWS account. I started with a link for Try Cloud Computing Free and pressed the easy button:
If you've ever created an account, well anywhere, this process should be fairly old hat. Even though you are signing up for a free trial account, you do need to provide a credit card (in case you go over the free limits). There was one additional step which was unusual: confirming your phone number. Amazon generates a one-time PIN and calls your number from an automated system to verify you - after punching in the PIN, you continue on your merry way:
A few minutes later I received the "all done" email:
and my account setup was complete. A quick trip to Amazon AWS and I logged in to the account console without issue:
Now that I have an account and EC2 tools installed locally, my next steps will be getting a local build environment up and running. To be continued...
If you've ever created an account, well anywhere, this process should be fairly old hat. Even though you are signing up for a free trial account, you do need to provide a credit card (in case you go over the free limits). There was one additional step which was unusual: confirming your phone number. Amazon generates a one-time PIN and calls your number from an automated system to verify you - after punching in the PIN, you continue on your merry way:
A few minutes later I received the "all done" email:
and my account setup was complete. A quick trip to Amazon AWS and I logged in to the account console without issue:
Now that I have an account and EC2 tools installed locally, my next steps will be getting a local build environment up and running. To be continued...
Sunday, April 28, 2013
Downloading the Amazon EC2 Tools
We at Spare Time Notebook have been sleeping on this cloud thing for far too long; not ignoring it per se, just, well, not really needing it. With the cost of hardware dropping through the floor as of late, its hard to let go of old habits (just buy another box) and embrace the new world.
Those lazy habits end today, as I delve into Amazon's EC2 offering. I'll be documenting my progress/lessons learned as I go, and since time is tight, will be posting my education in pieces.
Today's effort is about as basic as possible - getting the tools loaded on my development workstation (who knows, maybe someday the math will work and my local workstation will be retired, and instead live in the cloud, only to be spawned when needed). After a query to the friendly neighborhood google, I had an official link for Setting Up the Amazon EC2 Command Line Interface Tools. This set of directions had a link to the latest download distribution (currently 1.6.7.2):
The download is fairly small (14meg), and was unzipped into my tools directory like any other java distribution:
I'll spend some time researching the task of building an appropriate command line environment and establishing proper credentials to the Amazon infrastructure and post again after I know what I should be doing.
Those lazy habits end today, as I delve into Amazon's EC2 offering. I'll be documenting my progress/lessons learned as I go, and since time is tight, will be posting my education in pieces.
Today's effort is about as basic as possible - getting the tools loaded on my development workstation (who knows, maybe someday the math will work and my local workstation will be retired, and instead live in the cloud, only to be spawned when needed). After a query to the friendly neighborhood google, I had an official link for Setting Up the Amazon EC2 Command Line Interface Tools. This set of directions had a link to the latest download distribution (currently 1.6.7.2):
The download is fairly small (14meg), and was unzipped into my tools directory like any other java distribution:
I'll spend some time researching the task of building an appropriate command line environment and establishing proper credentials to the Amazon infrastructure and post again after I know what I should be doing.
Saturday, April 20, 2013
How to modify MAX_ALLOWED_PACKET in MySQL
While working with BLOB/CLOB fields in MySQL, it won't take long to encounter the following issue during a DML statement:
Packets larger than max_allowed_packet are not allowed.
Using the following command:
You can see that the networking parameter MAX_ALLOWED_PACKET defaults to 1048576 (1MB). Since a 1MB BLOB file is fairly paltry, the parameter must be updated to a more reasonable value. Logged in as root (or similarly admin'ed user), issue the following command to modify the parameter:
GLOBAL refers to the sessions which are effected by the call; meaning that all sessions will now honor the new 16MB limit. However, there is a catch. At this point, the change is not persistent (see notes that this is not a bug). A recycle of the service will reset the value back to the original 1MB setting.
To permanently change the value, the my.ini configuration file must be altered; mileage may vary on the location of said file (install location, OS, etc., etc.), but in my case, the file lives in C:\Users\chris\Development\mysql\my.ini. Find the mysqld section, and add a line for the setting:
Save the file and restart the MySQL service. The value should now be permanent.
Packets larger than max_allowed_packet are not allowed.
Using the following command:
SHOW VARIABLES LIKE ‘max_allowed_packet’;You can see that the networking parameter MAX_ALLOWED_PACKET defaults to 1048576 (1MB). Since a 1MB BLOB file is fairly paltry, the parameter must be updated to a more reasonable value. Logged in as root (or similarly admin'ed user), issue the following command to modify the parameter:
SET GLOBAL max_allowed_packet = 16 * 1024 * 1024;GLOBAL refers to the sessions which are effected by the call; meaning that all sessions will now honor the new 16MB limit. However, there is a catch. At this point, the change is not persistent (see notes that this is not a bug). A recycle of the service will reset the value back to the original 1MB setting.
To permanently change the value, the my.ini configuration file must be altered; mileage may vary on the location of said file (install location, OS, etc., etc.), but in my case, the file lives in C:\Users\chris\Development\mysql\my.ini. Find the mysqld section, and add a line for the setting:
[mysqld]
# ADDED BY CHRIS ON 20 APRIL 2013
max_allowed_packet=16M
Save the file and restart the MySQL service. The value should now be permanent.
Saturday, March 2, 2013
Quicken 2013 bugs and annoyances
It has been three years since my last Quicken update, and due to the upgrade blackmail that Intuit has in place (stopping support for online transactions after three years), I again found myself in the position of needing to upgrade. The deluxe version of any given year always seems to provide everything I need in a "home accounting package", and the $30 is not overly burdensome on the home budget; Its really just the principal of the whole forced upgrade that rubs me wrong. I really should spend the time and migrate to an online solution, but now that Intuit owns Mint.com as well, I'm really not sure its worth the hassle and extra risk of keeping everything online.
Like most purchases these days, I purchased the product through Amazon.com, and this time there was even an option to download the binaries directly from amazon (ie - no DVD to collect dust on my desktop). The opinions on amazon for this 2013 upgrade have been fairly abysmal; lots of problems, bugs, etc. Generally speaking the product has not changed significantly this century, so it always surprises me how many bugs they can introduce in any given release; perhaps they need to upgrade the college interns they have working on their baseline.
As luck would have it, I waited until the very end of my Quicken 2010 lifespan before upgrading, which seems to have been prudent again; the amazon download started me out on release 10 (r10) of Quicken 2013, and within a few days, there has already been an r11. Again, on a product that has basically been a static release for 20+ years, I'm not sure how they manage to create so many darn bugs.
My upgrade seems to have gone smoother than most (and that I attribute to starting on the 10th revision of their software). There was one annoyance I encountered: after upgrading, when I performed "One Step Update" to sync my accounts, I saw two accounts in the list have been gone and disabled for years that had magically come back to life.
After a bit of digging, I found the workaround on the Quicken support site:
How to Remove a Bank Name from One Step Update Settings
Walking through these steps successfully removed my old accounts, but I'm still a bit miffed over the fact that the upgrade re-introduced old accounts into my update settings...
Like most purchases these days, I purchased the product through Amazon.com, and this time there was even an option to download the binaries directly from amazon (ie - no DVD to collect dust on my desktop). The opinions on amazon for this 2013 upgrade have been fairly abysmal; lots of problems, bugs, etc. Generally speaking the product has not changed significantly this century, so it always surprises me how many bugs they can introduce in any given release; perhaps they need to upgrade the college interns they have working on their baseline.
As luck would have it, I waited until the very end of my Quicken 2010 lifespan before upgrading, which seems to have been prudent again; the amazon download started me out on release 10 (r10) of Quicken 2013, and within a few days, there has already been an r11. Again, on a product that has basically been a static release for 20+ years, I'm not sure how they manage to create so many darn bugs.
My upgrade seems to have gone smoother than most (and that I attribute to starting on the 10th revision of their software). There was one annoyance I encountered: after upgrading, when I performed "One Step Update" to sync my accounts, I saw two accounts in the list have been gone and disabled for years that had magically come back to life.
After a bit of digging, I found the workaround on the Quicken support site:
How to Remove a Bank Name from One Step Update Settings
Walking through these steps successfully removed my old accounts, but I'm still a bit miffed over the fact that the upgrade re-introduced old accounts into my update settings...
Sunday, February 10, 2013
Interrupting a Thread in Java 7
In order to construct a well-behaved server class in Java, a few key pieces are required. While researching this topic, I've discovered that there are n developers in the world working with Java concurrency and there are at least (n+1) opinions on the "proper way" to do this. I've leveraged what seems to be the most common implementation guidelines and came up with the following example.
A few general notes:
CONSOLE OUTPUT:
Jumping first to the summary, here is the program execution. You can see the server start, launch the worker thread, let it run for a short time, then signal the worker to stop. All appears in order and working well.
APPLICATION CLASS:
Nothing too exciting to discuss here... The main driver class to launch the example.
WORKER CLASS:
Here is the worker, a subclass of Thread. This could be done by implementing a Runnable instead, but I find the Thread extension cleaner to read - mileage may vary based on personal preferences. The worker does not perform any real work, but just dumps the message "worker thread performs work" to the console, then suspends.
SERVER CLASS:
Here is the implementation of the server (in order to keep the snapshot a bit cleaner, the shutdown method was extracted). There are basic methods for startup and shutdown, as well as a simulate method which simulates work by for waiting for a short time.
SERVER SHUTDOWN METHOD:
This is the key to the whole process of stopping. When the server shuts down, the worker thread needs to be asked to stop as well. The server then waits for the worker to stop and then continues on with its own cleanup. This method is really where implementations will tend to differ, based on what the worker thread is doing as well as the nature of the server itself. You can use workerThread.join() to wait forever, but if the worker thread is hung, your server will never return. This is one of those instances where you'll just need to apply best engineering judgement based on specifics to your application.
While researching Java concurrency, I did not find many full examples online; most tended to be snippets with too little, or full open source applications with too much. I hope this example application finds a balance of both and is of use to someone else.
A few general notes:
- there is much of anything in this example that is Java 7 specific, it just happens to be the version I'm using.
- since this site is hosted on blogger, and there are not too many good/convenient options for presenting source code, I've just posted screen snapshots of the code. My apologies for the laziness...
CONSOLE OUTPUT:
Jumping first to the summary, here is the program execution. You can see the server start, launch the worker thread, let it run for a short time, then signal the worker to stop. All appears in order and working well.
APPLICATION CLASS:
Nothing too exciting to discuss here... The main driver class to launch the example.
WORKER CLASS:
Here is the worker, a subclass of Thread. This could be done by implementing a Runnable instead, but I find the Thread extension cleaner to read - mileage may vary based on personal preferences. The worker does not perform any real work, but just dumps the message "worker thread performs work" to the console, then suspends.
SERVER CLASS:
Here is the implementation of the server (in order to keep the snapshot a bit cleaner, the shutdown method was extracted). There are basic methods for startup and shutdown, as well as a simulate method which simulates work by for waiting for a short time.
SERVER SHUTDOWN METHOD:
This is the key to the whole process of stopping. When the server shuts down, the worker thread needs to be asked to stop as well. The server then waits for the worker to stop and then continues on with its own cleanup. This method is really where implementations will tend to differ, based on what the worker thread is doing as well as the nature of the server itself. You can use workerThread.join() to wait forever, but if the worker thread is hung, your server will never return. This is one of those instances where you'll just need to apply best engineering judgement based on specifics to your application.
While researching Java concurrency, I did not find many full examples online; most tended to be snippets with too little, or full open source applications with too much. I hope this example application finds a balance of both and is of use to someone else.
Saturday, February 2, 2013
Updating UEFI BIOS Settings
Whenever Asus offers a motherboard BIOS update for my workstation, I usually need to rediscover the following settings which I inevitably forget to reset. One of these makes VMWare upset, causing it to throw warnings that lead to the following knowledge base note.
Note to self for the future:
Motherboard: Asus P8Z77-V Deluxe
Processor: Intel Core i7-3770K @ 3.50GHz
To update the BIOS, press F2 while rebooting to get into setup, and then switch to the advanced configuration mode screen. Modify the following settings:
Note to self for the future:
Motherboard: Asus P8Z77-V Deluxe
Processor: Intel Core i7-3770K @ 3.50GHz
To update the BIOS, press F2 while rebooting to get into setup, and then switch to the advanced configuration mode screen. Modify the following settings:
- Advanced | CPU Configuration | Intel Virtualization Technology [ENABLED]
- Monitor | CPU Fan Speed Low Limit [300RPM]
Subscribe to:
Posts (Atom)