<?xml version="1.0" encoding="UTF-8"?> <rss
version="2.0"
xmlns:content="http://purl.org/rss/1.0/modules/content/"
xmlns:wfw="http://wellformedweb.org/CommentAPI/"
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:slash="http://purl.org/rss/1.0/modules/slash/"
><channel><title>markomedia</title> <atom:link href="http://www.markomedia.com.au/feed/" rel="self" type="application/rss+xml" /><link>http://www.markomedia.com.au</link> <description>Web Development</description> <lastBuildDate>Fri, 10 Feb 2012 00:51:37 +0000</lastBuildDate> <language>en</language> <sy:updatePeriod>hourly</sy:updatePeriod> <sy:updateFrequency>1</sy:updateFrequency> <generator>http://wordpress.org/?v=3.3.1</generator> <item><title>IE6, IE7, IE8, &amp; IE9 on OS X in Virtual Machine</title><link>http://www.markomedia.com.au/osx/ie6-ie7-ie8-ie9/</link> <comments>http://www.markomedia.com.au/osx/ie6-ie7-ie8-ie9/#comments</comments> <pubDate>Fri, 10 Feb 2012 00:45:05 +0000</pubDate> <dc:creator>Marko Tomic</dc:creator> <category><![CDATA[OS X]]></category> <category><![CDATA[IE6]]></category> <category><![CDATA[IE7]]></category> <category><![CDATA[IE8]]></category> <category><![CDATA[IE9]]></category> <category><![CDATA[virtualbox]]></category><guid
isPermaLink="false">http://www.markomedia.com.au/?p=1903</guid> <description><![CDATA[Today I discovered a nice tool on Github which installs free Windows virtual machines using VirtualBox on OS X. The only reason I&#8217;d use these virtual machines is to have different versions of Internet Explorer browsers running side by side for testing purposes. So here&#8217;s what you need to do: 1. Download VirtualBox if you...]]></description> <content:encoded><![CDATA[<p>Today I discovered a <a
title="https://github.com/xdissent/ievms" href="https://github.com/xdissent/ievms">nice tool on Github</a> which installs free Windows virtual machines using VirtualBox on OS X. The only reason I&#8217;d use these virtual machines is to have different versions of Internet Explorer browsers running side by side for testing purposes.</p><p>So here&#8217;s what you need to do:<br
/> 1. <a
title="Virtual Box" href="http://www.virtualbox.org/wiki/Downloads">Download VirtualBox</a> if you don&#8217;t have it already.<br
/> 2. Choose what version of Internet Explorer to install. Then type the following commands in your terminal window:<br
/> <strong>Install ALL versions of Internet Explorer: IE6, IE7, IE 8, and IE 9</strong></p><div
class="wp-geshi-highlight-wrap5"><div
class="wp-geshi-highlight-wrap4"><div
class="wp-geshi-highlight-wrap3"><div
class="wp-geshi-highlight-wrap2"><div
class="wp-geshi-highlight-wrap"><div
class="wp-geshi-highlight"><div
class="bash"><pre class="de1">curl <span class="re5">-s</span> https:<span class="sy0">//</span>raw.github.com<span class="sy0">/</span>xdissent<span class="sy0">/</span>ievms<span class="sy0">/</span>master<span class="sy0">/</span>ievms.sh <span class="sy0">|</span> <span class="kw2">bash</span></pre></div></div></div></div></div></div></div><p><strong>Install Internet Explorer 7 Only</strong></p><div
class="wp-geshi-highlight-wrap5"><div
class="wp-geshi-highlight-wrap4"><div
class="wp-geshi-highlight-wrap3"><div
class="wp-geshi-highlight-wrap2"><div
class="wp-geshi-highlight-wrap"><div
class="wp-geshi-highlight"><div
class="bash"><pre class="de1">curl <span class="re5">-s</span> https:<span class="sy0">//</span>raw.github.com<span class="sy0">/</span>xdissent<span class="sy0">/</span>ievms<span class="sy0">/</span>master<span class="sy0">/</span>ievms.sh <span class="sy0">|</span> <span class="re2">IEVMS_VERSIONS</span>=<span class="st0">&quot;7&quot;</span> <span class="kw2">bash</span></pre></div></div></div></div></div></div></div><p><strong>Install Internet Explorer 8 Only</strong></p><div
class="wp-geshi-highlight-wrap5"><div
class="wp-geshi-highlight-wrap4"><div
class="wp-geshi-highlight-wrap3"><div
class="wp-geshi-highlight-wrap2"><div
class="wp-geshi-highlight-wrap"><div
class="wp-geshi-highlight"><div
class="bash"><pre class="de1">curl <span class="re5">-s</span> https:<span class="sy0">//</span>raw.github.com<span class="sy0">/</span>xdissent<span class="sy0">/</span>ievms<span class="sy0">/</span>master<span class="sy0">/</span>ievms.sh <span class="sy0">|</span> <span class="re2">IEVMS_VERSIONS</span>=<span class="st0">&quot;8&quot;</span> <span class="kw2">bash</span></pre></div></div></div></div></div></div></div><p><strong>Install Internet Explorer 9 Only</strong></p><div
class="wp-geshi-highlight-wrap5"><div
class="wp-geshi-highlight-wrap4"><div
class="wp-geshi-highlight-wrap3"><div
class="wp-geshi-highlight-wrap2"><div
class="wp-geshi-highlight-wrap"><div
class="wp-geshi-highlight"><div
class="bash"><pre class="de1">curl <span class="re5">-s</span> https:<span class="sy0">//</span>raw.github.com<span class="sy0">/</span>xdissent<span class="sy0">/</span>ievms<span class="sy0">/</span>master<span class="sy0">/</span>ievms.sh <span class="sy0">|</span> <span class="re2">IEVMS_VERSIONS</span>=<span class="st0">&quot;9&quot;</span> <span class="kw2">bash</span></pre></div></div></div></div></div></div></div><p>3. Open VirtualBox and launch your virtual machine. You will be prompted to type in account password, which is &#8220;Password1&#8243;. The password is also in the &#8220;Passowd hint&#8221; field if you forget it.</p><p>Cheers<br
/> Marko</p> ]]></content:encoded> <wfw:commentRss>http://www.markomedia.com.au/osx/ie6-ie7-ie8-ie9/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>opendiff and FileMerge on OS X</title><link>http://www.markomedia.com.au/osx/opendiff-and-filemerge-on-os-x/</link> <comments>http://www.markomedia.com.au/osx/opendiff-and-filemerge-on-os-x/#comments</comments> <pubDate>Sun, 15 Jan 2012 01:01:24 +0000</pubDate> <dc:creator>Marko Tomic</dc:creator> <category><![CDATA[OS X]]></category> <category><![CDATA[difftool]]></category> <category><![CDATA[filemerge]]></category> <category><![CDATA[opendiff]]></category> <category><![CDATA[utilities]]></category><guid
isPermaLink="false">http://www.markomedia.com.au/?p=1779</guid> <description><![CDATA[Today I discovered opendiff tool that&#8217;s native to OS X &#8211; provided you have installed the Xcode on your system. It allows you to compare 2 directories and perform actions such as merge-left, merge-right etc&#8230; Opendiff simply launches FileMerge OS X utility, which is another one I didn&#8217;t know about, and displays differences between 2...]]></description> <content:encoded><![CDATA[<p>Today I discovered <strong>opendiff</strong> tool that&#8217;s native to OS X &#8211; provided you have installed the Xcode on your system. It allows you to compare 2 directories and perform actions such as merge-left, merge-right etc&#8230;</p><p>Opendiff simply launches FileMerge OS X utility, which is another one I didn&#8217;t know about, and displays differences between 2 selected directories.</p><p>The very simple command to compare 2 directories is:</p><div
class="wp-geshi-highlight-wrap5"><div
class="wp-geshi-highlight-wrap4"><div
class="wp-geshi-highlight-wrap3"><div
class="wp-geshi-highlight-wrap2"><div
class="wp-geshi-highlight-wrap"><div
class="wp-geshi-highlight"><div
class="bash"><pre class="de1">opendiff dir1 dir2</pre></div></div></div></div></div></div></div><p>This will then launch FileMerge utility and give you a nice visual representation of differences in your folders:<br
/> <a
class="frame-holder aligncenter" href="http://www.markomedia.com.au/wp-content/uploads/2012/01/Screen-Shot-2012-01-15-at-12.00.54-PM.png" rel="shadowbox"><img
title="FileMerge" src="http://www.markomedia.com.au/wp-content/uploads/2012/01/Screen-Shot-2012-01-15-at-12.00.54-PM-300x161.png" alt="FileMerge" width="300" height="161" /></a><br
/> <a
class="frame-holder aligncenter" href="http://www.markomedia.com.au/wp-content/uploads/2012/01/Screen-Shot-2012-01-15-at-11.51.42-AM.png" rel="shadowbox"><img
title="FileMerge" src="http://www.markomedia.com.au/wp-content/uploads/2012/01/Screen-Shot-2012-01-15-at-11.51.42-AM-300x86.png" alt="FileMerge" width="300" height="86" /></a></p><p>Marko</p> ]]></content:encoded> <wfw:commentRss>http://www.markomedia.com.au/osx/opendiff-and-filemerge-on-os-x/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>Bandwidth throttling on OS X</title><link>http://www.markomedia.com.au/networking/bandwidth-throttling-on-os-x/</link> <comments>http://www.markomedia.com.au/networking/bandwidth-throttling-on-os-x/#comments</comments> <pubDate>Mon, 19 Dec 2011 12:46:24 +0000</pubDate> <dc:creator>Marko Tomic</dc:creator> <category><![CDATA[Networking]]></category> <category><![CDATA[bash]]></category> <category><![CDATA[networking]]></category> <category><![CDATA[OS X]]></category><guid
isPermaLink="false">http://www.markomedia.com.au/?p=1775</guid> <description><![CDATA[I&#8217;ve been using Charles HTTTP Proxy for bandwidth throttling and network monitoring in general. It&#8217;s a great little tool, but when it comes to bandwidth throttling, it will only throttle HTTP and HTTPS traffic on ports 80 and 443 respectively. I thought there had to be a way to throttle bandwidth on any port using...]]></description> <content:encoded><![CDATA[<p>I&#8217;ve been using <a
title="Charles HTTP Proxy" href="http://www.charlesproxy.com/">Charles HTTTP Proxy</a> for bandwidth throttling and network monitoring in general. It&#8217;s a great little tool, but when it comes to bandwidth throttling, it will only throttle HTTP and HTTPS traffic on ports 80 and 443 respectively.</p><p>I thought there had to be a way to throttle bandwidth on any port using the native <a
title="IP firewall and traffic shaper program" href="http://developer.apple.com/library/mac/#documentation/Darwin/Reference/ManPages/man8/ipfw.8.html">IP firewall and traffic shaper program</a>. After reading up the documentation for ipfw, I figured out a way to throttle speed on any outgoing port.</p><p>For example, the following example will create a pipe that will allow 25Kb/s to go through port 1935.</p><div
class="wp-geshi-highlight-wrap5"><div
class="wp-geshi-highlight-wrap4"><div
class="wp-geshi-highlight-wrap3"><div
class="wp-geshi-highlight-wrap2"><div
class="wp-geshi-highlight-wrap"><div
class="wp-geshi-highlight"><div
class="bash"><pre class="de1"><span class="kw2">sudo</span> ipfw pipe <span class="nu0">1</span> config bw 25KByte<span class="sy0">/</span>s
<span class="kw2">sudo</span> ipfw add <span class="nu0">1</span> pipe <span class="nu0">1</span> src-port <span class="nu0">1935</span></pre></div></div></div></div></div></div></div><p>To disable throttling, simply delete the throttling rule:</p><div
class="wp-geshi-highlight-wrap5"><div
class="wp-geshi-highlight-wrap4"><div
class="wp-geshi-highlight-wrap3"><div
class="wp-geshi-highlight-wrap2"><div
class="wp-geshi-highlight-wrap"><div
class="wp-geshi-highlight"><div
class="bash"><pre class="de1"><span class="kw2">sudo</span> ipfw delete <span class="nu0">1</span></pre></div></div></div></div></div></div></div><p>Marko</p> ]]></content:encoded> <wfw:commentRss>http://www.markomedia.com.au/networking/bandwidth-throttling-on-os-x/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>bash script useful tips</title><link>http://www.markomedia.com.au/linux/bash-script-useful-tips/</link> <comments>http://www.markomedia.com.au/linux/bash-script-useful-tips/#comments</comments> <pubDate>Wed, 30 Nov 2011 00:08:15 +0000</pubDate> <dc:creator>Marko Tomic</dc:creator> <category><![CDATA[Linux]]></category> <category><![CDATA[Shell]]></category> <category><![CDATA[bash]]></category><guid
isPermaLink="false">http://www.markomedia.com.au/?p=1767</guid> <description><![CDATA[At Learnosity I&#8217;ve spent last 2 days scripting virtual server deployment on Amazon cloud. For my reference, these are some useful commands I had to use to get the job done. 1. Hash &#8220;Hello World&#8221; string using SHA256 algorithm echo -n &#34;Hello World&#34; &#124; shasum -a 256 You can also hash a file shasum -a...]]></description> <content:encoded><![CDATA[<p>At <a
href="http://www.learnosity.com" title="Learnosity">Learnosity</a> I&#8217;ve spent last 2 days scripting virtual server deployment on Amazon cloud. For my reference, these are some useful commands I had to use to get the job done.<br
/> 1. Hash &#8220;Hello World&#8221; string using SHA256 algorithm</p><div
class="wp-geshi-highlight-wrap5"><div
class="wp-geshi-highlight-wrap4"><div
class="wp-geshi-highlight-wrap3"><div
class="wp-geshi-highlight-wrap2"><div
class="wp-geshi-highlight-wrap"><div
class="wp-geshi-highlight"><div
class="bash"><pre class="de1"><span class="kw3">echo</span> <span class="re5">-n</span> <span class="st0">&quot;Hello World&quot;</span> <span class="sy0">|</span> shasum <span class="re5">-a</span> <span class="nu0">256</span></pre></div></div></div></div></div></div></div><p>You can also hash a file</p><div
class="wp-geshi-highlight-wrap5"><div
class="wp-geshi-highlight-wrap4"><div
class="wp-geshi-highlight-wrap3"><div
class="wp-geshi-highlight-wrap2"><div
class="wp-geshi-highlight-wrap"><div
class="wp-geshi-highlight"><div
class="bash"><pre class="de1">shasum <span class="re5">-a</span> <span class="nu0">256</span> myfile.ext</pre></div></div></div></div></div></div></div><p>2. Display server IP address by stripping out all other network information, including the local 127.0.0.1 IP</p><div
class="wp-geshi-highlight-wrap5"><div
class="wp-geshi-highlight-wrap4"><div
class="wp-geshi-highlight-wrap3"><div
class="wp-geshi-highlight-wrap2"><div
class="wp-geshi-highlight-wrap"><div
class="wp-geshi-highlight"><div
class="bash"><pre class="de1"><span class="kw2">ifconfig</span>  <span class="sy0">|</span> <span class="kw2">grep</span> <span class="st_h">'inet addr:'</span><span class="sy0">|</span> <span class="kw2">grep</span> <span class="re5">-v</span> <span class="st_h">'127.0.0.1'</span> <span class="sy0">|</span> <span class="kw2">cut</span> -d: <span class="re5">-f2</span> <span class="sy0">|</span> <span class="kw2">awk</span> <span class="st_h">'{ print $1}'</span></pre></div></div></div></div></div></div></div><p>3. Read out first 64 characters from a long string</p><div
class="wp-geshi-highlight-wrap5"><div
class="wp-geshi-highlight-wrap4"><div
class="wp-geshi-highlight-wrap3"><div
class="wp-geshi-highlight-wrap2"><div
class="wp-geshi-highlight-wrap"><div
class="wp-geshi-highlight"><div
class="bash"><pre class="de1"><span class="co1">${mystring:0:64}</span></pre></div></div></div></div></div></div></div><p>4. While loop with 10 iterations</p><div
class="wp-geshi-highlight-wrap5"><div
class="wp-geshi-highlight-wrap4"><div
class="wp-geshi-highlight-wrap3"><div
class="wp-geshi-highlight-wrap2"><div
class="wp-geshi-highlight-wrap"><div
class="wp-geshi-highlight"><div
class="bash"><pre class="de1"><span class="re2">i</span>=<span class="nu0">0</span>;
<span class="kw1">while</span> <span class="br0">&#91;</span> <span class="re1">$i</span> <span class="re5">-lt</span> <span class="nu0">10</span> <span class="br0">&#93;</span>
<span class="kw1">do</span>
    <span class="kw3">echo</span> <span class="re1">$i</span>
    <span class="re2">i</span>=$<span class="br0">&#91;</span><span class="re1">$i</span>+<span class="nu0">1</span><span class="br0">&#93;</span>
