<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
		>
<channel>
	<title>Comments for Coders Like Us</title>
	<atom:link href="http://coderslike.us/comments/feed/" rel="self" type="application/rss+xml" />
	<link>http://coderslike.us</link>
	<description>Things I've learned and stuff I'm thinking about.</description>
	<lastBuildDate>Tue, 09 Mar 2010 22:02:37 +0000</lastBuildDate>
	<generator>http://wordpress.com/</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>Comment on Persistent Counters in SimpleDB by Kays Eware &#124; Internet Marketing Software/ eBooks and Blue Prints</title>
		<link>http://coderslike.us/2010/03/09/persistent-counters-in-simpledb/#comment-546</link>
		<dc:creator>Kays Eware &#124; Internet Marketing Software/ eBooks and Blue Prints</dc:creator>
		<pubDate>Tue, 09 Mar 2010 22:02:37 +0000</pubDate>
		<guid isPermaLink="false">http://coderslike.us/?p=351#comment-546</guid>
		<description>[...] Persistent Counters in SimpleDB &#171; Coders Like Us [...]</description>
		<content:encoded><![CDATA[<p>[...] Persistent Counters in SimpleDB &laquo; Coders Like Us [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Amazon EC2 &#8211; Boot from EBS and AMI conversion by Dean Thompson</title>
		<link>http://coderslike.us/2009/12/07/amazon-ec2-boot-from-ebs-and-ami-conversion/#comment-545</link>
		<dc:creator>Dean Thompson</dc:creator>
		<pubDate>Mon, 01 Mar 2010 18:02:30 +0000</pubDate>
		<guid isPermaLink="false">http://coderslike.us/?p=301#comment-545</guid>
		<description>For anyone it may help, here&#039;s the shell script that I created from this post.

I have not tested this shell script as a complete end-to-end run!  I just assembled the shell script as I typed the commands individually in a shell.  I don&#039;t know when I&#039;ll need to convert other AMIs, so I decided to go ahead and post this draft script now instead of in the never-never.

This is a much more literal interpretation of the article than the script posted by George.

#! /bin/ksh

# Script based on dkavanagh&#039;s blog entry:
# http://coderslike.us/2009/12/07/amazon-ec2-boot-from-ebs-and-ami-conversion/

AMI_ID=&quot;$0&quot;
NEW_AMI_DESCRIPTION=&quot;$1&quot;
EBS_DEV=&quot;$2&quot;
ACCESS_ID=&quot;$3&quot;
SECRET_KEY=&quot;$4&quot;
KEY_FILE=&quot;$5&quot;
CERT_FILE=&quot;$6&quot;

# Using the AMI ID, get the manifest name and architecture

AMI_DESC=`$EC2_HOME/bin/ec2dim &#124;grep $AMI_ID`
MANIFEST=`echo $AMI_DESC &#124; awk &#039;{ print $3 }&#039;`
ARCH=`echo $AMI_DESC &#124; awk &#039;{ print $7 }&#039;`
MANIFEST_PATH=`dirname $MANIFEST`/
MANIFEST_PREFIX=`basename $MANIFEST &#124; awk -F. &#039;{ print $1 }&#039;`

# Download the bundle to /mnt

BUNDLE_DIR=/mnt/convertS3AmiToEbs
echo grabbing bundle $MANIFEST_PATH $MANIFEST_PREFIX
rm -rf $BUNDLE_DIR
mkdir $BUNDLE_DIR
$EC2_AMITOOL_HOME/bin/ec2-download-bundle -b $MANIFEST_PATH -a $ACCESS_ID -s $SECRET_KEY -k $KEY_FILE -p $MANIFEST_PREFIX -d $BUNDLE_DIR

# Unbundle the image into a single (rather large) file.

echo unbundling, this will take a while
$EC2_AMITOOL_HOME/bin/ec2-unbundle -k $KEY_FILE -m $BUNDLE_DIR/$MANIFEST_PREFIX.manifest.xml -s $BUNDLE_DIR -d $BUNDLE_DIR

# Create an EBS volume, 10 GB. This size is used because that is the largest size for an S3 based AMI.

ZONE=`curl --silent --retry 0 http://169.254.169.254/latest/meta-data/placement/availability-zone`
VOL_ID=`$EC2_HOME/bin/ec2addvol -s 50 -z $ZONE &#124; awk &#039;{ print $2 }&#039;`
STATUS=creating
while [[ $STATUS != &quot;available&quot; ]]
do
echo volume $STATUS, waiting for volume create...
sleep 3
STATUS=`$EC2_HOME/bin/ec2dvol $VOL_ID &#124; awk &#039;{ print $5 }&#039;`
done

# Attach the volume

INST_ID=`curl --silent http://169.254.169.254/latest/meta-data/instance-id`
$EC2_HOME/bin/ec2attvol $VOL_ID -i $INST_ID -d $EBS_DEV

# Here’s where we turn the image into a real volume, using our old friend dd

echo copying image to volume, this will also take a while
dd if=$BUNDLE_DIR/$MANIFEST_PREFIX of=$EBS_DEV

# Mount the volume and remove ephemeral store entry from /etc/fstab.
# This is required because “Boot from EBS” doesn’t use the ephemeral store by default.

MOUNT_POINT=/convertS3AmiToEbs

mkdir $MOUNT_POINT
mount $EBS_DEV $MOUNT_POINT
cat $MOUNT_POINT/etc/fstab &#124; grep -v mnt &gt; /tmp/fstab
mv $MOUNT_POINT/etc/fstab $MOUNT_POINT/etc/fstab.bak
mv /tmp/fstab $MOUNT_POINT/etc/

# Unmount and detach the volume.

umount $MOUNT_POINT
$EC2_HOME/bin/ec2detvol $VOL_ID -i $INST_ID

# Create a snapshot and wait for it to complete.

SNAP_ID=`$EC2_HOME/bin/ec2addsnap $VOL_ID -d &quot;created by convertS3AmiToEbs.sh&quot; &#124; awk &#039;{ print $2 }&#039;`
# now, wait for it
STATUS=pending
while [[ $STATUS != &quot;completed&quot; ]]
do
echo volume $STATUS, waiting for snap complete...
sleep 3
STATUS=`$EC2_HOME/bin/ec2dsnap $SNAP_ID &#124; awk &#039;{ print $4 }&#039;`
done

# delete the volume and register the snapshot

$EC2_HOME/bin/ec2delvol $VOL_ID
$EC2_HOME/bin/ec2reg -C $CERT_FILE -K $KEY_FILE -s $SNAP_ID -a $ARCH -d &quot;$NEW_AMI_DESCRIPTION&quot; -n $MANIFEST_PREFIX</description>
		<content:encoded><![CDATA[<p>For anyone it may help, here&#8217;s the shell script that I created from this post.</p>
<p>I have not tested this shell script as a complete end-to-end run!  I just assembled the shell script as I typed the commands individually in a shell.  I don&#8217;t know when I&#8217;ll need to convert other AMIs, so I decided to go ahead and post this draft script now instead of in the never-never.</p>
<p>This is a much more literal interpretation of the article than the script posted by George.</p>
<p>#! /bin/ksh</p>
<p># Script based on dkavanagh&#8217;s blog entry:<br />
# <a href="http://coderslike.us/2009/12/07/amazon-ec2-boot-from-ebs-and-ami-conversion/" rel="nofollow">http://coderslike.us/2009/12/07/amazon-ec2-boot-from-ebs-and-ami-conversion/</a></p>
<p>AMI_ID=&#8221;$0&#8243;<br />
NEW_AMI_DESCRIPTION=&#8221;$1&#8243;<br />
EBS_DEV=&#8221;$2&#8243;<br />
ACCESS_ID=&#8221;$3&#8243;<br />
SECRET_KEY=&#8221;$4&#8243;<br />
KEY_FILE=&#8221;$5&#8243;<br />
CERT_FILE=&#8221;$6&#8243;</p>
<p># Using the AMI ID, get the manifest name and architecture</p>
<p>AMI_DESC=`$EC2_HOME/bin/ec2dim |grep $AMI_ID`<br />
MANIFEST=`echo $AMI_DESC | awk &#8216;{ print $3 }&#8217;`<br />
ARCH=`echo $AMI_DESC | awk &#8216;{ print $7 }&#8217;`<br />
MANIFEST_PATH=`dirname $MANIFEST`/<br />
MANIFEST_PREFIX=`basename $MANIFEST | awk -F. &#8216;{ print $1 }&#8217;`</p>
<p># Download the bundle to /mnt</p>
<p>BUNDLE_DIR=/mnt/convertS3AmiToEbs<br />
echo grabbing bundle $MANIFEST_PATH $MANIFEST_PREFIX<br />
rm -rf $BUNDLE_DIR<br />
mkdir $BUNDLE_DIR<br />
$EC2_AMITOOL_HOME/bin/ec2-download-bundle -b $MANIFEST_PATH -a $ACCESS_ID -s $SECRET_KEY -k $KEY_FILE -p $MANIFEST_PREFIX -d $BUNDLE_DIR</p>
<p># Unbundle the image into a single (rather large) file.</p>
<p>echo unbundling, this will take a while<br />
$EC2_AMITOOL_HOME/bin/ec2-unbundle -k $KEY_FILE -m $BUNDLE_DIR/$MANIFEST_PREFIX.manifest.xml -s $BUNDLE_DIR -d $BUNDLE_DIR</p>
<p># Create an EBS volume, 10 GB. This size is used because that is the largest size for an S3 based AMI.</p>
<p>ZONE=`curl &#8211;silent &#8211;retry 0 <a href="http://169.254.169.254/latest/meta-data/placement/availability-zone" rel="nofollow">http://169.254.169.254/latest/meta-data/placement/availability-zone</a>`<br />
VOL_ID=`$EC2_HOME/bin/ec2addvol -s 50 -z $ZONE | awk &#8216;{ print $2 }&#8217;`<br />
STATUS=creating<br />
while [[ $STATUS != "available" ]]<br />
do<br />
echo volume $STATUS, waiting for volume create&#8230;<br />
sleep 3<br />
STATUS=`$EC2_HOME/bin/ec2dvol $VOL_ID | awk &#8216;{ print $5 }&#8217;`<br />
done</p>
<p># Attach the volume</p>
<p>INST_ID=`curl &#8211;silent <a href="http://169.254.169.254/latest/meta-data/instance-id" rel="nofollow">http://169.254.169.254/latest/meta-data/instance-id</a>`<br />
$EC2_HOME/bin/ec2attvol $VOL_ID -i $INST_ID -d $EBS_DEV</p>
<p># Here’s where we turn the image into a real volume, using our old friend dd</p>
<p>echo copying image to volume, this will also take a while<br />
dd if=$BUNDLE_DIR/$MANIFEST_PREFIX of=$EBS_DEV</p>
<p># Mount the volume and remove ephemeral store entry from /etc/fstab.<br />
# This is required because “Boot from EBS” doesn’t use the ephemeral store by default.</p>
<p>MOUNT_POINT=/convertS3AmiToEbs</p>
<p>mkdir $MOUNT_POINT<br />
mount $EBS_DEV $MOUNT_POINT<br />
cat $MOUNT_POINT/etc/fstab | grep -v mnt &gt; /tmp/fstab<br />
mv $MOUNT_POINT/etc/fstab $MOUNT_POINT/etc/fstab.bak<br />
mv /tmp/fstab $MOUNT_POINT/etc/</p>
<p># Unmount and detach the volume.</p>
<p>umount $MOUNT_POINT<br />
$EC2_HOME/bin/ec2detvol $VOL_ID -i $INST_ID</p>
<p># Create a snapshot and wait for it to complete.</p>
<p>SNAP_ID=`$EC2_HOME/bin/ec2addsnap $VOL_ID -d &#8220;created by convertS3AmiToEbs.sh&#8221; | awk &#8216;{ print $2 }&#8217;`<br />
# now, wait for it<br />
STATUS=pending<br />
while [[ $STATUS != "completed" ]]<br />
do<br />
echo volume $STATUS, waiting for snap complete&#8230;<br />
sleep 3<br />
STATUS=`$EC2_HOME/bin/ec2dsnap $SNAP_ID | awk &#8216;{ print $4 }&#8217;`<br />
done</p>
<p># delete the volume and register the snapshot</p>
<p>$EC2_HOME/bin/ec2delvol $VOL_ID<br />
$EC2_HOME/bin/ec2reg -C $CERT_FILE -K $KEY_FILE -s $SNAP_ID -a $ARCH -d &#8220;$NEW_AMI_DESCRIPTION&#8221; -n $MANIFEST_PREFIX</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on How to find that sqlite file behind your CoreData by Kalle</title>
		<link>http://coderslike.us/2009/06/11/how-to-find-that-sqlite-file-behind-your-coredata/#comment-544</link>
		<dc:creator>Kalle</dc:creator>
		<pubDate>Thu, 25 Feb 2010 16:15:36 +0000</pubDate>
		<guid isPermaLink="false">http://coderslike.us/?p=222#comment-544</guid>
		<description>Thanks a lot! I&#039;d seen this elsewhere but couldn&#039;t figure out where. Rock on.</description>
		<content:encoded><![CDATA[<p>Thanks a lot! I&#8217;d seen this elsewhere but couldn&#8217;t figure out where. Rock on.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Eventually Consistent, or Immediately with SimpleDB by dkavanagh</title>
		<link>http://coderslike.us/2010/02/25/eventually-consistent-or-immediately-with-simpledb/#comment-543</link>
		<dc:creator>dkavanagh</dc:creator>
		<pubDate>Thu, 25 Feb 2010 02:41:20 +0000</pubDate>
		<guid isPermaLink="false">http://coderslike.us/?p=343#comment-543</guid>
		<description>Rom,
You always need to get a Domain object to work with, but you can keep re-using it as much as you like. There is no state held there. You can call one Domain object from separate threads with no side effects.</description>
		<content:encoded><![CDATA[<p>Rom,<br />
You always need to get a Domain object to work with, but you can keep re-using it as much as you like. There is no state held there. You can call one Domain object from separate threads with no side effects.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Eventually Consistent, or Immediately with SimpleDB by Rom</title>
		<link>http://coderslike.us/2010/02/25/eventually-consistent-or-immediately-with-simpledb/#comment-542</link>
		<dc:creator>Rom</dc:creator>
		<pubDate>Thu, 25 Feb 2010 02:32:15 +0000</pubDate>
		<guid isPermaLink="false">http://coderslike.us/?p=343#comment-542</guid>
		<description>Hello,

I wasn&#039;t sure how to contact you, so I&#039;m posting here. I just started looking into your java simple db project (typica) and I was hoping you could answer one question for me. I would like to make one query to get all the attributes for a filtered set of items for one domain. It seems that using the typica simple db api, I&#039;d have to make two calls - one to get the domain, and then the call to get the items with attributes. 

Is there a way to just make one query call and get the items I&#039;m looking for?

Thanks,
Rom</description>
		<content:encoded><![CDATA[<p>Hello,</p>
<p>I wasn&#8217;t sure how to contact you, so I&#8217;m posting here. I just started looking into your java simple db project (typica) and I was hoping you could answer one question for me. I would like to make one query to get all the attributes for a filtered set of items for one domain. It seems that using the typica simple db api, I&#8217;d have to make two calls &#8211; one to get the domain, and then the call to get the items with attributes. </p>
<p>Is there a way to just make one query call and get the items I&#8217;m looking for?</p>
<p>Thanks,<br />
Rom</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Finding freed/deallocated instances of objects by Chris Palmer</title>
		<link>http://coderslike.us/2009/05/05/finding-freeddeallocated-instances-of-objects/#comment-520</link>
		<dc:creator>Chris Palmer</dc:creator>
		<pubDate>Fri, 29 Jan 2010 21:31:20 +0000</pubDate>
		<guid isPermaLink="false">http://coderslike.us/?p=184#comment-520</guid>
		<description>Hi ! I am confused when I run 

info malloc-history 9430 0x50dedd0
A syntax error near end of expression.

From the gdb prompt I get an error report? It doesn&#039;t understand this command.

Normally I run &quot;shell malloc_history pid mem&quot;

Do I need to tell gdb to be in some mode?</description>
		<content:encoded><![CDATA[<p>Hi ! I am confused when I run </p>
<p>info malloc-history 9430 0&#215;50dedd0<br />
A syntax error near end of expression.</p>
<p>From the gdb prompt I get an error report? It doesn&#8217;t understand this command.</p>
<p>Normally I run &#8220;shell malloc_history pid mem&#8221;</p>
<p>Do I need to tell gdb to be in some mode?</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on A Unique Method of Authenticating against App-Managed Userlist by aikhan</title>
		<link>http://coderslike.us/2010/01/14/a-unique-method-of-authenticating-against-app-managed-userlist/#comment-518</link>
		<dc:creator>aikhan</dc:creator>
		<pubDate>Sun, 17 Jan 2010 11:24:07 +0000</pubDate>
		<guid isPermaLink="false">http://coderslike.us/?p=325#comment-518</guid>
		<description>interesting</description>
		<content:encoded><![CDATA[<p>interesting</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Query Tool for Amazon SimpleDB by PC</title>
		<link>http://coderslike.us/2009/04/15/query-tool-for-amazon-simpledb/#comment-517</link>
		<dc:creator>PC</dc:creator>
		<pubDate>Fri, 15 Jan 2010 08:43:34 +0000</pubDate>
		<guid isPermaLink="false">http://coderslike.us/?p=159#comment-517</guid>
		<description>Funny how after you post, you find the solution to your problem.

So it was user error partially.

Backticks are required around the domain name. 

The reason why my queries weren&#039;t executing was because I had them ending in a semi-colon (habit from years of demarcating sql this way). The ending semi-colon caused it not to run correctly.</description>
		<content:encoded><![CDATA[<p>Funny how after you post, you find the solution to your problem.</p>
<p>So it was user error partially.</p>
<p>Backticks are required around the domain name. </p>
<p>The reason why my queries weren&#8217;t executing was because I had them ending in a semi-colon (habit from years of demarcating sql this way). The ending semi-colon caused it not to run correctly.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Query Tool for Amazon SimpleDB by PC</title>
		<link>http://coderslike.us/2009/04/15/query-tool-for-amazon-simpledb/#comment-516</link>
		<dc:creator>PC</dc:creator>
		<pubDate>Fri, 15 Jan 2010 08:39:58 +0000</pubDate>
		<guid isPermaLink="false">http://coderslike.us/?p=159#comment-516</guid>
		<description>Cool tool. I got some basic stuff working. However, I&#039;m trying to use it with some domains autocreated by SimpleJPA and they have the name format &quot;MyDB-Users&quot;;

i&#039;ve tried

select * from MyDB-Users
select * from `MyDB-Users`

and single/double quotes. None of them work. I&#039;m guessing the dash is the problem (which is automatically inserted by simplejpa) but the backtick should still work. I&#039;m guessing this isn&#039;t built it. Or maybe this is just a serious case of user error.</description>
		<content:encoded><![CDATA[<p>Cool tool. I got some basic stuff working. However, I&#8217;m trying to use it with some domains autocreated by SimpleJPA and they have the name format &#8220;MyDB-Users&#8221;;</p>
<p>i&#8217;ve tried</p>
<p>select * from MyDB-Users<br />
select * from `MyDB-Users`</p>
<p>and single/double quotes. None of them work. I&#8217;m guessing the dash is the problem (which is automatically inserted by simplejpa) but the backtick should still work. I&#8217;m guessing this isn&#8217;t built it. Or maybe this is just a serious case of user error.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Amazon EC2 &#8211; Boot from EBS and AMI conversion by KDOgg</title>
		<link>http://coderslike.us/2009/12/07/amazon-ec2-boot-from-ebs-and-ami-conversion/#comment-515</link>
		<dc:creator>KDOgg</dc:creator>
		<pubDate>Thu, 14 Jan 2010 16:52:48 +0000</pubDate>
		<guid isPermaLink="false">http://coderslike.us/?p=301#comment-515</guid>
		<description>Ah, I see.

After more time passed, I re-googled the situation and found another approach. Please see
http://www.elastician.com/2009/12/creating-ebs-backed-ami-from-s3-backed.html
and see a comment from 2010-01-01 from &quot;Anonymous&quot; where the first unix command given is...
dd bs=65536 if=/dev/sda1 of=/dev/sdb1

I thought that approach had promise, because all the commands that needed to happen on the running unix instance were kinda native-OS stuff. Didn&#039;t need to install the AWS stuff, didn&#039;t need AWS-related env variables (I have those on my *local* machine, but usually not on my running AWS instances). Sure, a minor point, but it has only the stuff *I* need it to have, to do the job *I&#039;ve* defined for it. Keeps things simpler for me, and let&#039;s face it, I ain&#039;t too bright.

End result, it was fewer steps, worked pretty much on the first try except the author spelled one command &quot;unmount&quot; instead of &quot;umount&quot;.</description>
		<content:encoded><![CDATA[<p>Ah, I see.</p>
<p>After more time passed, I re-googled the situation and found another approach. Please see<br />
<a href="http://www.elastician.com/2009/12/creating-ebs-backed-ami-from-s3-backed.html" rel="nofollow">http://www.elastician.com/2009/12/creating-ebs-backed-ami-from-s3-backed.html</a><br />
and see a comment from 2010-01-01 from &#8220;Anonymous&#8221; where the first unix command given is&#8230;<br />
dd bs=65536 if=/dev/sda1 of=/dev/sdb1</p>
<p>I thought that approach had promise, because all the commands that needed to happen on the running unix instance were kinda native-OS stuff. Didn&#8217;t need to install the AWS stuff, didn&#8217;t need AWS-related env variables (I have those on my *local* machine, but usually not on my running AWS instances). Sure, a minor point, but it has only the stuff *I* need it to have, to do the job *I&#8217;ve* defined for it. Keeps things simpler for me, and let&#8217;s face it, I ain&#8217;t too bright.</p>
<p>End result, it was fewer steps, worked pretty much on the first try except the author spelled one command &#8220;unmount&#8221; instead of &#8220;umount&#8221;.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