<span class="kw1">done</span></pre></div></div></div></div></div></div></div><p>5. Replace contents of a file. For example search for string1, replace with string2 in myfile.txt</p><div
class="wp-geshi-highlight-wrap5"><div
class="wp-geshi-highlight-wrap4"><div
class="wp-geshi-highlight-wrap3"><div
class="wp-geshi-highlight-wrap2"><div
class="wp-geshi-highlight-wrap"><div
class="wp-geshi-highlight"><div
class="bash"><pre class="de1"><span class="kw2">sed</span> <span class="re5">-e</span> <span class="st0">&quot;s/string1/string2/g&quot;</span> myfile.txt <span class="sy0">&gt;</span> myfile.txt_temp
<span class="kw2">mv</span> myfile.txt_temp myfile.txt</pre></div></div></div></div></div></div></div><p>6. Display number of CPU processors on Linux<br
/> The command simply pulls out all instances of the word &#8216;processor&#8217; from /proc/cpuinfo and returns the word count of it.</p><div
class="wp-geshi-highlight-wrap5"><div
class="wp-geshi-highlight-wrap4"><div
class="wp-geshi-highlight-wrap3"><div
class="wp-geshi-highlight-wrap2"><div
class="wp-geshi-highlight-wrap"><div
class="wp-geshi-highlight"><div
class="bash"><pre class="de1"><span class="kw2">cat</span> <span class="sy0">/</span>proc<span class="sy0">/</span>cpuinfo <span class="sy0">|</span> <span class="kw2">grep</span> processor <span class="sy0">|</span> <span class="kw2">wc</span> <span class="re5">-l</span></pre></div></div></div></div></div></div></div><p>Marko</p> ]]></content:encoded> <wfw:commentRss>http://www.markomedia.com.au/linux/bash-script-useful-tips/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>apr_sockaddr_info_get() failed for mydomain.com</title><link>http://www.markomedia.com.au/apache/apr_sockaddr_info_get-failed-for-mydomain-com/</link> <comments>http://www.markomedia.com.au/apache/apr_sockaddr_info_get-failed-for-mydomain-com/#comments</comments> <pubDate>Thu, 24 Nov 2011 09:46:19 +0000</pubDate> <dc:creator>Marko Tomic</dc:creator> <category><![CDATA[Apache]]></category><guid
isPermaLink="false">http://www.markomedia.com.au/?p=1762</guid> <description><![CDATA[I recently changed my ISP from Optus to TPG and when I tried to start my local apache instance and I got this error httpd: apr_sockaddr_info_get&#40;&#41; failed for 192-168-1-107.tpgi.com.au httpd: Could not reliably determine the server's fully qualified domain name, using 127.0.0.1 for ServerName That gave me a hint that my local hostname had changed....]]></description> <content:encoded><![CDATA[<p>I recently changed my ISP from Optus to TPG and when I tried to start my local apache instance and I got this error</p><div
class="wp-geshi-highlight-wrap5"><div
class="wp-geshi-highlight-wrap4"><div
class="wp-geshi-highlight-wrap3"><div
class="wp-geshi-highlight-wrap2"><div
class="wp-geshi-highlight-wrap"><div
class="wp-geshi-highlight"><div
class="bash"><pre class="de1">httpd: apr_sockaddr_info_get<span class="br0">&#40;</span><span class="br0">&#41;</span> failed <span class="kw1">for</span> <span class="nu0">192</span>-<span class="nu0">168</span>-<span class="nu0">1</span>-<span class="nu0">107</span>.tpgi.com.au
httpd: Could not reliably determine the server<span class="st_h">'s fully qualified domain name, using 127.0.0.1 for ServerName</span></pre></div></div></div></div></div></div></div><p>That gave me a hint that my local hostname had changed.  I reset it back to what it was originally like this:</p><div
class="wp-geshi-highlight-wrap5"><div
class="wp-geshi-highlight-wrap4"><div
class="wp-geshi-highlight-wrap3"><div
class="wp-geshi-highlight-wrap2"><div
class="wp-geshi-highlight-wrap"><div
class="wp-geshi-highlight"><div
class="bash"><pre class="de1"><span class="kw2">sudo</span> <span class="kw2">hostname</span> myoldhostname.local</pre></div></div></div></div></div></div></div><p>Restarted apache and it was smooth sailing again.</p><p>Marko</p> ]]></content:encoded> <wfw:commentRss>http://www.markomedia.com.au/apache/apr_sockaddr_info_get-failed-for-mydomain-com/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>AES-128 padded encryption/decryption with Railo, Java and AS3</title><link>http://www.markomedia.com.au/java/aes-128-padded-encryptiondecryption-with-railo-java-and-as3/</link> <comments>http://www.markomedia.com.au/java/aes-128-padded-encryptiondecryption-with-railo-java-and-as3/#comments</comments> <pubDate>Fri, 14 Oct 2011 14:05:43 +0000</pubDate> <dc:creator>Marko Tomic</dc:creator> <category><![CDATA[AS3]]></category> <category><![CDATA[Java]]></category> <category><![CDATA[Railo]]></category> <category><![CDATA[java]]></category><guid
isPermaLink="false">http://www.markomedia.com.au/?p=1752</guid> <description><![CDATA[I&#8217;ve recently been working on text file decryption using Railo server. My files were encrypted in ActionScript 3 with the powerful AES-128 algorithm. For more info on AS3 encryption see Hurlant Crypto demo. My challenge was to decypt this heavily encrypted content on a different platform, i.e. Railo with underlying Java Cipher capabilities. The 6...]]></description> <content:encoded><![CDATA[<p>I&#8217;ve recently been working on text file decryption using Railo server. My files were encrypted in ActionScript 3 with the powerful AES-128 algorithm. For more info on AS3 encryption see <a
title="Hurlant Crypto demo" href="http://crypto.hurlant.com/demo/">Hurlant Crypto demo</a>.</p><p>My challenge was to decypt this heavily encrypted content on a different platform, i.e. Railo with underlying Java Cipher capabilities.</p><p>The 6 things I knew about the encrypted content were:<br
/> 1. Encryption Method &#8211; AES<br
/> 2. Mode &#8211; CBC (Cipher-block chaining)<br
/> 3. Padding &#8211; PKCS5<br
/> 4. Initialisation Vector (IV) &#8211; given hex string<br
/> 5. Passphrase &#8211; given hex string<br
/> 6. Encrypted text file saved in base64 encoded string.</p><p>For my records, this is how I went about decrypting on Railo:</p><div
class="wp-geshi-highlight-wrap5"><div
class="wp-geshi-highlight-wrap4"><div
class="wp-geshi-highlight-wrap3"><div
class="wp-geshi-highlight-wrap2"><div
class="wp-geshi-highlight-wrap"><div
class="wp-geshi-highlight"><div
class="cfm"><pre class="de1"><span class="sc5"><span class="sy0">&lt;</span><span class="kw1">cfscript</span><span class="sy0">&gt;</span></span>
// Create some java objects
IvParameterSpec = createObject(&quot;java&quot;, &quot;javax.crypto.spec.IvParameterSpec&quot;);
Cipher = createObject(&quot;java&quot;, &quot;javax.crypto.Cipher&quot;);
SecretKeySpec = createObject(&quot;java&quot;, &quot;javax.crypto.spec.SecretKeySpec&quot;);
BASE64Decoder = createObject(&quot;java&quot;, &quot;sun.misc.BASE64Decoder&quot;);
Str = createObject(&quot;java&quot;, &quot;java.lang.String&quot;);
MessageDigest = createObject(&quot;java&quot;, &quot;java.security.MessageDigest&quot;);
&nbsp;
encryptedFileContent = &quot;base64encodedcontent&quot;;
password = binarydecode(&quot;somehexpassphrase&quot;, &quot;hex&quot;);
iv = binarydecode(&quot;somehexivstring&quot;, &quot;hex&quot;);
&nbsp;
skeySpec = SecretKeySpec.init(password, &quot;AES&quot;);
ivSpec = IvParameterSpec.init(iv);
cipher = Cipher.getInstance(&quot;AES/CBC/PKCS5Padding&quot;);
&nbsp;
encryptedContent = BASE64Decoder.decodeBuffer(encryptedFileContent);
cipher.init(Cipher.DECRYPT_MODE,skeySpec,ivSpec);
decryptedBytes = cipher.doFinal(encryptedContent);
decryptedString = Str.init(decryptedBytes);
<span class="sc5"><span class="sy0">&lt;/</span><span class="kw1">cfscript</span><span class="sy0">&gt;</span></span></pre></div></div></div></div></div></div></div><p>Now that we know how the decryption works, encrypting data on Railo should be a piece of cake. For example:</p><div
class="wp-geshi-highlight-wrap5"><div
class="wp-geshi-highlight-wrap4"><div
class="wp-geshi-highlight-wrap3"><div
class="wp-geshi-highlight-wrap2"><div
class="wp-geshi-highlight-wrap"><div
class="wp-geshi-highlight"><div
class="cfm"><pre class="de1"><span class="sc5"><span class="sy0">&lt;</span><span class="kw1">cfscript</span><span class="sy0">&gt;</span></span>
password = &quot;somepassphrase&quot;;
stringToEncrypt = &quot;stringToEncrypt&quot;;
md = MessageDigest.getInstance(&quot;MD5&quot;);
md.update(password.getBytes(&quot;UTF-8&quot;), 0, password.length());
rawKey = md.digest();
&nbsp;
skeySpec = SecretKeySpec.init(rawKey, &quot;AES&quot;);
ivSpec = IvParameterSpec.init(rawKey);
cipher = Cipher.getInstance(&quot;AES/CBC/PKCS5Padding&quot;);
cipher.init(Cipher.ENCRYPT_MODE, skeySpec, ivSpec);
&nbsp;
encryptedbytes = cipher.doFinal(stringToEncrypt.getBytes());
<span class="sc5"><span class="sy0">&lt;/</span><span class="kw1">cfscript</span><span class="sy0">&gt;</span></span></pre></div></div></div></div></div></div></div><p>The only thing you need to be aware of is the format of parameters passed into encryption/decryption logic, and convert them appropriately. These parameters can be either plain, base64 or hex strings.</p><p>Who would&#8217;ve thought that reverse engineering could be som much fun <img
src='http://www.markomedia.com.au/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /></p><p>Cheers<br
/> Marko</p> ]]></content:encoded> <wfw:commentRss>http://www.markomedia.com.au/java/aes-128-padded-encryptiondecryption-with-railo-java-and-as3/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>Compile Apache2 from source on OS X</title><link>http://www.markomedia.com.au/apache/compile-apache2-from-source-on-os-x/</link> <comments>http://www.markomedia.com.au/apache/compile-apache2-from-source-on-os-x/#comments</comments> <pubDate>Sat, 08 Oct 2011 04:43:21 +0000</pubDate> <dc:creator>Marko Tomic</dc:creator> <category><![CDATA[Apache]]></category><guid
isPermaLink="false">http://www.markomedia.com.au/?p=1744</guid> <description><![CDATA[I&#8217;ve had to reinstall apache server on my Mac and the only way to do it cleanly was to nuke my existing apache installation and compile a fresh one from source. That&#8217;s all cool, but I could never remember what modules I needed and how to enable them.  If you don&#8217;t load any modules at...]]></description> <content:encoded><![CDATA[<p>I&#8217;ve had to reinstall apache server on my Mac and the only way to do it cleanly was to nuke my existing apache installation and compile a fresh one from source.</p><p>That&#8217;s all cool, but I could never remember what modules I needed and how to enable them.  If you don&#8217;t load any modules at compile time, this is the most likely error you&#8217;ll get when you start apache web server:</p><div
class="wp-geshi-highlight-wrap5"><div
class="wp-geshi-highlight-wrap4"><div
class="wp-geshi-highlight-wrap3"><div
class="wp-geshi-highlight-wrap2"><div
class="wp-geshi-highlight-wrap"><div
class="wp-geshi-highlight"><div
class="bash"><pre class="de1">Invalid <span class="kw3">command</span> <span class="st_h">'Order'</span>, perhaps misspelled or defined by a module not included <span class="kw1">in</span> the server configuration</pre></div></div></div></div></div></div></div><p>So the following steps worked well for me.</p><p>1. <a
title="Apache 2.2 Web Server source code" href="http://httpd.apache.org/download.cgi#apache22">Download Apache 2.2 source code<br
/> </a><br
/> 2. Extract the source code and configure apache with required modules. These modules are the ones I normally need. You can customise this to your needs:</p><div
class="wp-geshi-highlight-wrap5"><div
class="wp-geshi-highlight-wrap4"><div
class="wp-geshi-highlight-wrap3"><div
class="wp-geshi-highlight-wrap2"><div
class="wp-geshi-highlight-wrap"><div
class="wp-geshi-highlight"><div
class="bash"><pre class="de1">.<span class="sy0">/</span>configure  <span class="re5">--prefix</span>=<span class="sy0">/</span>usr<span class="sy0">/</span>local<span class="sy0">/</span>apache2 \
<span class="re5">--enable-mods-shared</span>=all \
<span class="re5">--enable-shared</span> \
<span class="re5">--enable-deflate</span> \
<span class="re5">--enable-proxy</span> \
<span class="re5">--enable-proxy-http</span> \
<span class="re5">--enable-ssl</span> \
<span class="re5">--enable-cgi</span> \
<span class="re5">--enable-cgid</span> \
<span class="re5">--enable-cache</span>
&nbsp;
<span class="kw2">make</span> \
&nbsp;
<span class="kw2">make</span> <span class="kw2">install</span> \</pre></div></div></div></div></div></div></div><p>Check /usr/local/apache2/modules directory and make sure required modules have been installed.</p><p>Marko</p> ]]></content:encoded> <wfw:commentRss>http://www.markomedia.com.au/apache/compile-apache2-from-source-on-os-x/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>Extract z01 files on Mac OS X &#8211; howto</title><link>http://www.markomedia.com.au/osx/extract-z01-files-on-mac-os-x-howto/</link> <comments>http://www.markomedia.com.au/osx/extract-z01-files-on-mac-os-x-howto/#comments</comments> <pubDate>Thu, 22 Sep 2011 12:22:25 +0000</pubDate> <dc:creator>Marko Tomic</dc:creator> <category><![CDATA[HOWTO]]></category> <category><![CDATA[OS X]]></category><guid
isPermaLink="false">http://www.markomedia.com.au/?p=1739</guid> <description><![CDATA[The first of multiple files that make up a split archive created with WinZip; uses the same compression as a standard .ZIP file, but must be decompressed along with the related split archives (.Z02, .Z03, etc.). Split archives are often used to shrink the size of large files for e-mail attachments or file downloads. They...]]></description> <content:encoded><![CDATA[<p>The first of multiple files that make up a split archive created with WinZip; uses the same compression as a standard .ZIP file, but must be decompressed along with the related split archives (.Z02, .Z03, etc.).</p><p>Split archives are often used to shrink the size of large files for e-mail attachments or file downloads. They can only be decompressed if all the split archive segments are available.</p><p>To decompress a series of z01, z02&#8230; files you need to do the following</p><p>1) Change all .z01, .z02 extensions to .001, .002 and so on.<br
/> 2) The last extension in compressed series will have a .zip extension. If you have 8 segments, change .zip to .008.<br
/> 3) Join all segments using &#8220;<a
title="MacHacha" href="http://homepage.mac.com/julifos/soft/machacha/index.html">MacHacha</a>&#8221;<br
/> 4) Change the extension of the file produced by <a
href="http://homepage.mac.com/julifos/soft/machacha/index.html">MacHacha</a> to .zip<br
/> 5) Use &#8220;<a
href="http://wakaba.c3.cx/s/apps/unarchiver.html">The Unarchiver</a>&#8221; to decompress the .zip file produced by MacHacha.</p><p>References:<br
/> <a
title="z01 extension" href="http://www.fileinfo.com/extension/z01">http://www.fileinfo.com/extension/z01</a></p> ]]></content:encoded> <wfw:commentRss>http://www.markomedia.com.au/osx/extract-z01-files-on-mac-os-x-howto/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>Increase PHP file upload limit</title><link>http://www.markomedia.com.au/php/increase-php-file-upload-limit/</link> <comments>http://www.markomedia.com.au/php/increase-php-file-upload-limit/#comments</comments> <pubDate>Thu, 22 Sep 2011 09:16:16 +0000</pubDate> <dc:creator>Marko Tomic</dc:creator> <category><![CDATA[PHP]]></category> <category><![CDATA[Apache]]></category><guid
isPermaLink="false">http://www.markomedia.com.au/?p=1735</guid> <description><![CDATA[I tried uploading a large file from Flash to php back end and got the following error: PHP Warning: POST Content-Length of 18348279 bytes exceeds the limit of 8388608 bytes It&#8217;s self explanatory, my PHP installation by default only allows up to 8MB of data to be uploaded to the server. To solve this you...]]></description> <content:encoded><![CDATA[<p>I tried uploading a large file from Flash to php back end and got the following error:</p><div
class="wp-geshi-highlight-wrap5"><div
class="wp-geshi-highlight-wrap4"><div
class="wp-geshi-highlight-wrap3"><div
class="wp-geshi-highlight-wrap2"><div
class="wp-geshi-highlight-wrap"><div
class="wp-geshi-highlight"><div
class="bash"><pre class="de1">PHP Warning: POST Content-Length of <span class="nu0">18348279</span> bytes exceeds the limit of <span class="nu0">8388608</span> bytes</pre></div></div></div></div></div></div></div><p>It&#8217;s self explanatory, my PHP installation by default only allows up to 8MB of data to be uploaded to the server. To solve this you need to change the following 2 variables in php.ini file:<br
/> <strong>post_max_size = 8M</strong><br
/> and<br
/> <strong>upload_max_filesize = 2M</strong></p><p>Marko</p> ]]></content:encoded> <wfw:commentRss>http://www.markomedia.com.au/php/increase-php-file-upload-limit/feed/</wfw:commentRss> <slash:comments>1</slash:comments> </item> <item><title>Load files from Amazon S3 into Flash using AS3 Bulk Loader</title><link>http://www.markomedia.com.au/as3/load-files-from-amazon-s3-into-flash-using-as3-bulk-loader/</link> <comments>http://www.markomedia.com.au/as3/load-files-from-amazon-s3-into-flash-using-as3-bulk-loader/#comments</comments> <pubDate>Mon, 12 Sep 2011 01:50:59 +0000</pubDate> <dc:creator>Marko Tomic</dc:creator> <category><![CDATA[AS3]]></category> <category><![CDATA[Flash]]></category> <category><![CDATA[Flex]]></category> <category><![CDATA[S3]]></category><guid
isPermaLink="false">http://www.markomedia.com.au/?p=1656</guid> <description><![CDATA[I had a go at loading some assets from Amazon S3 with AS3 bulk loader and ran into trouble. Generally I specify loader context when I load files from external source, but I thought Bulk Loader handled it all internally.  After browsing the source code I found out that you can pass the LoaderContext into...]]></description> <content:encoded><![CDATA[<p>I had a go at loading some assets from Amazon S3 with <a
title="AS3 Bulk Loader" href="http://code.google.com/p/bulk-loader/">AS3 bulk loader</a> and ran into trouble. Generally I specify loader context when I load files from external source, but I thought Bulk Loader handled it all internally.  After browsing the source code I found out that you can pass the <a
href="http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/system/LoaderContext.html">LoaderContext</a> into each loading item.</p><p>You can specify LoaderContext for each BulkLoader item like so:</p><div
class="wp-geshi-highlight-wrap5"><div
class="wp-geshi-highlight-wrap4"><div
class="wp-geshi-highlight-wrap3"><div
class="wp-geshi-highlight-wrap2"><div
class="wp-geshi-highlight-wrap"><div
class="wp-geshi-highlight"><div
class="as3"><pre class="de1">var context:LoaderContext = new LoaderContext(true, ApplicationDomain.currentDomain);
var loader:BulkLoader = new BulkLoader(&quot;myBulkLoaderInstance&quot;);
loader.add( amazonS3Domain, { context: context  } );</pre></div></div></div></div></div></div></div><p>Thanks to <a
title="Trevor Hartman's blog" href="http://blog.devth.com/amazon-s3-bulkloader-use-a-loadercontext">Trevor Hartman</a> for this snippet.</p><p>Also &#8220;<a
href="http://aws.amazon.com/articles/2011">Using Amazon S3 with Adobe Flash and Microsoft Silverlight</a>&#8221; article has some useful tips on this topic as well as crossdomain policy files.</p><p>I haven&#8217;t tried using this technique to load files from other APIs such as Facebook, so I&#8217;d imagine you&#8217;d have to follow the same approach.</p><p>Marko</p> ]]></content:encoded> <wfw:commentRss>http://www.markomedia.com.au/as3/load-files-from-amazon-s3-into-flash-using-as3-bulk-loader/feed/</wfw:commentRss> <slash:comments>1</slash:comments> </item> </channel> </rss>
<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Minified using disk: basic
Page Caching using disk: enhanced
Database Caching 11/50 queries in 0.036 seconds using disk: basic
Object Caching 736/846 objects using disk: basic

Served from: www.markomedia.com.au @ 2012-02-23 20:53:21 -->
